/* Admin: site tema yönetim sayfası (ziyaretçi site teması admin paneli) */
.site-theme-admin-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: start;
}

.site-theme-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    flex-wrap: wrap;
    flex-shrink: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light, #e5e7eb);
}

.site-theme-tab {
    padding: 10px 16px;
    border: 2px solid var(--border-light, #e5e7eb);
    border-radius: 10px;
    background: var(--surface, #fff);
    cursor: pointer;
    font-weight: 600;
    font-size: .85rem;
    font-family: inherit;
    color: var(--text-body, #374151);
    transition: .15s;
}

.site-theme-tab.is-active {
    border-color: var(--accent, #f97316);
    background: rgba(249, 115, 22, .08);
    color: var(--text-heading, #111);
}

.site-theme-tab-panel {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.site-theme-tab-panel.is-active {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Sidebar kart — sabit yükseklik + iç scroll */
.admin-card.site-theme-sidebar {
    position: sticky;
    top: 88px;
    height: calc(100vh - 110px);
    max-height: calc(100vh - 110px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 16px;
    margin-bottom: 0;
}

.site-theme-sidebar-head {
    padding: 12px 4px 10px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-light, #e5e7eb);
    margin-bottom: 0;
}

.site-theme-sidebar-head h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    color: var(--text-heading, #111);
}

.site-theme-sidebar-head p {
    margin: 0;
    font-size: .78rem;
    color: var(--text-muted, #64748b);
}

/* Tema listesi — kaydırılabilir alan */
.site-theme-grid-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 12px 4px 8px 0;
    margin-right: -4px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #eef2f7;
}

.site-theme-grid-scroll::-webkit-scrollbar {
    width: 10px;
}

.site-theme-grid-scroll::-webkit-scrollbar-track {
    background: #eef2f7;
    border-radius: 10px;
}

.site-theme-grid-scroll::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 10px;
    border: 2px solid #eef2f7;
}

.site-theme-grid-scroll::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.site-theme-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding-right: 6px;
}

.site-theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 2px solid var(--border-light, #e5e7eb);
    border-radius: 12px;
    background: var(--surface, #fff);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: .82rem;
    color: var(--text-body, #374151);
    transition: .15s;
    width: 100%;
}

.site-theme-option:hover { border-color: var(--accent, #f97316); }

.site-theme-option.is-active {
    border-color: var(--accent, #f97316);
    background: rgba(249, 115, 22, .08);
    box-shadow: 0 0 0 1px var(--accent, #f97316);
}

.site-theme-option.is-custom { border-style: dashed; }
.site-theme-option .admin-theme-swatch { width: 40px; height: 40px; flex-shrink: 0; }
.site-theme-option-desc { display: block; font-size: .72rem; color: var(--text-muted, #64748b); margin-top: 2px; }

.site-theme-preview-wrap {
    background: var(--surface, #fff);
    border-radius: 14px;
    border: 1px solid var(--border-light, #e5e7eb);
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow, rgba(0, 0, 0, .08));
}

.site-theme-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light, #e5e7eb);
    flex-wrap: wrap;
}

.site-theme-preview-toolbar strong { color: var(--text-heading, #111); }

.site-theme-preview-frame {
    width: 100%;
    height: min(720px, calc(100vh - 200px));
    border: none;
    display: block;
    background: var(--gray-100, #f3f4f6);
}

.site-theme-current-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: .78rem;
    font-weight: 700;
}

/* Özel tema sekmesi */
.site-theme-custom-form {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 4px 8px 0;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #eef2f7;
}

.site-theme-custom-form::-webkit-scrollbar { width: 10px; }
.site-theme-custom-form::-webkit-scrollbar-track { background: #eef2f7; border-radius: 10px; }
.site-theme-custom-form::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 10px; }

.site-theme-color-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: none;
    overflow: visible;
    padding-right: 4px;
}

.site-theme-color-group {
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
}

.site-theme-color-group summary {
    padding: 10px 14px;
    font-weight: 700;
    font-size: .85rem;
    cursor: pointer;
    background: var(--gray-50, #f9fafb);
    color: var(--text-heading, #111);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-theme-color-group summary::-webkit-details-marker { display: none; }

.site-theme-color-group summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: .7rem;
    color: var(--text-muted, #64748b);
}

.site-theme-color-group[open] summary::after { transform: rotate(180deg); }

.site-theme-color-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
}

.site-theme-color-field label {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    margin-bottom: 4px;
}

.site-theme-color-field input[type=color] {
    width: 100%;
    height: 36px;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
    background: var(--surface, #fff);
}

.site-theme-color-field input[type=text] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 6px;
    font-size: .78rem;
    font-family: monospace;
    margin-top: 4px;
}

.site-theme-custom-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 0 0;
    border-top: 1px solid var(--border-light, #e5e7eb);
    margin-top: 12px;
}

@media (max-width: 1100px) {
    .site-theme-admin-layout { grid-template-columns: 1fr; }
    .admin-card.site-theme-sidebar {
        position: static;
        height: auto;
        max-height: min(520px, 70vh);
    }
    .site-theme-preview-frame { height: 520px; }
    .site-theme-color-grid { grid-template-columns: 1fr; }
}
