/* =====================================================================
   YÖNETİM PANELİ

   Kullanıcı müze personelidir: geniş dokunma hedefleri, büyük yazı,
   her alanın altında ne işe yaradığını söyleyen bir satır. Açık tema —
   panelde çoğunlukla masaüstünden ve aydınlık ofiste çalışılır.
   ===================================================================== */

:root {
    --a-bg: #F4F6F8;
    --a-surface: #FFFFFF;
    --a-border: #DDE3EA;
    --a-text: #1B2430;
    --a-dim: #5B6774;
    --a-brand: #1B4965;
    --a-ok: #1E7B4D;
    --a-warn: #9A6400;
    --a-warn-bg: #FFF6E0;
    --a-danger: #B3261E;
    --a-radius: 10px;
}

* { box-sizing: border-box; }

body.admin {
    margin: 0;
    background: var(--a-bg);
    color: var(--a-text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

a { color: var(--a-brand); }

/* ---------------- Üst çubuk ---------------- */

.topbar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 20px;
    min-height: 58px;
    background: var(--a-brand);
    color: #fff;
}

.topbar__brand {
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.topbar__nav {
    display: flex;
    gap: 4px;
    flex: 1;
    flex-wrap: wrap;
}

.topbar__link {
    padding: 8px 14px;
    border-radius: 8px;
    color: #D8E6EF;
    text-decoration: none;
}

.topbar__link:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.topbar__link.is-active { background: rgba(255, 255, 255, .18); color: #fff; }

.topbar__user { font-size: .85rem; color: #C7DAE6; white-space: nowrap; }
.topbar__user a { color: #fff; }

/* ---------------- Sayfa ---------------- */

.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 22px 20px 60px;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.page-head h1 { margin: 0; font-size: 1.5rem; }

/* ---------------- Kartlar ---------------- */

.card-a {
    background: var(--a-surface);
    border: 1px solid var(--a-border);
    border-radius: var(--a-radius);
    padding: 20px;
    margin-bottom: 18px;
}

.card-a__title { margin: 0 0 14px; font-size: 1.05rem; }

/* ---------------- Bildirimler ---------------- */

.note {
    padding: 12px 15px;
    border-radius: var(--a-radius);
    border: 1px solid var(--a-border);
    background: var(--a-surface);
    margin-bottom: 16px;
}

.note--ok     { border-color: #BBE3CC; background: #EDFBF3; color: var(--a-ok); }
.note--warn   { border-color: #F0DCA8; background: var(--a-warn-bg); color: var(--a-warn); }
.note--error  { border-color: #F1C3C0; background: #FDF1F0; color: var(--a-danger); }

/* ---------------- Form ---------------- */

.field { margin-bottom: 18px; }

.field > label,
.field__label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.field__hint {
    margin: 6px 0 0;
    font-size: .86rem;
    color: var(--a-dim);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--a-border);
    border-radius: 8px;
    background: #fff;
    color: inherit;
    font: inherit;
}

textarea { min-height: 130px; resize: vertical; }

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--a-brand);
    outline-offset: 1px;
    border-color: var(--a-brand);
}

.grid-2 {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* ---------------- Butonlar ---------------- */

.btn-a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--a-brand);
    color: #fff;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn-a:hover { filter: brightness(1.08); }
.btn-a:disabled { opacity: .5; cursor: not-allowed; }

.btn-a--ghost {
    background: #fff;
    border-color: var(--a-border);
    color: var(--a-text);
}

.btn-a--danger { background: var(--a-danger); }

.btn-a--small { min-height: 36px; padding: 6px 12px; font-size: .88rem; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------------- Tablo ---------------- */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--a-border);
    border-radius: var(--a-radius);
    background: var(--a-surface);
}

table.list {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

table.list th,
table.list td {
    padding: 11px 14px;
    text-align: start;
    border-bottom: 1px solid var(--a-border);
    vertical-align: middle;
}

table.list th {
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--a-dim);
    background: #FAFBFC;
}

table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover { background: #FAFCFE; }

.thumb {
    width: 54px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--a-border);
    background: #EEF1F4;
}

.artwork-cell { display: flex; align-items: center; gap: 12px; }
.artwork-cell__title { font-weight: 600; }
.artwork-cell__meta { font-size: .82rem; color: var(--a-dim); }

/* ---------------- Rozetler ---------------- */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge--draft     { background: #EEF1F4; color: var(--a-dim); }
.badge--published { background: #E3F5EB; color: var(--a-ok); }
.badge--warn      { background: var(--a-warn-bg); color: var(--a-warn); }

.type-icons { display: flex; gap: 6px; font-size: 1rem; }
.type-icons span { opacity: .85; }

/* ---------------- Sekmeler ---------------- */

.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--a-border);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tabs__item {
    padding: 11px 18px;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 600;
    color: var(--a-dim);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tabs__item[aria-selected="true"] {
    color: var(--a-brand);
    border-bottom-color: var(--a-brand);
}

.tabpanel[hidden] { display: none; }

/* ---------------- Dosya seçici ---------------- */

.filefield {
    border: 1px solid var(--a-border);
    border-radius: var(--a-radius);
    padding: 14px;
    background: #FAFBFC;
}

.filefield__current {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.filefield__name {
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: .86rem;
    word-break: break-all;
}

.filefield__none { color: var(--a-dim); font-style: italic; }

.modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(16, 22, 30, .55);
}

.modal[hidden] { display: none; }

.modal__box {
    width: 100%;
    max-width: 680px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--a-radius);
    overflow: hidden;
}

.modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--a-border);
}

.modal__head h2 { margin: 0; font-size: 1.05rem; }

.modal__tools { padding: 12px 18px; border-bottom: 1px solid var(--a-border); }

.modal__body { overflow-y: auto; padding: 8px 0; }

.filelist { list-style: none; margin: 0; padding: 0; }

.filelist__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-bottom: 1px solid #F0F3F6;
}

.filelist__item:hover { background: #F7FAFC; }

.filelist__preview {
    width: 46px;
    height: 36px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid var(--a-border);
    background: #EEF1F4;
    flex: none;
}

.filelist__info { flex: 1; min-width: 0; }
.filelist__name { font-weight: 600; word-break: break-all; }
.filelist__meta { font-size: .82rem; color: var(--a-dim); }
.filelist__empty { padding: 26px 18px; color: var(--a-dim); text-align: center; }

/* ---------------- Giriş ekranı ---------------- */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 380px;
    background: var(--a-surface);
    border: 1px solid var(--a-border);
    border-radius: var(--a-radius);
    padding: 28px 24px;
}

.login-box h1 { margin: 0 0 18px; font-size: 1.25rem; }

/* ---------------- Derleyici ---------------- */

.dropzone {
    border: 2px dashed var(--a-border);
    border-radius: var(--a-radius);
    padding: 38px 20px;
    text-align: center;
    background: #FAFBFC;
    cursor: pointer;
}

.dropzone.is-over { border-color: var(--a-brand); background: #EEF5FA; }

.dropzone__preview {
    max-width: 260px;
    max-height: 200px;
    margin: 0 auto 12px;
    display: block;
    border-radius: 8px;
}

.meter {
    height: 10px;
    border-radius: 999px;
    background: #E7EBF0;
    overflow: hidden;
    margin: 10px 0;
}

.meter__fill { height: 100%; width: 0; background: var(--a-ok); transition: width .3s; }
.meter__fill.is-low  { background: var(--a-danger); }
.meter__fill.is-fair { background: var(--a-warn); }

.rules { margin: 0; padding-inline-start: 20px; color: var(--a-dim); }
.rules li { margin-bottom: 5px; }

/* ---------------- QR ---------------- */

.qr-box { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.qr-box__code { width: 200px; height: 200px; border: 1px solid var(--a-border); border-radius: 8px; background: #fff; padding: 8px; }
.qr-box__info { flex: 1; min-width: 240px; }

.url-line {
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: .88rem;
    padding: 9px 12px;
    background: #F4F6F8;
    border: 1px solid var(--a-border);
    border-radius: 7px;
    word-break: break-all;
}

/* =====================================================================
   İÇERİK YERLEŞTİRME EKRANI

   Sol: içerik listesi (sürükle-bırak sıralı)
   Sağ: canlı 3B önizleme
   Alt: sayısal alanlar — sürükleme ile karşılıklı güncellenir
   ===================================================================== */

.editor {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.editor__side {
    background: var(--a-surface);
    border: 1px solid var(--a-border);
    border-radius: var(--a-radius);
    padding: 14px;
}

.editor__stage {
    background: var(--a-surface);
    border: 1px solid var(--a-border);
    border-radius: var(--a-radius);
    overflow: hidden;
}

/* --- Sahne --- */

.stage__toolbar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--a-border);
    background: #FAFBFC;
}

.stage__canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 320px;
    background: #202833;
    touch-action: none;     /* sürükleme tarayıcı kaydırmasıyla çakışmasın */
}

.stage__canvas canvas { display: block; width: 100%; height: 100%; }

.stage__hint {
    margin: 0;
    padding: 8px 12px;
    font-size: .82rem;
    color: var(--a-dim);
    border-top: 1px solid var(--a-border);
}

.stage__badge {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(16, 22, 30, .72);
    color: #fff;
    font-size: .78rem;
    pointer-events: none;
}

/* --- İçerik listesi --- */

.clist { list-style: none; margin: 0 0 12px; padding: 0; }

.clist__item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    margin-bottom: 6px;
    border: 1px solid var(--a-border);
    border-radius: 8px;
    background: #fff;
    cursor: grab;
}

.clist__item.is-selected {
    border-color: var(--a-brand);
    box-shadow: inset 0 0 0 1px var(--a-brand);
}

.clist__item.is-dragging { opacity: .45; }
.clist__item.is-inactive .clist__label { color: var(--a-dim); text-decoration: line-through; }

.clist__grip { color: #AAB4BF; font-size: 1rem; line-height: 1; }
.clist__icon { font-size: 1.05rem; }

.clist__info { flex: 1; min-width: 0; }
.clist__label { font-weight: 600; font-size: .9rem; word-break: break-word; }
.clist__meta { font-size: .76rem; color: var(--a-dim); }

.clist__warn { color: var(--a-danger); font-size: .95rem; }

.clist__empty {
    padding: 18px 10px;
    color: var(--a-dim);
    font-size: .9rem;
    text-align: center;
}

/* --- Ekleme kutusu --- */

.addbox {
    border: 1px solid var(--a-border);
    border-radius: 8px;
    padding: 12px;
    background: #FAFBFC;
    margin-bottom: 12px;
}

.addbox[hidden] { display: none; }

/* --- Özellik alanları --- */

.props[hidden] { display: none; }

.props__empty {
    padding: 26px 10px;
    text-align: center;
    color: var(--a-dim);
}

.numrow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.numrow label {
    font-size: .76rem;
    color: var(--a-dim);
    display: block;
    margin-bottom: 3px;
}

.numrow input { min-height: 40px; padding: 7px 9px; }

.checkline {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}

.checkline input[type="checkbox"] { width: 20px; height: 20px; }
.checkline label { font-weight: 500; margin: 0; }

.mode-btn[aria-pressed="true"] {
    background: var(--a-brand);
    color: #fff;
    border-color: var(--a-brand);
}

/* --- Telefonda test kutusu --- */

.testbox { text-align: center; }
.testbox img { width: 190px; height: 190px; border: 1px solid var(--a-border); border-radius: 8px; padding: 6px; background: #fff; }

/* ---------------- Küçük ekran ---------------- */

@media (max-width: 900px) {
    .editor { grid-template-columns: 1fr; }
    .editor__stage { order: -1; }   /* küçük ekranda önce sahne görünsün */
}

@media (max-width: 640px) {
    .wrap { padding: 16px 14px 50px; }
    .numrow { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }

    /* Üst çubuk dar ekranda üç satıra ayrılır: marka, kaydırılabilir
       menü, kullanıcı. Tek satırda sıkıştırmak menüyü dağıtıyor ve
       "Çıkış yap" bağlantısını ekranın dışına taşıyordu. */
    .topbar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 14px;
    }

    .topbar__brand { width: 100%; font-size: .95rem; }

    .topbar__nav {
        width: 100%;
        flex: none;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .topbar__nav::-webkit-scrollbar { display: none; }

    .topbar__link {
        flex: none;
        padding: 8px 12px;
        font-size: .9rem;
    }

    .topbar__user {
        width: 100%;
        white-space: normal;   /* taşma yerine alt satıra insin */
        line-height: 1.7;
    }
}

/* =====================================================================
   ÖRNEK HESAP DÜĞMELERİ  (yalnızca tanıtım kurulumunda görünür)
   ===================================================================== */

.demo-box {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px dashed var(--a-border);
}

.demo-box__title {
    margin: 0 0 10px;
    font-size: .85rem;
    font-weight: 700;
    color: var(--a-dim);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.demo-box__hint {
    margin: 10px 0 0;
    font-size: .78rem;
    color: var(--a-dim);
    line-height: 1.5;
}

.demo-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    text-align: start;
    margin-bottom: 8px;
    padding: 11px 14px;
    min-height: 56px;          /* dokunma hedefi */
}

.demo-btn__role { font-weight: 700; font-size: .95rem; }
.demo-btn__note { font-size: .78rem; color: var(--a-dim); line-height: 1.35; }

.demo-btn__cred {
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: .72rem;
    color: var(--a-brand);
    margin-top: 2px;
}

/* =====================================================================
   ADIM DÜZENLEYİCİ

   Adımlar sağ paneldeki dar sütunda durur; her adım kendi kutusunda
   toplanır ki hangi alanın hangi adıma ait olduğu karışmasın.
   ===================================================================== */

.steps__langs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.steps__langs .field__hint {
    flex: 1 1 100%;
    margin: 4px 0 0;
}

.step {
    margin-bottom: 12px;
    padding: 10px 12px 12px;
    border: 1px solid #DCE3EA;
    border-radius: 10px;
    background: #F8FAFC;
}

.step__head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.step__no { flex: 0 0 auto; }

/* Açı özeti esner; uzun olursa düğmeleri itmesin diye kırpılır */
.step__pose {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #64707C;
}

.step__row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.step__value {
    font-variant-numeric: tabular-nums;
    color: #64707C;
}

.step input[type="range"] { width: 100%; }

/* =====================================================================
   SİMGELER — ortak küme (includes/icons.php)

   Panel de görüntüleyiciyle aynı kümeden beslenir: aynı kavram (model,
   video, ses) iki yüzeyde iki farklı şekille çizilmesin.
   ===================================================================== */

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: -4px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon--sm { width: 16px; height: 16px; vertical-align: -3px; }

/* Derleyicideki "hazır" işareti: metinle aynı hizada, yeşil */
.icon--ok { color: #2E7D52; }

/* İçerik listesindeki tür simgesi ve sürükleme tutamağı */
.clist__icon .icon { color: #46535F; }
.clist__grip .icon { color: #9AA6B2; cursor: grab; }
.clist__warn .icon { color: #B4541E; }

/* Eser listesindeki tür rozetleri */
.type-icon .icon { color: #46535F; }

/* Yalnızca simge taşıyan küçük düğme: metin payı gerekmez */
.btn-a--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding-inline: 6px;
}
