/* ========================================
   TV RÉTRO - THÈME GRIS/NOIR CLAIR
   Fond gris foncé avec effets CRT améliorés et graphiques voyants
   ======================================== */

:root {
    --tv-bg: #1a1a1a;
    --tv-bg-dark: #2a2a2a;
    --tv-bg-light: #3a3a3a;
    --tv-frame: #121212;
    --tv-screen-bg: #202020;
    --tv-text: #f0f0f0;
    --tv-text-dim: #aaaaaa;
    --tv-accent: #00a8ff;
    --tv-accent-glow: #00c8ff;
    --tv-green: #00ff88;
    --tv-red: #ff4444;
    --tv-amber: #ffaa00;
    --scanline-spacing: 3px;
}

@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: var(--tv-bg);
    overflow-x: hidden;
    min-height: 100vh;
    color: var(--tv-text);
}

/* ========================================
   CONTAINER TV
   ======================================== */
.tv-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: var(--tv-bg);
}

.tv-frame {
    position: relative;
    margin: 20px auto;
    max-width: calc(100vw - 40px);
    min-height: calc(100vh - 40px);
    background: var(--tv-frame);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 
        inset 0 0 30px rgba(0, 0, 0, 0.6),
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tv-screen {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 70px);
    background: var(--tv-screen-bg);
    border-radius: 12px;
    overflow: visible;
    box-shadow: 
        inset 0 0 80px rgba(0, 0, 0, 0.6),
        inset 0 0 40px rgba(0, 100, 255, 0.15),
        0 0 30px rgba(0, 200, 255, 0.15);
}

/* ========================================
   EFFETS CRT ADAPTÉS AU FOND PLUS CLAIR
   ======================================== */
.tv-scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent calc(var(--scanline-spacing) - 1px),
        rgba(255, 255, 255, 0.08) calc(var(--scanline-spacing) - 1px),
        rgba(255, 255, 255, 0.08) var(--scanline-spacing)
    );
    background-size: 100% calc(var(--scanline-spacing) * 2);
}

.tv-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 11;
    background: radial-gradient(
        ellipse at center,
        transparent 40%,
        rgba(0, 0, 0, 0.3) 70%,
        rgba(0, 0, 0, 0.6) 100%
    );
    opacity: 0.6;
}

.tv-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    mix-blend-mode: screen;
}

.tv-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(
        ellipse at center,
        rgba(0, 200, 255, 0.12) 0%,
        rgba(0, 150, 255, 0.08) 30%,
        transparent 80%
    );
    filter: blur(40px);
}

.tv-curvature {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 15;
    border-radius: 12px;
    box-shadow: 
        inset 0 0 60px rgba(0, 0, 0, 0.5),
        inset 20px 20px 60px rgba(0, 0, 0, 0.4),
        inset -20px -20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tv-scanline-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    pointer-events: none;
    z-index: 20;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%
    );
    animation: scanlineBar 4s linear infinite;
    opacity: 0.7;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.25);
}

@keyframes scanlineBar {
    0% { top: -5%; opacity: 0; }
    10% { opacity: 0.7; }
    90% { opacity: 0.7; }
    100% { top: 105%; opacity: 0; }
}

/* ========================================
   HEADER TV - ADAPTÉ AU FOND PLUS CLAIR
   ======================================== */
.tv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    padding: 60px 0 20px 0;
    flex-wrap: wrap;
    position: relative; /* Nécessaire pour le positionnement absolu des enfants */
    z-index: 60;
}

/* On s'assure que le titre lui-même a un peu d'espace */
.tv-title h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--tv-text);
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.4; /* Améliore la lisibilité si le titre est long */
}

.tv-title h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--tv-text);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.tv-title h1::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 28px;
    background: linear-gradient(180deg, var(--tv-accent), var(--tv-accent-glow));
    border-radius: 2px;
    box-shadow: 0 0 12px var(--tv-accent-glow);
}

.tv-title .year-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.25), rgba(0, 200, 255, 0.3));
    border: 2px solid rgba(0, 168, 255, 0.5);
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    backdrop-filter: blur(10px);
}

.tv-title .year-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.tv-title .year-display:hover::before {
    left: 100%;
}

.tv-title .year-display:hover {
    border-color: var(--tv-accent);
    box-shadow: 
        0 0 20px rgba(0, 168, 255, 0.4),
        inset 0 0 20px rgba(0, 168, 255, 0.15);
    transform: translateY(-3px);
}

.tv-title .year {
    color: var(--tv-accent);
    font-weight: 700;
    font-size: 24px;
    transition: all 0.3s ease;
    text-shadow: 0 0 8px rgba(0, 168, 255, 0.4);
}

.tv-title .year-arrow {
    color: var(--tv-accent);
    transition: transform 0.3s ease;
}

.tv-title .year-display:hover .year-arrow {
    transform: rotate(180deg);
}

.tv-title .year-display.open .year-arrow {
    transform: rotate(180deg);
}

