/* ===== Editor: layout & cards ===== */
.ed-header {
    margin-bottom: 1rem
}

.ed-layout {
    display: grid;
    grid-template-columns:340px 1fr;
    gap: 24px;
    align-items: stretch; /* sağ kolon tam yükseklik */
    overflow: visible; /* sticky için kritik: üstte overflow yaratma */
}

.ed-panel {
    position: sticky;
    /* Navbar yüksekliğini değişkenden al; base.html'de .site-header boyutu JS ile yazılıyor */
    top: calc(var(--nav-h, 88px) + 12px);
    align-self: start;
    height: fit-content; /* grid+sticky kombinasyonunda güvenli */
}

/* kartlar */
.ed-card {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 182, 225, .16);
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: .8rem;
}

.ed-label {
    font-weight: 700;
    display: block;
    margin-bottom: .35rem
}

.ed-row {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: .35rem
}

.ed-slider {
    display: grid;
    grid-template-columns:120px 1fr 48px;
    gap: .5rem;
    align-items: center;
    margin: .4rem 0;
}

/* ===== Buttons ===== */
.btn {
    border: 1px solid rgba(255, 182, 225, .25);
    background: rgba(255, 255, 255, .06);
    color: #fff;
    border-radius: .8rem;
    padding: .5rem .8rem
}

.btn:disabled {
    opacity: .5
}

.btn-primary {
    background: #ff5fb8;
    border-color: transparent;
    color: #140713
}

.btn-pill {
    border-radius: 999px
}

/* ===== Work area (right column) ===== */
.ed-work {
    position: relative;
    height: calc(100vh - 220px); /* canvas görünür kalsın */
    overflow: auto; /* sahne içeride scroll */
    padding-bottom: 56px;
}

/* Stage */
.ed-stage {
    position: relative;
    background: rgba(255, 255, 255, .02);
    border: 1px dashed rgba(255, 182, 225, .2);
    border-radius: 1rem;
    min-height: 600px;
    height: clamp(520px, 68vh, 82vh);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Canvas */
#preview {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%
}

/* Hint */
.ed-hint {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #aaa;
    font-style: italic;
    pointer-events: none
}

/* Checkerboard */
.checkboard {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: conic-gradient(#0000 90deg, #00000010 0) 0 0/16px 16px,
    conic-gradient(#0000 90deg, #ffffff12 0) 8px 8px/16px 16px;
}

/* Grid overlay */
.grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(to right, rgba(255, 255, 255, .06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: .25
}

/* Toolbar */
.ed-toolbar {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    gap: 8px;
    padding: .5rem .5rem .25rem;
    backdrop-filter: blur(6px)
}

.zoom-readout {
    opacity: .9;
    align-self: center
}

/* Responsive */
@media (max-width: 980px) {
    .ed-layout {
        grid-template-columns:1fr
    }

    .ed-work {
        height: calc(100vh - 300px)
    }
}
