
:root {
    /* Palette inspirée du Dollar et de la Forêt */
    --primary-color: #1b4332; /* Vert très foncé (Header, Textes forts) */
    --accent-color: #40916c;  /* Vert feuille (Boutons, Highlights) */
    --light-green: #d8f3dc;   /* Vert très pâle (Fonds secondaires) */
    --bg-color: #f0f7f4;      /* Blanc mentholé (Fond de page) */
    --card-bg: #ffffff;       /* Blanc pur */
    --gold: #d4af37;          /* Doré (Pour symboliser la richesse) */
    --text-color: #2d3436;
    
    --shadow: 0 4px 15px rgba(27, 67, 50, 0.1); /* Ombre légèrement teintée */
    --radius: 16px;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

header {
    background: var(--primary-color);
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%); /* Dégradé subtil */
    color: white;
    padding: 0.8rem 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;

    position: sticky;
    top: 0;
    z-index: 1000; 
    backdrop-filter: blur(10px); 
}

header h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-container {
    display: flex;
    gap: 12px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 50px; 
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 600;
}

.nav-btn:hover {
    background: var(--gold);
    color: var(--primary-color);
    border-color: var(--gold);
    transform: translateY(-2px);
}


.intro-banner {
    background: white;
    padding: 40px 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
}

.intro-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    max-width: 1000px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.intro-text {
    flex: 2;
    min-width: 300px;
}

.intro-text h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 15px;
}

.intro-text p {
    font-size: 1.1rem;
    color: #555;
}

.intro-visual {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--primary-color);
    font-weight: bold;
    min-width: 150px;
}

.highlight-green { color: var(--accent-color); font-weight: bold; }
.highlight-gold { color: var(--gold); font-weight: bold; }
.highlight-dark { color: var(--primary-color); font-weight: bold; }

.arrow-down {
    margin-top: 20px;
    font-size: 1.5rem;
    color: var(--accent-color);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

/* --- LAYOUT PRINCIPAL --- */
.dashboard-section {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    padding: 0 40px 40px 40px;
    max-width: 1600px;
    margin: 0 auto;
}

/* --- PANNEAU DE CONTRÔLE --- */
.controls-container {
    background: var(--card-bg);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 90px; /* 80px (header) + 10px marge */
    border: 1px solid rgba(0,0,0,0.05);
}

.controls-container h2 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--light-green);
    padding-bottom: 10px;
    margin-top: 0;
}

/* Inputs & Boutons Contrôles */
input[type=range] {
    width: 100%;
    accent-color: var(--primary-color); /* Couleur verte du slider */
}

#annee-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    display: block;
    text-align: center;
    margin: 10px 0;
}

#start-stop-btn, #treemap-start-stop-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

#start-stop-btn:hover {
    background-color: var(--accent-color);
}

/* Checkbox Style */
.checkbox-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.checkbox-controls button {
    flex: 1;
    background: var(--light-green);
    color: var(--primary-color);
    border: none;
    padding: 5px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.checkbox-controls button:hover {
    background: #c3e6cb;
}

#pays-checkbox-container {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 8px;
    background: #fafafa;
}

.pays-option {
    display: flex;
    align-items: center;
    padding: 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.pays-option:hover {
    background-color: var(--light-green);
}

.pays-option input {
    accent-color: var(--primary-color);
    margin-right: 10px;
}

/* --- GRAPHIQUES --- */
.charts-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.visualization {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.05);
}

.visualization h2 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- ONGLETS SWITCH GRAPHS --- */
.chart-controls {
    display: flex;
    justify-content: center;
    background: #e8f5e9; 
    padding: 5px;
    border-radius: 10px;
    margin-bottom: 30px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.mode-btn {
    background: transparent;
    border: none;
    padding: 10px 25px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #555;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.mode-btn.active {
    background-color: white;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-weight: 700;
}

.mode-btn:hover:not(.active) {
    color: var(--primary-color);
}

/* --- TOOLTIP --- */
.tooltip-gap {
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid var(--accent-color) !important;
    color: var(--text-color);
}


html {
    scroll-behavior: smooth; /* Active le défilement fluide natif */
    /* IMPORTANT : Crée une marge invisible en haut pour que le titre 
       ne soit pas caché par le header sticky lors du scroll */
    scroll-padding-top: 100px; 
}

.arrow-down {
    cursor: pointer; /* Transforme la souris en main au survol */
    transition: transform 0.3s, color 0.3s;
}

.arrow-down:hover {
    transform: translateY(5px) scale(1.2); /* Petit effet d'animation au survol */
    color: var(--primary-color);
}

.rapport section {
    background: white;
    padding: 10px 30px 20px 30px;
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}

.rapport p {
    flex: 2;
    min-width: 300px;
    font-size: 1.1rem;
    color: #555;
}

.rapport h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 15px;
}

.rapport h3 {
    color: var(--primary-color);
}

.rapport code {
    color: var(--primary-color);
    background-color: #f5f5f5;
    padding: 4px 6px;
    border-radius: 4px;
    margin-left: 4px;
    margin-right: 4px;
}

.rapport ul {
    flex: 2;
    min-width: 300px;
    font-size: 1rem;
    color: #555;
}

.rapport li::marker {
    color: var(--accent-color);
    font-size: 20px;
}

.rapport .img-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    width: 100%;
    max-width: 640px; /* conteneur contraint */
    padding: 0 12px;
}


.rapport .img-container img,
main.rapport img,
.rapport img {
    display: block;
    width: 100% !important;
    max-width: 640px !important;
    height: auto !important;
    max-height: 45vh !important;
    object-fit: contain;
    margin: 0 auto;
    border-radius: 6px;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.rapport .contenu-rapport {
    margin: 0 auto;
    padding-left: 10%;
    padding-right: 10%;
}

/* --- LEGENDE --- */
.legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #333;
}

.legend-color {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.1);
}