/* ========================================
   DROPDOWN SÉLECTEUR D'ANNÉE
   ======================================== */
.year-dropdown-container {
    position: static;
    z-index: 1;
}

.year-dropdown {
    position: fixed;
    background: rgba(40, 40, 50, 0.98);
    border: 2px solid rgba(0, 168, 255, 0.6);
    border-radius: 12px;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.6),
        0 0 50px rgba(0, 168, 255, 0.25);
    min-width: 150px;
    max-width: 200px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.year-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.year-dropdown-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.25), rgba(0, 200, 255, 0.3));
    border-bottom: 1px solid rgba(0, 168, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--tv-text-dim);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.year-dropdown-header svg {
    color: var(--tv-accent);
}

.year-dropdown-options {
    max-height: 250px;
    overflow-y: auto;
    padding: 8px;
}

.year-dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.year-dropdown-options::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.year-dropdown-options::-webkit-scrollbar-thumb {
    background: var(--tv-accent);
    border-radius: 3px;
    box-shadow: 0 0 8px var(--tv-accent);
}

.year-option {
    padding: 14px 18px;
    margin: 3px 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 18px;
    color: var(--tv-text);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.year-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 5px;
    background: var(--tv-accent);
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 0 8px var(--tv-accent);
}

.year-option:hover {
    background: rgba(0, 168, 255, 0.25);
    transform: translateX(8px);
    box-shadow: 0 2px 12px rgba(0, 168, 255, 0.25);
}

.year-option:hover::before {
    opacity: 1;
}

.year-option.active {
    background: linear-gradient(135deg, rgba(0, 168, 255, 0.35), rgba(0, 200, 255, 0.4));
    color: var(--tv-accent);
    box-shadow: 
        inset 0 0 25px rgba(0, 168, 255, 0.15),
        0 2px 15px rgba(0, 168, 255, 0.3);
    font-weight: 800;
    text-shadow: 0 0 8px rgba(0, 168, 255, 0.4);
}

.year-option.active::before {
    opacity: 1;
}

.year-option.active::after {
    content: '✓';
    position: absolute;
    right: 18px;
    color: var(--tv-accent);
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 0 8px var(--tv-accent);
}

.year-option:active {
    transform: scale(0.97);
}

.tv-stats {
    display: flex;
    gap: 8px;
}

.tv-stat {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    color: var(--tv-text-dim);
    cursor: help;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.tv-stat:hover {
    background: var(--tv-accent);
    color: white;
    border-color: var(--tv-accent);
    box-shadow: 0 0 12px var(--tv-accent);
    transform: translateY(-2px);
}

/* ========================================
   INDICATEURS TV - ADAPTÉS AU FOND PLUS CLAIR
   ======================================== */
.tv-channel {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: var(--tv-text);
    background: rgba(30, 30, 30, 0.7);
    padding: 8px 20px;
    border-radius: 8px;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    text-shadow: 0 0 8px var(--tv-accent);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.tv-clock {
    position: absolute;
    top: 15px;
    right: 15px;
    font-family: 'VT323', monospace;
    font-size: 20px;
    color: var(--tv-text);
    background: rgba(30, 30, 30, 0.7);
    padding: 8px 15px;
    border-radius: 8px;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    text-shadow: 0 0 8px var(--tv-accent);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.tv-crt-indicator {
    position: absolute;
    top: 15px;
    right: 90px;
    font-family: 'VT323', monospace;
    font-size: 12px;
    color: var(--tv-text-dim);
    background: rgba(30, 30, 30, 0.7);
    padding: 6px 12px;
    border-radius: 8px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.tv-crt-indicator .led {
    width: 8px;
    height: 8px;
    background: var(--tv-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--tv-green);
    animation: ledPulse 1.5s ease-in-out infinite;
}

@keyframes ledPulse {
    0%, 100% { opacity: 0.7; box-shadow: 0 0 4px var(--tv-green); }
    50% { opacity: 1; box-shadow: 0 0 12px var(--tv-green); }
}

.tv-signal {
    position: absolute;
    bottom: 15px;
    left: 15px;
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: var(--tv-text-dim);
    background: rgba(30, 30, 30, 0.7);
    padding: 8px 15px;
    border-radius: 8px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.tv-signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 15px;
}

.tv-signal-bars span {
    width: 4px;
    background: var(--tv-green);
    border-radius: 2px;
    animation: signalPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 4px var(--tv-green);
}

.tv-signal-bars span:nth-child(1) { height: 5px; animation-delay: 0s; }
.tv-signal-bars span:nth-child(2) { height: 9px; animation-delay: 0.2s; }
.tv-signal-bars span:nth-child(3) { height: 13px; animation-delay: 0.4s; }
.tv-signal-bars span:nth-child(4) { height: 15px; animation-delay: 0.6s; }

@keyframes signalPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ========================================
   GRAPHIQUE - ADAPTÉ AU FOND PLUS CLAIR
   ======================================== */
.tv-chart-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 0;
    min-height: 300px;
}

.tv-nav-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--tv-text-dim);
    background: rgba(40, 40, 40, 0.7);
    color: var(--tv-text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.tv-nav-btn:hover {
    background: var(--tv-accent);
    border-color: var(--tv-accent);
    color: white;
    transform: scale(1.2);
    box-shadow: 0 0 15px var(--tv-accent);
}

.tv-nav-btn svg {
    width: 24px;
    height: 24px;
}

.tv-chart-container {
    flex: 1;
    height: 100%;
    position: relative;
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        inset 0 0 40px rgba(0, 0, 0, 0.5),
        0 8px 25px rgba(0, 0, 0, 0.4);
}

#mainChart {
    width: 100% !important;
    height: 100% !important;
}

/* ========================================
   LÉGENDE - ADAPTÉE AU FOND PLUS CLAIR
   ======================================== */
.tv-legend {
    position: absolute;
    bottom: 70px;
    left: 55%; /* Augmentez cette valeur pour décaler vers la droite */
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 50;
}

.tv-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 25px;
    font-size: 13px;
    color: var(--tv-text);
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.tv-legend-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.25);
}

