:root {
    --color-bg-rhone: #1d485e;
    --color-bg-arve: #8b8878;
    --color-text-rhone: #00DDFF;
    /* Bleu Cyan */
    --color-text-arve: #B7FF00;
    /* Vert Électrique */
    --font-main: 'Inter', Helvetica, Arial, sans-serif;
    --font-mono: 'Fragment Mono', Courier, monospace;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    font-family: var(--font-main);
    background-color: #000;
    color: var(--text-white);
    overflow: hidden;
    overscroll-behavior: none;
}

@supports (-webkit-touch-callout: none) {

    html,
    body {
        height: -webkit-fill-available;
    }

    .dashboard {
        height: -webkit-fill-available;
        min-height: -webkit-fill-available;
    }
}

.dashboard {
    display: flex;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100vw;
    position: relative;
    overflow: hidden;
}

/* Sections des rivières */
.river-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Pousse le titre en haut et les données en bas */
    padding: 2rem;
}

/* Rhône : Application de la couleur spécifique */
.rhone {
    background-color: var(--color-bg-rhone);
    color: var(--color-text-rhone);
}


/* Arve : Application de la couleur spécifique */
.arve {
    background-color: var(--color-bg-arve);
    color: var(--color-text-arve);
    position: relative;
    overflow: hidden;
}

/* En-tête (Titre + Température) */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    /* Aligne la température sur la base du nom de la rivière */
}

.title-group h2 {
    font-size: 5rem;
    font-weight: 400;
    margin: 0;
    letter-spacing: 1px;
}

.title-group .location {
    font-size: 1.2rem;
    margin: 5px 0 0 0;
    opacity: 0.9;
}

/* Alignement spécifique du texte pour l'Arve */
.arve .title-group {
    text-align: right;
}

.temp-display {
    font-family: var(--font-mono);
    font-size: 1.5rem;
}

/* Grille de données du bas */
.data-bottom {
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: var(--font-mono);
    font-size: 1.2rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* La magie de l'effet miroir pour l'Arve */
.arve .data-row {
    flex-direction: row-reverse;
}

/* Pastille centrale */
.center-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    cursor: help;
    /* Change le curseur pour indiquer une interaction */
}

.icon-circle {
    background-color: white;
    color: black;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Style de l'info-bulle (Tooltip) */
.tooltip {
    visibility: hidden;
    width: 160px;
    background-color: rgba(0, 0, 0, 0.85);
    color: #B2B2B2;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 11;
    bottom: 125%;
    /* Positionnée au-dessus du cercle */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    font-family: var(--font-main);
    white-space: nowrap;
    pointer-events: none;
    /* Évite que l'info-bulle ne bloque le survol */
}

/* Petit triangle sous l'info-bulle */
.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent;
}

/* Affichage au survol */
.center-icon:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* Version Mobile (Empilée et standardisée) */
@media (max-width: 800px) {

    body,
    html {
        overflow: hidden;
    }

    .dashboard {
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .river-section {
        flex: 1 1 50%;
        min-height: 0;
        padding: 30px 22px;
        overflow: hidden;
    }

    .title-group h2 {
        font-size: 2.7rem;
    }

    .title-group .location {
        font-size: 0.95rem;
    }

    .temp-display {
        font-size: 1.15rem;
    }

    .data-bottom {
        gap: 10px;
        font-size: 0.95rem;
    }

    .info-button {
        top: 14px;
        right: 14px;
        left: auto;
        transform: none;
        width: 26px;
        height: 26px;
        font-size: 1.05rem;
    }

    /* Annule l'effet miroir de l'Arve sur mobile */
    .arve .header-top {
        flex-direction: row-reverse;
        margin-top: -8px
            /* Remet le titre à gauche et la temp à droite */
    }

    .arve .title-group {
        text-align: left;
    }

    .arve .data-row {
        flex-direction: row;
        /* Valeurs à droite, labels à gauche */
    }

    .center-icon {
        display: none;
        /* Masque la pastille centrale sur mobile */
    }
}


/* --- Effet de turbidité pour l'Arve --- */

/* On s'assure que rien ne déborde de la carte de l'Arve */


.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* On s'assure que le texte reste au-dessus des particules */
.arve .header-top,
.arve .data-bottom {
    position: relative;
    z-index: 1;
}

/* Style individuel d'une particule */
.particle {
    position: absolute;
    background-color: #727166;
    border-radius: 50%;
    top: 0;
    /* La position verticale est fixée en JS pour rester visible */
    animation: bubbleFloat ease-in-out infinite;
}

/* Animation flottante qui garde les particules dans le cadre */
@keyframes bubbleFloat {
    0% {
        transform: translate(0, 0) scale(0.9);
        opacity: 0.45;
    }

    50% {
        /* Petite remontée et dérive latérale */
        transform: translate(var(--sway), -30px) scale(1.05);
        opacity: 0.85;
    }

    100% {
        transform: translate(calc(var(--sway) * -0.5), 0) scale(0.95);
        opacity: 0.6;
    }
}

/* Remplace les styles de .center-icon et .icon-circle par ceci : */



/* Ajoute ceci à la fin de ton fichier style.css */

/* --- Info-bulle Graphique --- */
.has-graph {
    cursor: crosshair;
    /* Indique qu'il y a une interaction de précision */
    transition: opacity 0.2s;
}

.has-graph:hover {
    opacity: 0.8;
}

.graph-tooltip {
    position: absolute;
    display: none;
    background: rgba(10, 15, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    width: 380px;
    /* Légèrement plus large */
    height: 240px;
    /* Légèrement plus haut */
    box-sizing: border-box;
    /* Essentiel pour gérer les marges internes correctement */
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}


#graph-loading {
    color: white;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

/* On s'assure que le canvas occupe tout l'espace de la tooltip */
#hoverChart {
    width: 100% !important;
    height: 100% !important;
    display: block;
    /* Supprime l'espace fantôme sous le canvas */
}

/* --- Info Button & Modal --- */
.info-button {
    position: fixed;
    top: 26px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #B2B2B2;
    border: none;
    color: black;
    font-size: 1.25rem;
    font-weight: bold;
    font-family: var(--font-mono);
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}

.info-button:hover {
    background-color: black;
    color: #B2B2B2;
}

.info-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(23, 75, 95, 0.82);
    display: none;
    align-items: flex-start;
    justify-content: flex-start;
    z-index: 200;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    overflow-y: auto;
    padding: 24px;
    box-sizing: border-box;
}

