/* --- THEME GAMING GLOBAL --- */
:root {
    --bg-color: #12121b;
    --card-bg: #1e1e2f;
    --text-main: #e0e6ed;
    --accent-color: #00f3ff; /* Cyan Néon */
    --accent-hover: #bc13fe; /* Violet Néon */
    --border-color: #2d2d44;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

header {
    background: linear-gradient(90deg, #0f0c29, #302b63, #24243e);
    padding: 20px;
    border-bottom: 2px solid var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

h1 {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
    text-shadow: 0 0 5px var(--accent-color);
        margin: 0 0 10px 0; /* Marge réduite pour rapprocher le sous-titre */
}

/* Sous-titre */
header p {
    text-align: center;
    color: #b0b0c0;
    margin: 0 0 20px 0;
    font-size: 0.95em;
}

/* Citation / Disclaimer */
header blockquote {
    text-align: left;
    margin: 0 auto 25px auto; /* Centré horizontalement avec marge bas */
    padding: 15px 20px;
    max-width: 800px;
    background-color: rgba(0, 0, 0, 0.25);
    border-left: 4px solid var(--accent-color); /* Barre cyan à gauche */
    color: #ddd;
    font-style: italic;
    font-size: 0.9em;
    border-radius: 0 8px 8px 0;
}

/* --- BOUTON MENU & MODAL --- */
.neon-btn {
    display: block;
    margin: 0 auto;
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    padding: 10px 25px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
    transition: all 0.3s ease;
}

.neon-btn:hover {
    background-color: var(--accent-color);
    color: #12121b;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.6);
}

/* --- CONTRÔLES --- */
.global-controls {
    display: flex;
    flex-direction: row; 
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);

    position: sticky;
    top: 0;
    z-index: 1000;
}

.control-group {
    background-color: rgba(0,0,0,0.2);
    padding: 10px 15px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    min-width: 200px;
    flex: 1; /* Allow growing */
    max-width: 400px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #ffd700; /* Gold */
}

/* Custom Range Sliders */
input[type=range] {
    width: 100%;
    /* Remove default appearance */
    -webkit-appearance: none; 
    appearance: none; 
    background: transparent; 
    cursor: pointer;
}

/* Style for Single Slider Track (Top N) */
input[type=range].single-slider {
    height: 6px;
    background: #444; /* Grey track */
    border-radius: 5px;
    transition: background 0.2s;
}
input[type=range].single-slider:hover {
    background: #555;
}

/* Dual Range Slider Styles */
.range-inputs {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dual-range-wrapper {
    position: relative;
    width: 100%;
    height: 30px; /* Hauteur zone clickable */
    margin: 0 5px;
}

.slider-track {
    width: 100%;
    height: 6px; /* Matche single slider */
    background-color: #444;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 5px;
    z-index: 1;
}

/* Les inputs superposés (Dual) */
.dual-range-wrapper input[type="range"] {
    position: absolute;
    top: 50%; /* Centré verticalement */
    transform: translateY(-50%); /* Centré verticalement */
    width: 100%;
    pointer-events: none; /* Laisse passer les clics */
    margin: 0;
    z-index: 2; /* Au dessus du track */
}

/* --- THUMBS (Styles Communs & Spécifiques) --- */

/* WEBKKIT */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 5px var(--accent-color);
    cursor: pointer;
    position: relative;
    z-index: 3;
    margin-top: -6px; /* Ajustement par défaut pour single slider */
}

/* Specific adjustment for dual inputs to align with absolute positioning */
.dual-range-wrapper input[type="range"]::-webkit-slider-thumb {
    pointer-events: auto; /* Réactive les clics */
    margin-top: -6px; /* Ajustement fin */
}


/* FIREFOX */
input[type="range"]::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border: none;
    border-radius: 50%;
    background: var(--accent-color);
    box-shadow: 0 0 5px var(--accent-color);
    cursor: pointer;
    position: relative;
    z-index: 3;
    pointer-events: auto;
}

/* Hover effects */
input[type="range"]::-webkit-slider-thumb:hover {
    background: #fff;
    box-shadow: 0 0 10px #fff;
}
input[type="range"]::-moz-range-thumb:hover {
    background: #fff;
    box-shadow: 0 0 10px #fff;
}

/* Checkboxes */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    font-size: 0.85em;
}

/* --- SECTIONS & GRAPHIQUES --- */
/* Nouveau conteneur de grille */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 colonnes forcées */
    gap: 25px;
    padding: 20px;
    width: 95%;
    max-width: 1800px;
    margin: 0 auto;
}

section {
    /* On remplace les marges auto par le style de carte flexible */
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    border: 1px solid var(--border-color);
    
    /* Flex pour centrer le titre et le contenu verticalement */
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden; /* Important pour que le SVG ne casse pas la grille */
}

section h2 {
    color: var(--text-main);
    margin-top: 0;
    font-size: 1.2em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    width: 100%;
    text-align: center;
}

/* Responsive : passe en 1 colonne si l'écran est trop petit (< 1400px) */
@media (max-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Centrage des SVGs */
#podium-container, #top10_game-container, #sales_region-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    /* On enlève l'overflow auto pour que ça resize au lieu de scroller */
    /* overflow-x: auto; */
    padding: 10px;
    margin: auto;
}

/* Rendre tous les SVG responsive */
svg {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

/* --- STYLES D3.js (SVG) --- */

/* Les axes et textes en blanc pour le dark mode */
.tick text {
    fill: var(--text-main);
    font-size: 12px;
}
.tick line, .domain {
    stroke: var(--border-color);
}

/* --- TOOLTIPS UNIFIÉS --- */
.tooltip {
    position: absolute;
    opacity: 0; /* Caché par défaut, géré par JS */
    background-color: rgba(15, 15, 25, 0.95);
    color: #fff;
    padding: 10px 15px;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    pointer-events: none;
    font-size: 0.9em;
    z-index: 100;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
    transition: opacity 0.2s;
    line-height: 1.4;
}

.tooltip strong {
    color: var(--accent-color);
    display: block;
    border-bottom: 1px solid #555;
    margin-bottom: 5px;
    padding-bottom: 2px;
}

/* Classe utilitaire JS */
.hidden {
    display: none;
    opacity: 0 !important;
}

/* Tooltip Styles */
#tooltip_topG {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    pointer-events: none;
    font-size: 0.85em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
}

#tooltip_topG strong {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 3px;
}

/* Style de l'infobulle (Tooltip) */
#tooltip_podium {
    position: absolute;
    opacity: 0;
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 13px;
    pointer-events: none; /* La souris passe au travers */
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: opacity 0.2s;
    white-space: nowrap; /* Empêche le texte de passer à la ligne */
}

#radial_chart-container {
    background-color: #ffffff28; /* Légère teinte cyan */
}

#back-button, #back-button-region, #back-button-publisher {
    background-color: var(--accent-color);
    color: #12121b;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
    transition: background-color 0.3s, box-shadow 0.3s;
}