.tv-legend-dot {
    width: 15px;
    height: 15px;
    border-radius: 3px;
    box-shadow: 0 0 8px currentColor;
}

.tv-legend-dot.male { 
    background: #00a8ff;
    box-shadow: 0 0 12px #00a8ff;
}

.tv-legend-dot.female { 
    background: #ff6b9d;
    box-shadow: 0 0 12px #ff6b9d;
}

/* ========================================
   ZONE PRINCIPALE - GRAPHIQUE
   ======================================== */
.tv-chart-area {
    position: absolute;
    top: 115px;
    left: 40px;
    right: 40px;
    height: 40%;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ========================================
   BARRE DE MÉTRIQUES - ADAPTÉE AU FOND PLUS CLAIR
   ======================================== */
.tv-metrics {
    display: flex;          /* Utilisation de flexbox pour aligner en ligne */
    justify-content: center; /* Centre les éléments horizontalement */
    gap: 20px;              /* Espace entre chaque carte d'indicateur */
    padding: 20px 0;
    margin-top: 20px;
    
    /* Décalage vers la droite */
    padding-left: 50px;     /* Ajustez cette valeur (ex: 50px à 100px) pour décaler plus ou moins */
    width: 100%;            /* S'assure que le container prend toute la largeur */
}

.tv-metric {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: 10px;
    padding: 15px;
    min-width: 180px;       /* Largeur minimale pour chaque bloc */
    text-align: center;     /* Centre le texte à l'intérieur du bloc */
    transition: all var(--transition-speed);
}

.tv-metric:hover {
    background: rgba(50, 50, 50, 0.9);
    border-color: var(--tv-accent);
    transform: translateY(-5px);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(0, 168, 255, 0.25);
}

.tv-metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--tv-text);
    margin-bottom: 5px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.tv-metric-label {
    font-size: 14px;
    color: var(--tv-text-dim);
}

.tv-metric-trend {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 5px;
    margin-bottom: 8px;
    display: inline-block;
    font-weight: bold;
}

.tv-metric-trend.up {
    background: rgba(0, 255, 136, 0.25);
    color: var(--tv-green);
    text-shadow: 0 0 8px var(--tv-green);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.2);
}

.tv-metric-trend.down {
    background: rgba(255, 68, 68, 0.25);
    color: var(--tv-red);
    text-shadow: 0 0 8px var(--tv-red);
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.2);
}

/* ========================================
   BARRE DE DÉFILEMENT TV (SCROLL BAR)
   ======================================== */
.tv-scrollbar {
    position: fixed;
    right: 10px;
    width: 10px;
    height: 60%;
    top: 20%;
    z-index: 1000;
}

.tv-scrollbar-track {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 5px;
}

.tv-scrollbar-thumb {
    width: 100%;
    height: 80px;
    background: linear-gradient(180deg, var(--tv-accent), var(--tv-accent-glow));
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    box-shadow: 0 0 12px var(--tv-accent-glow);
}

.tv-scrollbar-thumb::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
}

/* ========================================
   GRAPHISMES D'INTERACTION TV
   ======================================== */

/* Barre de progression TV */
.tv-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--tv-accent), var(--tv-green));
    z-index: 1001;
    transition: width 0.1s;
    box-shadow: 0 0 12px var(--tv-accent);
}

