/* ==========================================================================
   TEMALANDIRMA (DARK / LIGHT MODE) SİSTEMİ
   Tüm Sayfalarda Anında Koyu / Açık Tema Geçişi
   ========================================================================== */

/* Tema Değiştirme Butonu */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

/* ==========================================================================
   GENEL SİSTEM DARK MODE (Tüm Standart Sayfalar: news_list, dashboard vb.)
   ========================================================================== */
html[data-theme="dark"] {
    --bg: #0d1117;
    --panel: #161b22;
    --ink: #e6edf3;
    --muted: #8b949e;
    --line: #30363d;
    --dark: #8b949e;
    --cardShadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --softShadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] body {
    background-color: var(--bg) !important;
    background-image: none !important;
    color: var(--nr-text, #e6edf3) !important;
}

html[data-theme="dark"] body:before {
    display: none !important;
}

/* Header & Sidebar Dark */
html[data-theme="dark"] .topbar {
    background: #090d13 !important;
    border-bottom: 1px solid #30363d !important;
}

html[data-theme="dark"] .sidebar {
    background: #090d13 !important;
    border-right: 1px solid #30363d !important;
}

html[data-theme="dark"] .sidebar a {
    color: #8b949e !important;
    background: transparent !important;
}

html[data-theme="dark"] .sidebar a:hover {
    background: #1c2128 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .sidebar details summary {
    color: #c9d1d9 !important;
}

/* Kartlar & Paneller Dark */
html[data-theme="dark"] .announcement-board {
    background: linear-gradient(135deg, #161b22, #1c2128) !important;
    border-color: rgba(56, 139, 253, 0.4) !important;
}

html[data-theme="dark"] .activity-item {
    background: #0d1117 !important;
    border-color: #30363d !important;
}

html[data-theme="dark"] .activity-item strong {
    color: #58a6ff !important;
}

html[data-theme="dark"] .activity-item span {
    color: #c9d1d9 !important;
}

html[data-theme="dark"] .activity-item small {
    color: #8b949e !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .page-head,
html[data-theme="dark"] .share-box,
html[data-theme="dark"] .login-card {
    background: #161b22 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}

html[data-theme="dark"] .page-head h1,
html[data-theme="dark"] .card h2,
html[data-theme="dark"] .card h3 {
    color: #ffffff !important;
}

/* Form Elemanları Dark */
html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .copy-field input,
html[data-theme="dark"] .copy-field textarea {
    background: #0d1117 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}

html[data-theme="dark"] .field input:focus,
html[data-theme="dark"] .field select:focus,
html[data-theme="dark"] .field textarea:focus {
    border-color: #388bfd !important;
    box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.25) !important;
}

html[data-theme="dark"] .field label {
    color: #c9d1d9 !important;
}

/* Standart Tablolar Dark */
html[data-theme="dark"] .table {
    border-color: #30363d !important;
    background: #161b22 !important;
}

html[data-theme="dark"] .table th {
    background: #0e1217 !important;
    color: #8b949e !important;
    border-bottom: 1px solid #30363d !important;
}

html[data-theme="dark"] .table td {
    background: #161b22 !important;
    color: #e6edf3 !important;
    border-bottom: 1px solid #21262d !important;
}

html[data-theme="dark"] .table tbody tr:hover td {
    background: #1c2128 !important;
}

html[data-theme="dark"] .btn.secondary {
    background: #1c2128 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}

html[data-theme="dark"] .btn.secondary:hover {
    background: #262c36 !important;
}

html[data-theme="dark"] .hint {
    background: #0d1117 !important;
    border-color: #30363d !important;
    color: #8b949e !important;
}

/* ==========================================================================
   NEWSROOM PANELİ İÇİN LIGHT MODE (Açık Tema Seçildiğinde)
   ========================================================================== */
html[data-theme="light"] .newsroom-container .nr-header-bar,
html[data-theme="light"] .newsroom-container .nr-action-bar,
html[data-theme="light"] .newsroom-container .nr-filter-bar,
html[data-theme="light"] .newsroom-container .nr-table-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="light"] .newsroom-container .nr-brand-title {
    color: #0f172a !important;
}

html[data-theme="light"] .newsroom-container .nr-brand-sub {
    color: #64748b !important;
}

html[data-theme="light"] .newsroom-container .nr-clock-box {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #0284c7 !important;
}

html[data-theme="light"] .newsroom-container .nr-nav-tabs {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .newsroom-container .nr-tab-btn {
    color: #475569 !important;
}

html[data-theme="light"] .newsroom-container .nr-tab-btn:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .newsroom-container .nr-tab-btn.active {
    background: #2563eb !important;
    color: #ffffff !important;
}

html[data-theme="light"] .newsroom-container .nr-select,
html[data-theme="light"] .newsroom-container .nr-input,
html[data-theme="light"] .newsroom-container .nr-date,
html[data-theme="light"] .newsroom-container .nr-search-input {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .newsroom-container .nr-bulletin-picker {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .newsroom-container .nr-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .newsroom-container .nr-table td {
    color: #1e293b !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

html[data-theme="light"] .newsroom-container .nr-table tbody tr:hover {
    background: #f8fafc !important;
}

html[data-theme="light"] .newsroom-container .nr-item-title {
    color: #0f172a !important;
}

html[data-theme="light"] .newsroom-container .nr-item-title:hover {
    color: #2563eb !important;
}

html[data-theme="light"] .newsroom-container .nr-order-badge {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

html[data-theme="light"] .newsroom-container .nr-btn-secondary {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

html[data-theme="light"] .newsroom-container .nr-btn-secondary:hover {
    background: #e2e8f0 !important;
}

/* ==========================================================================
   DUAL PANEL & HABER HAVUZU / AKIŞ LIGHT THEME DESTEĞİ
   ========================================================================== */
html[data-theme="light"] .nr-dual-panel {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="light"] .nr-panel-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .nr-panel-title {
    color: #0f172a !important;
}

html[data-theme="light"] .nr-panel-toolbar {
    background: #f1f5f9 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .nr-panel-filters {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .nr-compact-table {
    color: #1e293b !important;
}

html[data-theme="light"] .nr-compact-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] .nr-compact-table td {
    color: #1e293b !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

html[data-theme="light"] .nr-compact-table tbody tr:nth-child(even) {
    background: #f8fafc !important;
}

html[data-theme="light"] .nr-compact-table tbody tr:hover {
    background: #e2e8f0 !important;
}

html[data-theme="light"] .nr-compact-table .news-cell-title {
    color: #0f172a !important;
}

html[data-theme="light"] .nr-compact-table .news-cell-title:hover {
    color: #2563eb !important;
}

html[data-theme="light"] .nr-studio-status-bar {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}

html[data-theme="light"] .nr-badge-draft {
    background: #e2e8f0 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .nr-btn-secondary {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

html[data-theme="light"] .nr-btn-secondary:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

html[data-theme="light"] .nr-btn-purple {
    background: #f3e8ff !important;
    border: 1px solid #c084fc !important;
    color: #7e22ce !important;
}

html[data-theme="light"] .nr-btn-danger {
    background: #fee2e2 !important;
    border: 1px solid #f87171 !important;
    color: #dc2626 !important;
}

html[data-theme="light"] .nr-btn-cyan {
    background: #ecfeff !important;
    border: 1px solid #22d3ee !important;
    color: #0e7490 !important;
}

/* Canlı Reji Odası (live_reji.php) Light Theme */
html[data-theme="light"] .reji-monitor-card,
html[data-theme="light"] .reji-rundown-card,
html[data-theme="light"] .reji-archive-card,
html[data-theme="light"] .reji-control-box,
html[data-theme="light"] .reji-script-box,
html[data-theme="light"] .reji-cockpit-topbar,
html[data-theme="light"] .reji-col-prompter,
html[data-theme="light"] .reji-col-queue,
html[data-theme="light"] .reji-col-archive,
html[data-theme="light"] .tv-controls-bar,
html[data-theme="light"] .tv-kj-editor-box {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06) !important;
}

html[data-theme="light"] .reji-card-header,
html[data-theme="light"] .reji-queue-header,
html[data-theme="light"] .prompter-header,
html[data-theme="light"] .prompter-footer {
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] .reji-queue-card {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] .reji-queue-card:hover {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
}

html[data-theme="light"] .reji-queue-card.is-on-air {
    background: #fff1f2 !important;
    border-color: #f43f5e !important;
}

html[data-theme="light"] .reji-clock-banner {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .reji-input,
html[data-theme="light"] .reji-select,
html[data-theme="light"] .reji-textarea {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* ==========================================================================
   DARALABİLİR / GENİŞLEYEBİLİR SİMGE MENÜ (COLLAPSIBLE MINI-SIDEBAR)
   Ekranı genişletmek için simge durumuna küçülme ve tıklandığında açılır flyout menü
   ========================================================================== */

/* Üst Bar Masaüstü Menü Açma/Kapatma Butonu */
.desktop-sidebar-toggle-btn {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4.5px;
    width: 36px;
    height: 36px;
    padding: 7px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 4px;
}

.desktop-sidebar-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    transform: scale(1.04);
}

.desktop-sidebar-toggle-btn .bar {
    display: block;
    width: 18px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.2s ease;
}

html[data-theme="light"] .desktop-sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

@media (max-width: 980px) {
    .desktop-sidebar-toggle-btn {
        display: none !important;
    }
}

/* Yan Menü (Sidebar) Temel Geçiş Animasyonları */
@media (min-width: 981px) {
    .sidebar.nav-creative {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        padding: 16px 10px 14px 10px !important;
        width: 240px;
        transition: width 0.24s cubic-bezier(0.16, 1, 0.3, 1), padding 0.24s ease !important;
        box-sizing: border-box !important;
        z-index: 99 !important;
    }

    .sidebar-nav-scroll {
        flex: 1 1 auto;
        overflow-y: auto;
        overflow-x: visible;
        padding-right: 2px;
    }

    /* Scrollbar inceltme */
    .sidebar-nav-scroll::-webkit-scrollbar {
        width: 4px;
    }
    .sidebar-nav-scroll::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.15);
        border-radius: 4px;
    }

    .content,
    .footer {
        transition: margin-left 0.24s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    /* ----------------------------------------------------
       DARALMIŞ MOD (HTML.SIDEBAR-COLLAPSED)
       Ekran Genişler, Menü Sadece Simgelere Küçülür (68px)
       ---------------------------------------------------- */
    html.sidebar-collapsed .sidebar.nav-creative,
    body.sidebar-collapsed .sidebar.nav-creative {
        width: 68px !important;
        padding: 16px 8px 12px 8px !important;
        overflow: visible !important;
    }

    html.sidebar-collapsed .sidebar.nav-creative .sidebar-nav-scroll,
    body.sidebar-collapsed .sidebar.nav-creative .sidebar-nav-scroll {
        overflow: visible !important;
    }

    html.sidebar-collapsed .content,
    body.sidebar-collapsed .content {
        margin-left: 68px !important;
    }

    html.sidebar-collapsed .footer,
    body.sidebar-collapsed .footer {
        margin-left: 68px !important;
    }

    /* Daralmış modda tekil linkler (Dashboard, Medya vb.) */
    html.sidebar-collapsed .sidebar.nav-creative .nav-home,
    body.sidebar-collapsed .sidebar.nav-creative .nav-home {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 10px 0 !important;
        margin-bottom: 7px !important;
        width: 100% !important;
        position: relative !important;
    }

    html.sidebar-collapsed .sidebar.nav-creative .nav-home .nav-text,
    body.sidebar-collapsed .sidebar.nav-creative .nav-home .nav-text {
        display: none !important;
    }

    html.sidebar-collapsed .sidebar.nav-creative .nav-dot,
    body.sidebar-collapsed .sidebar.nav-creative .nav-dot,
    html.sidebar-collapsed .sidebar.nav-creative .nav-icon,
    body.sidebar-collapsed .sidebar.nav-creative .nav-icon {
        margin: 0 !important;
        width: 34px !important;
        height: 34px !important;
        font-size: 16px !important;
    }

    /* Daralmış modda Açılır Grup Başlıkları (<summary>) */
    html.sidebar-collapsed .sidebar.nav-creative .nav-group,
    body.sidebar-collapsed .sidebar.nav-creative .nav-group {
        position: relative !important;
        margin-bottom: 7px !important;
    }

    html.sidebar-collapsed .sidebar.nav-creative .nav-group summary,
    body.sidebar-collapsed .sidebar.nav-creative .nav-group summary {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 9px 0 !important;
        width: 100% !important;
        position: relative !important;
    }

    html.sidebar-collapsed .sidebar.nav-creative .nav-group summary .nav-text,
    body.sidebar-collapsed .sidebar.nav-creative .nav-group summary .nav-text,
    html.sidebar-collapsed .sidebar.nav-creative .nav-group summary .chev,
    body.sidebar-collapsed .sidebar.nav-creative .nav-group summary .chev {
        display: none !important;
    }

    /* FLYOUT / POP-UP ALT MENÜ (Simgelerin Yanında Açılan Liste) */
    html.sidebar-collapsed .sidebar.nav-creative .nav-group .nav-sub,
    body.sidebar-collapsed .sidebar.nav-creative .nav-group .nav-sub {
        position: absolute !important;
        left: 64px !important;
        top: -6px !important;
        width: 230px !important;
        min-width: 210px !important;
        background: #0d1e33 !important;
        border: 1px solid rgba(255, 255, 255, 0.16) !important;
        border-radius: 12px !important;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
        z-index: 99999 !important;
        margin: 0 !important;
        padding: 8px !important;
    }

    /* Hover ile de anında açılabilmesi için */
    html.sidebar-collapsed .sidebar.nav-creative .nav-group:hover > .nav-sub,
    body.sidebar-collapsed .sidebar.nav-creative .nav-group:hover > .nav-sub {
        display: block !important;
    }

    html.sidebar-collapsed .sidebar.nav-creative .nav-group .nav-sub a,
    body.sidebar-collapsed .sidebar.nav-creative .nav-group .nav-sub a {
        display: block !important;
        padding: 9px 12px !important;
        color: #d1e0f0 !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        border-radius: 8px !important;
        text-align: left !important;
        background: transparent !important;
        transition: all 0.15s ease !important;
    }

    html.sidebar-collapsed .sidebar.nav-creative .nav-group .nav-sub a:hover,
    body.sidebar-collapsed .sidebar.nav-creative .nav-group .nav-sub a:hover {
        background: rgba(37, 99, 235, 0.25) !important;
        color: #60a5fa !important;
        transform: translateX(3px);
    }

    /* Açık Tema Flyout Ayarları */
    html[data-theme="light"].sidebar-collapsed .sidebar.nav-creative .nav-group .nav-sub,
    html[data-theme="light"] body.sidebar-collapsed .sidebar.nav-creative .nav-group .nav-sub {
        background: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
        box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16), 0 0 0 1px #e2e8f0 !important;
    }

    html[data-theme="light"].sidebar-collapsed .sidebar.nav-creative .nav-group .nav-sub a,
    html[data-theme="light"] body.sidebar-collapsed .sidebar.nav-creative .nav-group .nav-sub a {
        color: #1e293b !important;
    }

    html[data-theme="light"].sidebar-collapsed .sidebar.nav-creative .nav-group .nav-sub a:hover,
    html[data-theme="light"] body.sidebar-collapsed .sidebar.nav-creative .nav-group .nav-sub a:hover {
        background: #eff6ff !important;
        color: #2563eb !important;
    }

    /* Alt Kısımdaki Daraltma/Genişletme Buton Çubuğu */
    .sidebar-collapse-bar {
        margin-top: auto;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    html[data-theme="light"] .sidebar-collapse-bar {
        border-top: 1px solid #e2e8f0;
    }

    .sidebar-collapse-btn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 9px 10px;
        border-radius: 9px;
        border: 1px solid rgba(255, 255, 255, 0.14);
        background: rgba(255, 255, 255, 0.05);
        color: #c6d6e8;
        cursor: pointer;
        font-size: 12px;
        font-weight: 700;
        transition: all 0.18s ease;
    }

    .sidebar-collapse-btn:hover {
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff;
        border-color: rgba(255, 255, 255, 0.25);
    }

    html[data-theme="light"] .sidebar-collapse-btn {
        border-color: #cbd5e1;
        background: #f8fafc;
        color: #475569;
    }

    html[data-theme="light"] .sidebar-collapse-btn:hover {
        background: #e2e8f0;
        color: #0f172a;
    }

    html.sidebar-collapsed .sidebar-collapse-btn .collapse-text,
    body.sidebar-collapsed .sidebar-collapse-btn .collapse-text {
        display: none !important;
    }

    html.sidebar-collapsed .sidebar-collapse-btn,
    body.sidebar-collapsed .sidebar-collapse-btn {
        padding: 8px 0 !important;
    }
}

/* ==========================================================================
   GENEL RESPONSIVE İYİLEŞTİRMELERİ (MOBİL, TABLET & LAPTOP)
   ========================================================================== */

/* Cockpit Sayfalarında (Live Reji & Playout) Topbar İçindeki Ek Butonları Gizle (Kendi iç barında mevcuttur) */
body.playout-cockpit-page .topbar a[href*="playout.php"],
body.playout-cockpit-page .topbar a[href*="live_reji.php"],
body.playout-cockpit-page .topbar a[href*="newsroom.php"],
body.reji-cockpit-page .topbar a[href*="playout.php"],
body.reji-cockpit-page .topbar a[href*="live_reji.php"],
body.reji-cockpit-page .topbar a[href*="newsroom.php"] {
    display: none !important;
}

/* Tablet & Küçük Ekranlarda (<= 1024px) Üst Bar Temizliği */
@media (max-width: 1024px) {
    .topbar .userbox {
        gap: 6px !important;
    }
    .topbar .userbox a[href*="playout.php"],
    .topbar .userbox a[href*="live_reji.php"],
    .topbar .userbox a[href*="newsroom.php"] {
        display: none !important; /* Bu 3 ana link açılır sol menünün (hamburger) en başında mevcuttur */
    }
    .topbar .userbox strong,
    .topbar .userbox > span {
        max-width: 130px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Mobil Telefonlarda (< 768px) Üst Bar Temizliği */
@media (max-width: 768px) {
    .topbar {
        padding: 0 10px !important;
    }
    .topbar .brand {
        font-size: 14px !important;
    }
    .topbar .brand span:last-child {
        max-width: 130px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .topbar .subtitle {
        display: none !important;
    }
    .topbar .userbox strong,
    .topbar .userbox > span {
        display: none !important;
    }
    .topbar .theme-toggle-btn {
        padding: 5px 8px !important;
        font-size: 11px !important;
    }
}