.info-overlay.active {
    display: flex;
}

.info-modal {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    max-width: none;
    width: 100%;
    min-height: calc(100dvh - 48px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    max-height: none;
    overflow: visible;
    color: #B2B2B2;
    font-family: var(--font-main);
    position: relative;
    box-shadow: none;
}

.info-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 56px;
    align-items: start;
    margin-top: auto;
    padding-bottom: 10px;
}

.info-intro {
    max-width: none;
    width: 100%;
}

@media (min-width: 801px) {
    .info-intro {
        align-self: stretch;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding-bottom: 9px;
    }

    .info-intro p:last-of-type {
        margin: 0;
        margin-top: auto;
    }
}

.info-intro h2 {
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    margin: 0 0 18px 0;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 0.95;
    color: #B2B2B2;
}

.info-lede {
    margin: 0;
    font-size: clamp(1.625rem, 2.6vw, 2.21rem);
    line-height: 1.22;
    color: #B2B2B2;
}

.info-credits h3 {
    margin: 0 0 22px 0;
    font-size: 1.65rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: #B2B2B2;
}

.info-updated {
    position: fixed;
    top: 84px;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    width: max-content;
    margin: 0;
    padding: 7px 14px;
    background-color: rgba(0, 0, 0, 0.92);
    border: none;
    border-radius: 10px;
    color: #B2B2B2;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    text-align: center;
}

.info-updated p {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 1;
    white-space: nowrap;
    color: #B2B2B2;
}

.footer-section {
    margin-bottom: 26px;
}

.footer-section:last-of-type {
    margin-bottom: 0;
}

.footer-section h4 {
    font-size: 0.95rem;
    margin: 0 0 2px 0;
    font-weight: 600;
    color: #B2B2B2;
}

.footer-section p {
    font-size: 0.98rem;
    line-height: 1.45;
    color: #B2B2B2;
    margin: 0;
    font-weight: 300;
}

.footer-section a {
    color: #B2B2B2;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.2s;
}

.footer-section a:hover {
    opacity: 0.8;
}

.info-close {
    position: fixed;
    top: 26px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    background: rgba(178, 178, 178, 0.95);
    border: none;
    color: #111;
    font-size: 1.25rem;
    font-weight: bold;
    font-family: var(--font-mono);
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-close:hover {
    background-color: black;
    color: #B2B2B2;
}

.info-close-icon {
    display: block;
    transform: translateY(-1px);
}

@media (max-width: 800px) {
    .info-close {
        top: 14px;
        right: 14px;
        left: auto;
        transform: none;
        width: 26px;
        height: 26px;
        font-size: 1.05rem;
        line-height: 1;
    }

    .info-close:hover {
        transform: scale(1.05);
    }

    .info-button {
        top: 14px;
        right: 14px;
        left: auto;
        transform: none;
        width: 26px;
        height: 26px;
        font-size: 1.05rem;
    }

    .info-modal {
        min-height: calc(100dvh - 48px);
        width: 100%;
        justify-content: flex-start;
    }

    .info-layout {
        grid-template-columns: 1fr;
        gap: 28px;
        padding-bottom: 0;
        margin-top: 24px;
    }

    .info-intro h2 {
        font-size: 2rem;
        margin-bottom: 8px;
    }

    .info-lede {
        font-size: 1.365rem;
        max-width: none;
    }

    .info-intro p:last-of-type {
        display: none;
    }

    .info-credits::after {
        content: "2025–2026";
        display: block;
        margin-top: 24px;
        font-family: var(--font-main);
        font-size: 1rem;
        line-height: 1;
        color: #B2B2B2;
        font-weight: 300;
    }

    .info-credits h3 {
        font-size: 1.3rem;
        margin-bottom: 8px;
    }

    .info-updated {
        top: auto;
        bottom: 34px;
    }

    .footer-section {
        margin-bottom: 22px;
    }

    .footer-section p {
        font-size: 0.94rem;
        line-height: 1.5;
    }
}