/* Compteur de données */
.tv-data-counter {
    position: fixed;
    bottom: 80px;
    right: 120px; /* Diminuez cette valeur pour décaler vers la gauche */
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: var(--tv-text-dim);
    z-index: 100;
    background: rgba(40, 40, 40, 0.8);
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.tv-data-counter span {
    color: var(--tv-accent);
    font-size: 22px;
    text-shadow: 0 0 8px var(--tv-accent);
}

/* Indicateur de mode */
.tv-mode-indicator {
    order: 3;
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.tv-mode-btn {
    padding: 6px 12px;
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: var(--tv-text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}


.tv-mode-btn:hover,
.tv-mode-btn.active {
    background: var(--tv-accent);
    color: white;
    border-color: var(--tv-accent);
}

.tv-mode-btn svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   ANIMATIONS GLITCH ADAPTÉES
   ======================================== */
.tv-glitch {
    animation: glitch 0.4s ease-out;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    10% { transform: translate(-3px, 3px); filter: hue-rotate(90deg); }
    30% { transform: translate(3px, -3px); filter: hue-rotate(180deg); }
    50% { transform: translate(-3px, -3px); filter: hue-rotate(270deg); }
    70% { transform: translate(3px, 3px); filter: hue-rotate(360deg); }
}

/* ========================================
   EFFET DE MISE AU POINT
   ======================================== */
.tv-focus-effect {
    animation: focusPulse 2.5s ease-in-out infinite;
}

@keyframes focusPulse {
    0%, 100% { filter: blur(0.5px) brightness(1); }
    50% { filter: blur(1px) brightness(1.15); }
}

/* ========================================
   BOUTON TOGGLE CRT
   ======================================== */
.tv-toggle-crt {
    position: static; /* Change de absolute à static */
    margin-right: 15px; /* Espacement avec l'indicateur CRT */
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--tv-accent);
    border-radius: 4px;
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: var(--tv-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    order: 1; /* Premier élément dans le flexbox */
}

/* On descend légèrement le bloc Heure/Statut pour laisser la place au bouton */

.tv-top-status {
    position: absolute;
    top: 15px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 30px; /* Ajustez selon l'espacement désiré */
    z-index: 100;
    font-family: 'VT323', monospace;
    background: transparent; /* Supprime le fond gris */
    padding: 0; /* Supprime le padding */
    border-radius: 0; /* Supprime les bords arrondis */
    border: none !important; /* Supprime la bordure bleue */
    justify-content: space-between; /* Répartit les éléments */
}



/* Le titre doit aussi descendre un peu plus pour éviter la collision */
.tv-header {
    padding: 80px 0 20px 0; /* Augmentez la valeur si nécessaire */
}
/* ========================================
   BARRE DE DÉFILEMENT INTERACTIVE TV
   ======================================== */
.tv-scroll-graphic {
    position: fixed;
    right: 25px;
    width: 45px;
    height: 220px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tv-scroll-track {
    width: 8px;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    position: relative;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.4);
}

.tv-scroll-position {
    position: absolute;
    width: 100%;
    background: linear-gradient(180deg, var(--tv-accent), var(--tv-accent-glow));
    border-radius: 4px;
    transition: height 0.1s, top 0.1s;
    box-shadow: 0 0 12px var(--tv-accent);
}

.tv-scroll-counter {
    font-family: 'VT323', monospace;
    font-size: 13px;
    color: var(--tv-text-dim);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 3px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.tv-scroll-icon {
    width: 25px;
    height: 25px;
    animation: scrollBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}

.tv-scroll-icon.up {
    animation: scrollBounceUp 2s ease-in-out infinite;
}

.tv-scroll-icon.down {
    animation: scrollBounceDown 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(8px); opacity: 1; }
}

@keyframes scrollBounceUp {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(-5px); opacity: 1; }
}

@keyframes scrollBounceDown {
    0%, 100% { transform: translateY(0); opacity: 0.7; }
    50% { transform: translateY(5px); opacity: 1; }
}

/* ========================================
   NUAGE DE POINTS INTERACTIF
   ======================================== */
.tv-data-cloud {
    position: fixed;
    bottom: 150px;
    right: 30px;
    width: 140px;
    height: 100px;
    z-index: 50;
    opacity: 0.8;
}

.tv-data-cloud svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 8px rgba(0, 168, 255, 0.4));
}

/* ========================================
   MASQUER LES ÉLÉMENTS CRT (FONCTIONNALITÉ TOGGLE)
   ======================================== */
.crt-disabled .tv-scanlines,
.crt-disabled .tv-vignette,
.crt-disabled .tv-glow,
.crt-disabled .tv-curvature,
.crt-disabled .tv-scanline-bar {
    display: none !important;
}

