/* ──────────────────────────────────────────────────────────────
   THEME DARK - MONITORING APP - SOPHISTIQUÉ & MODERNE
   ────────────────────────────────────────────────────────────── */

.theme-dark {
    /* ─── VARIABLES CSS ─── */
    --bg-primary: #0a0c12;
    --bg-secondary: #0f1117;
    --bg-tertiary: #1a1d26;
    
    --text-primary: #edf2f7;
    --text-secondary: #a0aec0;
    --text-tertiary: #718096;
    
    --accent-main: #00e5ff;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-error: #ef4444;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.04);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(0, 229, 255, 0.2);
    
    /* ─── VARIABLES POUR LES GRAPHIQUES ─── */
    --chart-grid-color: rgba(255, 255, 255, 0.06);
    --chart-border-width: 2.5;
    --chart-tick-color: #8a94b0;
}

/* ─── ANIMATIONS ─── */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes slideUp {
    from { transform: translateY(8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes rotateBackground {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ─── FONDAMENTALS ─── */
.theme-dark body,
.theme-dark root {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica", "Arial", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1, "liga" 1;
}

.theme-dark * {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── SIDEBAR ─── */
.theme-dark .sidebar {
    background: rgba(15, 17, 23, 0.9);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.4);
}

.theme-dark .sidebar-item {
    color: var(--text-secondary);
    border-radius: 8px;
    margin: 0 8px;
}

.theme-dark .sidebar-item:hover {
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent-main);
    transform: translateX(4px);
}

.theme-dark .sidebar-item.active {
    background: linear-gradient(to right, rgba(20, 25, 35, 0.8), rgba(30, 35, 45, 0.8));
    color: var(--accent-main);
    border-left: 3px solid var(--accent-main);
    padding-left: 13px;
}

/* ─── HEADER ─── */
.theme-dark header {
    background: rgba(10, 12, 18, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.theme-dark .header-title {
    color: var(--text-primary);
}

/* ─── CONTENT AREA ─── */
.theme-dark .content {
    background: linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary));
}

/* ─── CHART WINDOWS ─── */
.theme-dark .chart-window {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0;
    box-shadow: var(--shadow-md);
}

.theme-dark .chart-window:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 229, 255, 0.3);
}

.theme-dark .chart-window.active {
    box-shadow: var(--shadow-md);
    border: 1px solid var(--accent-main);
    transform: none;
}

/* ─── CHART HEADER ─── */
.theme-dark .chart-header {
    background: linear-gradient(to right, rgba(20, 25, 35, 0.6), rgba(30, 35, 45, 0.6));
    border-bottom: 1px solid var(--border-color);
}

.theme-dark .chart-title {
    color: var(--text-primary);
}

/* ─── CHART LEGEND ─── */
.theme-dark .chart-legend {
    background: rgba(15, 17, 23, 0.8);
    backdrop-filter: blur(10px);
    border-left: 1px solid var(--border-color);
}

.theme-dark .legend-item {
    color: var(--text-secondary);
}

.theme-dark .legend-item:hover {
    background: rgba(0, 229, 255, 0.15);
    color: var(--accent-main);
}

/* ─── CHART FOOTER ─── */
.theme-dark .chart-footer {
    background: rgba(10, 12, 18, 0.7);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
}

/* ─── BUTTONS ─── */
.theme-dark .footer-btn,
.theme-dark button {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.theme-dark .footer-btn:hover,
.theme-dark button:hover {
    background: rgba(0, 229, 255, 0.15);
    color: var(--accent-main);
    border-color: rgba(0, 229, 255, 0.3);
}

.theme-dark .footer-btn.active,
.theme-dark button.active {
    background: var(--accent-main);
    color: #0a0c12;
    border-color: var(--accent-main);
}

/* ─── TRACK LINES ─── */
.theme-dark .track-line-single,
.theme-dark .track-line-0 {
    filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.5));
}

.theme-dark .track-line-1 {
    filter: drop-shadow(0 0 4px rgba(255, 51, 51, 0.5));
}

/* ─── DISPLAY BOXES ─── */
.theme-dark .track-display,
.theme-dark .track-delta-display {
    background: rgba(0, 0, 0, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* ─── LOGIN PAGE ─── */
.theme-dark .login-container {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
}

.theme-dark .login-box {
    background: rgba(26, 29, 38, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ─── INPUTS ─── */
.theme-dark input,
.theme-dark select,
.theme-dark textarea {
    background: rgba(26, 29, 38, 0.9);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.theme-dark input:focus,
.theme-dark select:focus,
.theme-dark textarea:focus {
    border-color: var(--accent-main);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.2);
}

/* ─── SCROLLBAR ─── */
.theme-dark ::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.3);
}

.theme-dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.5);
}

/* ─── TABLES (Trend Table) ─── */
.theme-dark .trend-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.theme-dark .trend-table th,
.theme-dark .trend-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

/* .theme-dark .trend-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    position: sticky;
    top: 0;
} */
 .theme-dark .trend-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: none;
}

.theme-dark .trend-row-even {
    background-color: rgba(255, 255, 255, 0.02);
}

.theme-dark .trend-row-odd {
    background-color: rgba(255, 255, 255, 0.06);
}

.theme-dark .trend-row-even:hover,
.theme-dark .trend-row-odd:hover {
    background-color: rgba(0, 229, 255, 0.15);
}

.theme-dark .channel-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 8px;
    vertical-align: middle;
}

.theme-dark .zero {
    color: var(--text-tertiary);
    font-style: italic;
}

/* ─── PANELS & MODALS ─── */
.theme-dark .panel,
.theme-dark .modal-content {
    background: rgba(26, 29, 38, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
}

/* ─── BADGES ─── */
.theme-dark .badge {
    background: rgba(0, 229, 255, 0.15);
    color: var(--accent-main);
}

/* ─── ALERTS ─── */
.theme-dark .alert {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-success);
}

.theme-dark .alert.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-error);
}

.theme-dark .alert.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--accent-warning);
}