.crt-disabled .tv-screen {
    box-shadow: none;
    background: var(--tv-bg-light);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .tv-metrics {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .tv-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .tv-chart-area {
        left: 20px;
        right: 20px;
    }
}

@media (max-width: 768px) {
    .tv-frame {
        margin: 10px;
        max-width: calc(100vw - 20px);
        min-height: calc(100vh - 20px);
        padding: 10px;
    }
    
    .tv-header {
        padding: 15px 0;
    }
    
    .tv-title h1 {
        font-size: 18px;
    }
    
    .tv-stats {
        flex-wrap: wrap;
    }
    
    .tv-chart-area {
        flex-direction: column;
        top: 150px;
        bottom: 120px;
        left: 20px;
        right: 20px;
    }
    
    .tv-nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .tv-metrics {
        grid-template-columns: repeat(2, 1fr);
        padding: 10px 20px;
        margin-top: 450px;
    }
    
   .tv-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 15px 0;
    pointer-events: all; /* Important pour rendre les clics possibles */
}

.tv-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.tv-legend-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.tv-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.tv-legend-dot.male { background-color: #4a9eff; box-shadow: 0 0 8px #4a9eff; }
.tv-legend-dot.female { background-color: #ff6b8b; box-shadow: 0 0 8px #ff6b8b; }
    
    .tv-channel, .tv-clock, .tv-crt-indicator {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .tv-mode-indicator {
        position: static; /* Retour au flux normal sur mobile */
        margin-top: 15px;
        justify-content: center;
        width: 100%;
    }
    
    .tv-header {
        flex-direction: column;
        gap: 15px;
    }
}



/* Style CRT: ON */
.crt-status {
    order: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--tv-accent);
    font-size: 16px;
    white-space: nowrap;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.crt-status .led {
    width: 8px;
    height: 8px;
    background: var(--tv-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--tv-green);
}

/* Container du défilement (Marquee) */
.marquee-container {
    order: 2;
    flex: 1;
    text-align: center;
}

.tv-clock-marquee {
    color: var(--tv-text);
    font-size: 18px;
    letter-spacing: 2px;
    white-space: nowrap;
}

/* ========================================
   STYLES D3.JS - GRAPHIQUE ÉVOLUTION
   ======================================== */
.tv-d3-chart {
    width: 100%;
    height: 100%;
}

.tv-d3-axis path,
.tv-d3-axis line {
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.tv-d3-axis text {
    fill: #aaaaaa;
    font-family: 'VT323', monospace;
    font-size: 14px;
}

.tv-d3-grid {
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1;
    stroke-dasharray: 3, 3;
}

.tv-d3-line {
    filter: drop-shadow(0 0 3px currentColor);
    transition: all 0.3s ease;
}

.tv-d3-line:hover {
    stroke-width: 4 !important;
    filter: drop-shadow(0 0 8px currentColor);
}

.tv-d3-point {
    transition: all 0.3s ease;
    cursor: pointer;
}

.tv-d3-point:hover {
    r: 7 !important;
    filter: drop-shadow(0 0 6px currentColor);
}

.tv-d3-legend {
    pointer-events: all;
}

.tv-d3-legend-item {
    transition: all 0.3s ease;
    opacity: 1;
}

.tv-d3-legend-item:hover {
    transform: translateX(5px);
}

.tv-d3-legend-item rect {
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 3px currentColor);
}

.tv-d3-legend-item:hover rect {
    filter: drop-shadow(0 0 6px currentColor);
}

.tv-d3-title {
    fill: #f0f0f0;
    font-family: 'VT323', monospace;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 8px rgba(0, 168, 255, 0.5);
}

.tv-d3-axis-label {
    fill: #aaaaaa;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.tv-d3-tooltip {
    animation: tooltipFadeIn 0.2s ease-out;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Effet CRT pour le graphique D3 */
.tv-chart-container .tv-d3-chart {
    position: relative;
}

.tv-chart-container .tv-d3-chart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.02) 2px,
        rgba(255, 255, 255, 0.02) 4px
    );
    pointer-events: none;
    z-index: 10;
    mix-blend-mode: overlay;
}

/* Animation de pulsation pour les points */
@keyframes pointPulse {
    0%, 100% {
        r: 5;
        opacity: 1;
    }
    50% {
        r: 6;
        opacity: 0.8;
    }
}

.tv-d3-point.pulse {
    animation: pointPulse 2s ease-in-out infinite;
}

/* Effet de traînée pour les lignes */
.tv-d3-line.trail {
    stroke-dasharray: 10, 5;
    animation: dash 30s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: 1000;
    }
}

/* ========================================
   GRAPHIQUE RADIAL - TAILLE MINIMALE
   ======================================== */
#d3-evolution-chart.radial-small {
    max-height: 400px !important;
    min-height: 400px !important;
    overflow: visible !important;
}

.radial-small svg {
    max-width: 400px !important;
    max-height: 400px !important;
    margin: 0 auto !important;
    display: block !important;
}

/* ========================================
   GRAPHIQUE RADIAL - CENTRAGE ET STYLE AMÉLIORÉ
   ======================================== */

/* Conteneur du graphique radial */
#d3-evolution-chart.radial-chart {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 500px !important;
    min-height: 500px !important;
    max-height: 500px !important;
    width: 100%;
    overflow: visible !important;
    padding: 10px;
}

.radial-chart svg {
    max-width: 550px !important;
    max-height: 500px !important;
    width: auto !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block !important;
}

/* Titre et description du graphique radial */
.radial-chart .chart-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    text-shadow: 0 0 10px rgba(0, 168, 255, 0.3) !important;
}

.radial-chart .chart-description {
    font-size: 13px !important;
    opacity: 0.9 !important;
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.4;
}

/* Légende améliorée */
.radial-chart .radial-legend {
    pointer-events: all;
    background: rgba(40, 40, 50, 0.8);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(0, 168, 255, 0.3);
    backdrop-filter: blur(5px);
}

.radial-chart .legend-title {
    font-size: 13px !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    color: var(--tv-accent) !important;
}

.radial-chart .legend-item {
    transition: all 0.2s ease;
}

.radial-chart .legend-item:hover {
    transform: translateX(3px);
    opacity: 1 !important;
}

.radial-chart .legend-item rect {
    transition: filter 0.2s ease;
}

.radial-chart .legend-item:hover rect {
    filter: brightness(1.3);
    box-shadow: 0 0 8px currentColor;
}

/* Barres radiales améliorées */
.radial-chart path {
    transition: all 0.3s ease;
}

.radial-chart path:hover {
    filter: brightness(1.2) !important;
    stroke-width: 2px !important;
}

/* Axes améliorés */
.radial-chart .hour-axis text {
    font-size: 11px !important;
    font-weight: 500 !important;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
}

.radial-chart .radial-axis text {
    font-size: 10px !important;
    font-weight: 500 !important;
}

/* Note en bas */
.radial-chart .chart-note {
    font-size: 10px !important;
    opacity: 0.7 !important;
}

/* Responsive pour le 3ème graphique */
@media (max-width: 768px) {
    .current-chart-3 .tv-chart-container {
        min-height: 450px !important;
        max-height: 450px !important;
    }
    
    .current-chart-3 .tv-chart-area {
        min-height: 450px !important;
        max-height: 450px !important;
    }
    
    #d3-evolution-chart.radial-chart {
        height: 450px !important;
        min-height: 450px !important;
        max-height: 450px !important;
    }
    
    .radial-chart svg {
        max-width: 450px !important;
        max-height: 450px !important;
    }
    
    .radial-chart .chart-title {
        font-size: 16px !important;
    }
    
    .radial-chart .chart-description {
        font-size: 12px !important;
        max-width: 350px;
    }
    
    .radial-chart .radial-legend {
        transform: scale(0.9) !important;
        transform-origin: top left;
    }
}

/* Pour les très petits écrans */
@media (max-width: 480px) {
    .radial-chart .chart-title {
        font-size: 14px !important;
    }
    
    .radial-chart .chart-description {
        font-size: 11px !important;
        max-width: 280px;
    }
    
    .radial-chart .legend-item text {
        font-size: 10px !important;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}


.current-chart-3 .tv-chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px !important;
    min-height: 500px !important;
    max-height: 500px !important;
    overflow: visible !important;
}

.current-chart-3 .tv-chart-area {
    min-height: 500px !important;
    max-height: 500px !important;
    justify-content: center;
    align-items: center;
}

/* Style spécifique pour la légende du graphique radial */
.radial-legend {
    pointer-events: all;
}

.radial-legend g {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.radial-legend g:hover {
    transform: translateX(3px);
}

.radial-legend rect {
    transition: filter 0.2s ease;
}

.radial-legend g:hover rect {
    filter: brightness(1.2);
}

/* Réduire les marges du conteneur de graphique */
.tv-chart-container.compact {
    padding: 5px !important;
    min-height: 420px !important;
    max-height: 420px !important;
}

/* Pour le 3ème graphique spécifiquement */
.current-chart-3 .tv-chart-area {
    min-height: 420px !important;
    max-height: 420px !important;
}

.current-chart-3 .tv-chart-container {
    padding: 10px !important;
}

/* Ajustement des métriques pour compenser */
.tv-metrics.compact {
    margin-top: 5px !important;
    padding: 10px !important;
}

/* Légende compacte pour petit écran */
.tv-legend.compact {
    bottom: 10px !important;
    gap: 10px !important;
}

.tv-legend-item.compact {
    padding: 4px 10px !important;
    font-size: 10px !important;
}

.tv-legend-dot.compact {
    width: 8px !important;
    height: 8px !important;
}

/* ========================================
   FILTRE MEDIA (TOUS / TV / RADIO)
   ======================================== */
.media-filter-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 15px;
    background: rgba(40, 40, 50, 0.9);
    border: 1px solid rgba(0, 168, 255, 0.4);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    margin-top: 10px;
    margin-left: 50px; /* Ajoutez cette ligne pour décaler vers la droite */
}

.media-filter-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--tv-text-dim, #aaa);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.media-filter-options {
    display: flex;
    gap: 15px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    color: var(--tv-text, #fff);
    font-size: 12px;
    font-weight: 600;
}

.filter-checkbox:hover {
    background: rgba(0, 168, 255, 0.2);
}

.filter-checkbox input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.filter-checkbox input:checked + .checkmark {
    background: var(--tv-accent, #00a8ff);
    border-color: var(--tv-accent, #00a8ff);
}

.filter-checkbox input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.filter-checkbox input:checked ~ span:not(.checkmark) {
    color: var(--tv-accent, #00a8ff);
}

.channel-count {
    font-size: 10px;
    color: var(--tv-text-dim, #888);
    font-weight: normal;
    margin-left: 4px;
}

/* Style pour le sélecteur de chaînes */
.channel-dropdown-container {
    position: relative;
    background: rgba(40, 40, 50, 0.95);
    border: 1px solid var(--tv-accent);
    border-radius: 8px;
    margin-left: 15px;
    position: relative;
    z-index: 1000;
}
.channel-dropdown-header {
    padding: 8px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--tv-accent);
}

.channel-options-grid {
    display: none; 
    position: absolute;
    /* On augmente la valeur pour descendre le bloc plus bas */
    top: calc(100% + 25px); /* Passez de 5px à 15px pour un espacement net */
    right: 0; 
    
    /* On conserve une largeur équilibrée sur 3 colonnes */
    width: 650px; 
    background: rgba(10, 10, 15, 0.98); 
    border: 1px solid var(--tv-accent);
    border-radius: 4px;
    
    display: none; /* Remplacé par grid via .open */
    grid-template-columns: repeat(3, 1fr); 
    gap: 10px;
    padding: 15px;
    
    /* On limite la hauteur pour ne pas masquer les métriques du bas */
    max-height: 350px; 
    overflow-y: auto;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.9);
    z-index: 2000;
}

.channel-options-grid::-webkit-scrollbar {
    width: 5px;
}
.channel-options-grid::-webkit-scrollbar-thumb {
    background: var(--tv-accent);
    border-radius: 5px;
}

/* Affichage en grille lors de l'activation */
.channel-options-grid.open {
    display: grid;
}

/* Ajustement des items pour la nouvelle largeur */
.channel-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    padding: 4px;
    color: #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-item:hover { background: rgba(255,255,255,0.1); }

/* ========================================
   ONE PAGE - SANS SCROLL
   ======================================== */
html, body {
    overflow: hidden !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
}

.tv-retro-container {
    height: 100vh !important;
    overflow: hidden !important;
}

.tv-frame {
    height: calc(100vh - 40px) !important;
    min-height: calc(100vh - 40px) !important;
    overflow: hidden !important;
}

.tv-screen {
    height: 100% !important;
    min-height: calc(100vh - 70px) !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}

.tv-header {
    flex-shrink: 0;
    padding: 100px 20px 15px 20px !important;
}

.tv-chart-area {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 250px;
    margin: 10px 40px !important;
    padding: 0 !important;
}

.tv-chart-container {
    flex: 1;
    height: 100%;
    max-height: 100%;
}

.tv-legend {
    position: relative;
    bottom: auto;
    margin: 10px 0;
}

.tv-metrics {
    flex-shrink: 0;
    margin-top: 15px !important;
    margin-bottom: 10px !important;
    margin-left: 40px !important;
    margin-right: 40px !important;
    padding: 12px 20px !important;
}

/* Responsive - Adjustments for smaller screens */
@media (max-height: 700px) {
    .tv-chart-area {
        min-height: 180px;
        margin: 5px 20px !important;
    }
    
    .tv-metrics {
        padding: 8px 15px !important;
    }
    
    .metric-value {
        font-size: 20px !important;
    }
    
    .metric-label {
        font-size: 11px !important;
    }
    
    .tv-header {
        padding: 80px 15px 10px 15px !important;
    }
    
    .tv-title h1 {
        font-size: 18px !important;
    }
}

/* ========================================
   FILTRE MEDIA (TOUS / TV / RADIO)
   ======================================== */
.media-filter-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 15px;
    background: rgba(40, 40, 50, 0.9);
    border: 1px solid rgba(0, 168, 255, 0.4);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    margin-top: 10px;
}

.media-filter-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--tv-text-dim, #aaa);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.media-filter-options {
    display: flex;
    gap: 15px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    color: var(--tv-text, #fff);
    font-size: 12px;
    font-weight: 600;
}

.filter-checkbox:hover {
    background: rgba(0, 168, 255, 0.2);
}

.filter-checkbox input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.filter-checkbox input:checked + .checkmark {
    background: var(--tv-accent, #00a8ff);
    border-color: var(--tv-accent, #00a8ff);
}

.filter-checkbox input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.filter-checkbox input:checked ~ span:not(.checkmark) {
    color: var(--tv-accent, #00a8ff);
}

.channel-count {
    font-size: 10px;
    color: var(--tv-text-dim, #888);
    font-weight: normal;
    margin-left: 4px;
}

/* ========================================
   ONE PAGE - SANS SCROLL
   ======================================== */
html, body {
    overflow: hidden !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
}

.tv-retro-container {
    height: 100vh !important;
    overflow: hidden !important;
}

.tv-frame {
    height: calc(100vh - 40px) !important;
    min-height: calc(100vh - 40px) !important;
    overflow: hidden !important;
}

.tv-screen {
    height: 100% !important;
    min-height: calc(100vh - 70px) !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}

.tv-header {
    flex-shrink: 0;
    padding: 100px 20px 15px 20px !important;
}

.tv-chart-area {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 250px;
    margin: 10px 40px !important;
    padding: 0 !important;
}

.tv-chart-container {
    flex: 1;
    height: 100%;
    max-height: 100%;
}

.tv-legend {
    position: relative;
    bottom: auto;
    margin: 10px 0;
}

.tv-metrics {
    flex-shrink: 0;
    margin-top: 15px !important;
    margin-bottom: 10px !important;
    margin-left: 40px !important;
    margin-right: 40px !important;
    padding: 12px 20px !important;
}



/* Responsive - Adjustments for smaller screens */
@media (max-height: 700px) {
    .tv-chart-area {
        min-height: 180px;
        margin: 5px 20px !important;
    }
    
    .tv-metrics {
        padding: 8px 15px !important;
    }
    
    .metric-value {
        font-size: 20px !important;
    }
    
    .metric-label {
        font-size: 11px !important;
    }
    
    .tv-header {
        padding: 80px 15px 10px 15px !important;
    }
    
    .tv-title h1 {
        font-size: 18px !important;
    }
}

/* ========================================
   SUPPRESSION COMPLÈTE DES ENCADRÉS BLANCS
   ======================================== */

/* Désactiver complètement l'effet glitch pour tous les graphiques */
#glitch-fullscreen,
.glitch-overlay,
.glitch-layer,
.glitch-scanlines,
.glitch-fullscreen {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    background: transparent !important;
}

/* Supprimer les effets de glitch du conteneur */
.tv-chart-container.tv-glitch,
.tv-screen.tv-glitch {
    animation: none !important;
    filter: none !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Cacher les overlays artistiques */
#artistic-overlay,
.artistic-overlay,
.tv-artistic-overlay {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Supprimer les effets CRT qui pourraient causer des encadrés */
.tv-scanlines,
.tv-vignette,
.tv-glow::before,
.tv-curvature,
.tv-scanline-bar {
    opacity: 0.1 !important; /* Très réduit pour ne pas interférer */
    z-index: 1 !important;
}

/* Style spécifique pour le graphique radial - nettoyage complet */
.current-chart-3 .tv-screen,
.current-chart-3 .tv-frame,
.current-chart-3 .tv-container {
    position: relative !important;
    overflow: hidden !important;
}

.current-chart-3 .tv-screen::before,
.current-chart-3 .tv-screen::after,
.current-chart-3 .tv-frame::before,
.current-chart-3 .tv-frame::after {
    content: none !important;
    display: none !important;
}

/* S'assurer que le conteneur D3 est propre */
#d3-evolution-chart.radial-chart {
    position: relative !important;
    z-index: 100 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Nettoyer le SVG lui-même */
#d3-evolution-chart.radial-chart svg {
    position: relative !important;
    z-index: 101 !important;
    background: transparent !important;
    filter: none !important;
}

/* Supprimer les effets de pulsation sur les éléments D3 */
.tv-d3-point.pulse,
.tv-d3-line.trail {
    animation: none !important;
}

/* Cacher les tooltips glitch */
#d3-tooltip,
#d3-bubble-tooltip,
#radial-tooltip {
    z-index: 9999 !important;
    background: rgba(26, 26, 26, 0.98) !important;
    border: 1px solid rgba(0, 168, 255, 0.6) !important;
    backdrop-filter: blur(10px) !important;
}

/* ========================================
   STYLE PROPRE POUR LE GRAPHIQUE RADIAL
   ======================================== */

.current-chart-3 #d3-evolution-chart {
    /* Reset complet */
    all: initial;
    
    /* Dimensions fixes */
    width: 100% !important;
    height: 450px !important;
    max-height: 450px !important;
    min-height: 450px !important;
    
    /* Positionnement */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto !important;
    padding: 10px !important;
    
    /* Arrière-plan */
    background: transparent !important;
    
    /* Pas d'effets */
    box-shadow: none !important;
    border: none !important;
    filter: none !important;
    animation: none !important;
    
    /* Z-index élevé */
    z-index: 100 !important;
    position: relative !important;
    overflow: visible !important;
}

.current-chart-3 #d3-evolution-chart svg {
    /* SVG propre */
    background: transparent !important;
    filter: none !important;
    animation: none !important;
    
    /* Taille adaptée */
    width: auto !important;
    max-width: 500px !important;
    height: auto !important;
    max-height: 420px !important;
    
    /* Centrage */
    display: block !important;
    margin: 0 auto !important;
    
    /* Pas de bordures */
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Assurer la visibilité des éléments du graphique */
.current-chart-3 .radial-chart path {
    stroke: #ffffff !important;
    stroke-width: 1px !important;
    stroke-opacity: 0.5 !important;
}

.current-chart-3 .radial-chart text {
    fill: #ffffff !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
    font-family: 'Segoe UI', sans-serif !important;
}

/* Légende bien visible */
.current-chart-3 .tv-legend {
    background: rgba(40, 40, 50, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(0, 168, 255, 0.4) !important;
    z-index: 150 !important;
}

/* Métriques bien positionnées */
.current-chart-3 .tv-metrics {
    background: rgba(26, 26, 26, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    z-index: 90 !important;
}