/**

 * Styles pour l'affichage des stations hydrologiques

 * ===================================================

 *

 * Modifications :

 * - Bulletin : texte plus large (max-width 1200px) et plus grand

 * - Stations amont : cartes plus grandes (minmax 350px), texte agrandi

 */



/* ===== VARIABLES CSS ===== */

:root {

    /* Vigilance */

    --vert-400: #4ade80;

    --vert-500: #22c55e;

    --vert-700: #15803d;



    --jaune-400: #ffec0d;

    --jaune-500: #ffdd00;

    --jaune-700: #a67502;



    --orange-400: #ffae32;

    --orange-500: #ff930a;

    --orange-700: #cc5902;



    --rouge-400: #ff5757;

    --rouge-500: #ff2323;

    --rouge-700: #d70000;



    /* Primary */

    --primary-100: #e0eaed;

    --primary-200: #c4d5dd;

    --primary-900: #323d47;

    --primary-950: #1e272e;



    /* Accent */

    --bleu-500: #339af0;

}



/* ===== RESET & BASE ===== */

* {

    margin: 0;

    padding: 0;

    box-sizing: border-box;

}



body {

    font-family: 'Inter', sans-serif;

    background: linear-gradient(135deg, var(--primary-950), var(--primary-900));

    color: white;

    height: 100vh;

    height: 100dvh;

    overflow: hidden;

}



/* ===== ERROR STATE ===== */

.error-container {

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    height: 100vh;

    text-align: center;

    padding: 2rem;

}



.error-icon {

    width: 80px;

    height: 80px;

    fill: var(--rouge-400);

    margin-bottom: 1.5rem;

}



.error-title {

    font-family: 'Space Grotesk', sans-serif;

    font-size: clamp(1.25rem, 4vw, 2rem);

    font-weight: 600;

    margin-bottom: 1rem;

}



.error-message {

    font-size: 1.1rem;

    color: var(--primary-200);

    max-width: 500px;

    margin-bottom: 1rem;

}



.error-code {

    font-family: monospace;

    font-size: 0.8rem;

    background: rgba(255, 255, 255, 0.1);

    padding: 0.75rem 1rem;

    border-radius: 0.5rem;

    color: var(--primary-200);

    word-break: break-all;

    max-width: 90%;

}



/* ===== CAROUSEL ===== */

.carousel-container {

    position: relative;

    width: 100%;

    height: 100vh;

    height: 100dvh;

    overflow: hidden;

}



.slide {

    position: absolute;

    top: 0;

    left: 0;

    width: 100%;

    height: 100%;

    opacity: 0;

    visibility: hidden;

    transition: opacity 0.8s, visibility 0.8s;

    padding: 1.5rem;

    display: flex;

    flex-direction: column;

}



.slide.active {

    opacity: 1;

    visibility: visible;

}



/* ===== HEADER ===== */

.header {

    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    margin-bottom: 1rem;

    gap: 1rem;

    flex-shrink: 0;

    padding: 1rem 1.5rem;

    border-radius: 1rem;

    margin: -0.5rem -0.5rem 1rem -0.5rem;

}



/* Couleurs de fond header selon vigilance */

.header.vigilance-vert {

    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.1));

    border: 1px solid rgba(34, 197, 94, 0.3);

}



.header.vigilance-jaune {

    background: linear-gradient(135deg, rgba(255, 221, 0, 0.3), rgba(255, 221, 0, 0.1));

    border: 1px solid rgba(255, 221, 0, 0.3);

}



.header.vigilance-orange {

    background: linear-gradient(135deg, rgba(255, 147, 10, 0.3), rgba(255, 147, 10, 0.1));

    border: 1px solid rgba(255, 147, 10, 0.3);

}



.header.vigilance-rouge {

    background: linear-gradient(135deg, rgba(255, 35, 35, 0.3), rgba(255, 35, 35, 0.1));

    border: 1px solid rgba(255, 35, 35, 0.3);

}



.station-info {

    display: flex;

    flex-direction: column;

    gap: 0.25rem;

}



.station-name {

    font-family: 'Space Grotesk', sans-serif;

    font-size: clamp(1.75rem, 5vw, 3.5rem);

    font-weight: 700;

    line-height: 1.1;

}



.river-name {

    font-size: clamp(1rem, 2.5vw, 1.5rem);

    color: var(--primary-200);

    display: flex;

    align-items: center;

    gap: 0.5rem;

}



.river-name svg {

    width: 24px;

    height: 24px;

    fill: currentColor;

}



.datetime-box {

    text-align: right;

    display: flex;

    flex-direction: column;

    align-items: flex-end;

    gap: 0.15rem;

    flex-shrink: 0;

}



.current-time {

    font-family: 'Space Grotesk', sans-serif;

    font-size: clamp(1.5rem, 4vw, 3rem);

    font-weight: 600;

}



.current-date {

    font-size: clamp(0.75rem, 1.5vw, 1.25rem);

    color: var(--primary-200);

}



.last-update {

    font-size: 0.85rem;

    color: var(--primary-200);

    opacity: 0.7;

    margin-top: 0.25rem;

}



/* ===== VIGILANCE BADGE ===== */

.vigilance-badge {

    display: inline-flex;

    align-items: center;

    gap: 0.5rem;

    padding: 0.5rem 1rem;

    border-radius: 100px;

    font-weight: 600;

    font-size: clamp(0.75rem, 1.5vw, 1.1rem);

    text-transform: uppercase;

    letter-spacing: 0.05em;

    margin-top: 0.5rem;

    width: fit-content;

}



.vigilance-badge.vert {

    background: var(--vert-500);

    color: var(--vert-700);

    box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);

}



.vigilance-badge.jaune {

    background: var(--jaune-500);

    color: var(--jaune-700);

    box-shadow: 0 0 30px rgba(255, 221, 0, 0.4);

}



.vigilance-badge.orange {

    background: var(--orange-500);

    color: white;

    box-shadow: 0 0 30px rgba(255, 147, 10, 0.4);

}



.vigilance-badge.rouge {

    background: var(--rouge-500);

    color: white;

    box-shadow: 0 0 30px rgba(255, 35, 35, 0.4);

}



.vigilance-dot {

    width: 10px;

    height: 10px;

    border-radius: 50%;

    background: currentColor;

    animation: pulse 2s infinite;

}



@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }

}



/* ===== CONTENT ===== */

.content {

    flex: 1;

    display: flex;

    flex-direction: column;

    justify-content: center;

    gap: 1.5rem;

    overflow: hidden;

}



/* ===== HERO SECTION (Page 1) ===== */

.hero-section {

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;

    padding: 1rem;

}



.hero-level {

    font-family: 'Space Grotesk', sans-serif;

    font-size: clamp(4rem, 15vw, 12rem);

    font-weight: 700;

    line-height: 1;

    color: white;

    margin-bottom: 0.5rem;

}



.hero-level-unit {

    font-size: 0.4em;

    font-weight: 500;

    color: var(--primary-200);

    margin-left: 0.1em;

}



.hero-level-label {

    font-size: clamp(1rem, 2vw, 1.5rem);

    color: var(--primary-200);

    text-transform: uppercase;

    letter-spacing: 0.1em;

    margin-bottom: 2rem;

}



.hero-trend {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 1rem;

}



.hero-trend-icon {

    width: clamp(40px, 8vw, 80px);

    height: clamp(40px, 8vw, 80px);

    fill: white;

}



.hero-trend-text {

    font-family: 'Space Grotesk', sans-serif;

    font-size: clamp(2rem, 8vw, 5rem);

    font-weight: 700;

    color: white;

}



/* ===== METRICS ===== */

.metrics-row {

    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 1rem;

}



/* Variante 3 colonnes */

.metrics-row-3 {

    grid-template-columns: repeat(3, 1fr);

}



.metric-card {

    background: rgba(255, 255, 255, 0.05);

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 1rem;

    padding: 1rem;

    display: flex;

    flex-direction: column;

    gap: 0.25rem;

}



.metric-label {

    font-size: clamp(0.6rem, 1.2vw, 0.85rem);

    color: var(--primary-200);

    text-transform: uppercase;

    letter-spacing: 0.08em;

    font-weight: 500;

}



.metric-value {

    font-family: 'Space Grotesk', sans-serif;

    font-size: clamp(1.25rem, 3vw, 2.5rem);

    font-weight: 700;

    line-height: 1.1;

}



.metric-unit {

    font-size: clamp(0.75rem, 1.5vw, 1.25rem);

    font-weight: 400;

    color: var(--primary-200);

    margin-left: 0.15rem;

}



/* ===== BULLETIN (Page 2) - MODIFIÉ ===== */

.bulletin-section {

    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 1.5rem;

    padding: clamp(1rem, 3vw, 2rem);

    display: flex;

    flex-direction: column;

    gap: 1rem;

    flex: 1;

    overflow: hidden;

}



/* Header compact: icône + titre + date sur une ligne */

.bulletin-header {

    display: flex;

    align-items: center;

    gap: 1rem;

    flex-shrink: 0;

    flex-wrap: wrap;

}



.bulletin-icon {

    width: clamp(40px, 5vw, 50px);

    height: clamp(40px, 5vw, 50px);

    border-radius: 0.75rem;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-shrink: 0;

}



.bulletin-icon.jaune {
    background: var(--jaune-500);
    color: var(--jaune-700);
}

.bulletin-icon.orange {
    background: var(--orange-500);
    color: white;
}

.bulletin-icon.rouge {
    background: var(--rouge-500);
    color: white;
}

.bulletin-icon.vert {
    background: var(--vert-500);
    color: var(--vert-700);
}



.bulletin-icon svg {

    width: 60%;

    height: 60%;

    fill: currentColor;

}



.bulletin-title {

    font-family: 'Space Grotesk', sans-serif;

    font-size: clamp(1.25rem, 3vw, 2rem);

    font-weight: 600;

    flex-shrink: 0;

}



/* Badge "Nouveau" pour bulletin récent */

.bulletin-new-badge {

    background: var(--rouge-500);

    color: white;

    font-size: clamp(0.7rem, 1.2vw, 0.9rem);

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.05em;

    padding: 0.35rem 0.75rem;

    border-radius: 100px;

    animation: pulse-badge 2s infinite;

    box-shadow: 0 0 20px rgba(255, 35, 35, 0.5);

}



@keyframes pulse-badge {

    0%,
    100% {

        transform: scale(1);

        box-shadow: 0 0 20px rgba(255, 35, 35, 0.5);

    }

    50% {

        transform: scale(1.05);

        box-shadow: 0 0 30px rgba(255, 35, 35, 0.7);

    }

}



.bulletin-date {

    font-size: clamp(0.8rem, 1.5vw, 1rem);

    color: var(--primary-200);

    opacity: 0.7;

    margin-left: auto;

    flex-shrink: 0;

}



.bulletin-scroll-container {

    flex: 1;

    overflow: hidden;

    position: relative;

    width: 100%;

    max-width: 1200px;

    margin: 0 auto;

}



.bulletin-text {

    font-size: clamp(1.8rem, 4vw, 3rem);

    line-height: 1.7;

    color: var(--primary-100);

    animation: scrollText var(--scroll-duration, 30s) linear infinite;

    animation-play-state: paused;
    /* Pause par défaut */

    padding: 1rem 0;

}



.bulletin-text p {

    margin-bottom: 1em;

}



.bulletin-text p:last-child {

    margin-bottom: 0;

}



/* Lancer l'animation seulement quand le slide est actif */

.slide.active .bulletin-text {

    animation-play-state: running;

}



@keyframes scrollText {

    0%,
    10% {
        transform: translateY(0);
    }

    90%,
    100% {
        transform: translateY(calc(-100% + 200px));
    }

}



/* ===== PAGE INFO (Plus d'information) ===== */

.info-section {

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;

    gap: clamp(1.5rem, 4vw, 3rem);

    flex: 1;

}



.info-title {

    font-family: 'Space Grotesk', sans-serif;

    font-size: clamp(1.5rem, 4vw, 2.5rem);

    font-weight: 500;

    color: var(--primary-200);

}



.info-logo {

    max-width: 400px;

    width: 80%;

}



.info-logo img {

    width: 100%;

    height: auto;

    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.2));

}



.info-url {

    font-family: 'Space Grotesk', sans-serif;

    font-size: clamp(1.5rem, 4vw, 3rem);

    font-weight: 700;

    color: var(--bleu-500);

    text-decoration: none;

    letter-spacing: 0.02em;

}



.info-url:hover {

    text-decoration: underline;

}



.info-qr {

    background: white;

    padding: clamp(0.75rem, 2vw, 1.5rem);

    border-radius: 1rem;

    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);

}



.info-qr img {

    width: clamp(150px, 25vw, 250px);

    height: clamp(150px, 25vw, 250px);

    display: block;

}



/* ===== PAGE PRÉVISIONS ===== */

.forecast-section {

    display: flex;

    flex-direction: column;

    gap: 1rem;

    flex: 1;

    min-height: 0;

}



.forecast-title {

    font-family: 'Space Grotesk', sans-serif;

    font-size: clamp(1.5rem, 4vw, 2.5rem);

    font-weight: 600;

    display: flex;

    align-items: center;

    gap: 0.75rem;

    flex-shrink: 0;

}



.forecast-title svg {

    width: clamp(28px, 5vw, 40px);

    height: clamp(28px, 5vw, 40px);

    fill: var(--bleu-500);

}



.forecast-disclaimer {

    font-size: clamp(0.85rem, 1.5vw, 1.1rem);

    color: var(--primary-200);

    opacity: 0.8;

    flex-shrink: 0;

}



.forecast-chart-container {

    flex: 1;

    min-height: 0;

    background: rgba(255, 255, 255, 0.03);

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 1rem;

    padding: 1rem;

    position: relative;

}



.forecast-chart-container canvas {

    width: 100% !important;

    height: 100% !important;

}



/* ===== UPSTREAM STATIONS (Page 3+) - MODIFIÉ ===== */

.upstream-title {

    font-family: 'Space Grotesk', sans-serif;

    font-size: clamp(1.5rem, 4vw, 2.5rem);

    font-weight: 600;

    margin-bottom: 1rem;

    display: flex;

    align-items: center;

    gap: 0.75rem;

    flex-shrink: 0;

}



.upstream-title svg {

    width: clamp(28px, 5vw, 40px);

    height: clamp(28px, 5vw, 40px);

    fill: var(--bleu-500);

}



.upstream-content {

    flex: 1;

    overflow-y: auto;

    padding-right: 0.5rem;

}



.river-section {

    margin-bottom: 1.5rem;

}



.river-header {

    font-size: clamp(1.1rem, 2.5vw, 1.75rem);
    /* MODIFIÉ : était clamp(1rem, 2vw, 1.5rem) */

    font-weight: 600;

    color: var(--bleu-500);

    margin-bottom: 1rem;
    /* MODIFIÉ : était 0.75rem */

    padding-left: 0.75rem;

    border-left: 4px solid var(--bleu-500);

}



.stations-grid {

    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* Jusqu'à 4 colonnes */

    gap: 1.25rem;

    max-width: 100%;

}



/* Sur grands écrans, forcer max 4 colonnes */

@media (min-width: 1200px) {

    .stations-grid {

        grid-template-columns: repeat(4, 1fr);

    }

}



.station-card {

    background: rgba(255, 255, 255, 0.05);

    border: 1px solid rgba(255, 255, 255, 0.1);

    border-radius: 1rem;

    padding: 1.25rem;

    display: flex;

    flex-direction: column;

    gap: 1rem;

    position: relative;

    overflow: hidden;

}



.station-card::before {

    content: '';

    position: absolute;

    top: 0;

    left: 0;

    width: 5px;

    height: 100%;

}



.station-card.vert::before {
    background: var(--vert-500);
}

.station-card.jaune::before {
    background: var(--jaune-500);
}

.station-card.orange::before {
    background: var(--orange-500);
}

.station-card.rouge::before {
    background: var(--rouge-500);
}



.station-card-header {

    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    gap: 0.5rem;

}



.station-card-name {

    font-family: 'Space Grotesk', sans-serif;

    font-size: clamp(1.15rem, 2.5vw, 1.5rem);
    /* MODIFIÉ : était clamp(1rem, 2vw, 1.35rem) */

    font-weight: 600;

}



.station-card-distance {

    font-size: 0.9rem;

    color: var(--primary-200);

    background: rgba(255, 255, 255, 0.1);

    padding: 0.25rem 0.75rem;

    border-radius: 100px;

    flex-shrink: 0;

}



/* Heure de mesure dans le header (remplace distance) */

.station-card-time {

    font-family: 'Space Grotesk', sans-serif;

    font-size: 1.1rem;

    font-weight: 600;

    color: white;

    background: rgba(255, 255, 255, 0.1);

    padding: 0.25rem 0.75rem;

    border-radius: 100px;

    flex-shrink: 0;

}



.station-card-metrics {

    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 0.75rem;
    /* MODIFIÉ : était 0.5rem */

}



.station-card-metric {

    display: flex;

    flex-direction: column;

    gap: 0.15rem;
    /* MODIFIÉ : était 0.1rem */

}



.station-card-metric-label {

    font-size: 0.75rem;
    /* MODIFIÉ : était 0.7rem */

    color: var(--primary-200);

    text-transform: uppercase;

}



.station-card-metric-value {

    font-family: 'Space Grotesk', sans-serif;

    font-size: 1rem;

    font-weight: 600;

    white-space: nowrap;
    /* Empêche le retour à la ligne */

}



.station-card-footer {

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding-top: 0.75rem;
    /* MODIFIÉ : était 0.5rem */

    border-top: 1px solid rgba(255, 255, 255, 0.1);

}



.station-card-meteo {

    display: flex;

    align-items: center;

    gap: 0.5rem;
    /* MODIFIÉ : était 0.4rem */

    font-size: 0.9rem;
    /* MODIFIÉ : était 0.85rem */

    color: var(--primary-200);

}

.station-card-meteo svg {

    width: 30px;
    /* MODIFIÉ : était 18px */

    height: 30px;

    fill: currentColor;

}

.vigilance-mini {

    font-size: 0.75rem;
    /* MODIFIÉ : était 0.7rem */

    font-weight: 600;

    text-transform: uppercase;

    padding: 0.25rem 0.75rem;
    /* MODIFIÉ : était 0.2rem 0.6rem */

    border-radius: 100px;

}


.vigilance-mini.vert {
    background: var(--vert-500);
    color: var(--vert-700);
}

.vigilance-mini.jaune {
    background: var(--jaune-500);
    color: var(--jaune-700);
}

.vigilance-mini.orange {
    background: var(--orange-500);
    color: white;
}

.vigilance-mini.rouge {
    background: var(--rouge-500);
    color: white;
}



/* ===== TREND COLORS (désactivé sur stations amont) ===== */

/*

.trend-up { color: var(--orange-400); }

.trend-down { color: var(--bleu-500); }

.trend-stable { color: var(--vert-400); }

*/



/* ===== NAVIGATION ===== */

.nav-dots {

    position: fixed;

    bottom: 1rem;

    left: 50%;

    transform: translateX(-50%);

    display: flex;

    gap: 0.6rem;

    z-index: 100;

}



.nav-dot {

    width: 10px;

    height: 10px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.3);

    cursor: pointer;

    transition: all 0.3s;

}



.nav-dot.active {

    background: white;

    transform: scale(1.4);

}



.progress-bar {

    position: fixed;

    top: 0;

    left: 0;

    height: 4px;

    background: var(--bleu-500);

    z-index: 100;

    transition: width 0.1s linear;

    width: 0;

}



/* ===== FOOTER ===== */

.footer {

    display: flex;

    justify-content: space-between;

    align-items: center;

    padding-top: 0.75rem;

    border-top: 1px solid rgba(255, 255, 255, 0.1);

    flex-shrink: 0;

    gap: 1rem;

}



.footer-logo {

    display: flex;

    align-items: center;

    gap: 0.5rem;

}



.footer-logo img {

    height: clamp(24px, 4vw, 40px);

    width: auto;

}



.footer-logo-text {

    font-family: 'Space Grotesk', sans-serif;

    font-size: 1.1rem;

    font-weight: 700;

    color: var(--primary-200);

}



.footer-info {

    font-size: 0.8rem;

    color: var(--primary-200);

    opacity: 0.7;

    text-align: right;

}



/* ===== ANIMATIONS ===== */

@keyframes fadeInUp {

    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }

}



.slide.active .metric-card,

.slide.active .bulletin-section,

.slide.active .station-card,

.slide.active .hero-section {

    animation: fadeInUp 0.6s ease-out forwards;

}



/* ===== SWIPE HINT (Mobile) ===== */

.swipe-hint {

    position: fixed;

    bottom: 2.5rem;

    left: 50%;

    transform: translateX(-50%);

    font-size: 0.75rem;

    color: var(--primary-200);

    opacity: 0.5;

    display: none;

}



@media (pointer: coarse) {

    .swipe-hint {

        display: block;

    }

}



/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {

    .slide {

        padding: 1rem;

    }



    .header {

        flex-direction: column;

        gap: 0.75rem;

    }



    .datetime-box {

        flex-direction: row;

        align-items: center;

        justify-content: space-between;

        width: 100%;

    }



    .metrics-row {

        grid-template-columns: repeat(2, 1fr);

        gap: 0.75rem;

    }



    .metrics-row-3 {

        grid-template-columns: repeat(3, 1fr);

    }



    .hero-level {

        font-size: clamp(3rem, 20vw, 8rem);

    }



    .hero-trend-text {

        font-size: clamp(1.5rem, 10vw, 3rem);

    }



    .bulletin-text {

        font-size: clamp(1.2rem, 5vw, 1.8rem);
        /* MODIFIÉ pour mobile */

    }



    .bulletin-header {

        flex-wrap: wrap;

        gap: 0.5rem;

    }



    .bulletin-date {

        margin-left: 0;

        width: 100%;

    }



    .stations-grid {

        grid-template-columns: 1fr;
        /* 1 seule colonne sur mobile */

    }



    .station-card {

        padding: 1rem;

    }



    .station-card-metric-value {

        font-size: 0.95rem;

    }



    .footer {

        flex-direction: column;

        gap: 0.5rem;

        text-align: center;

    }



    .footer-info {

        text-align: center;

    }

}



@media (max-width: 480px) {

    .metric-card {

        padding: 0.75rem;

    }



    .station-card-metrics {

        gap: 0.5rem;

    }

}



/* ===== LARGE SCREENS (TV/Moniteurs) ===== */

@media (min-width: 1400px) {

    .stations-grid {

        grid-template-columns: repeat(4, 1fr);
        /* 4 colonnes max */

        gap: 1.5rem;

    }



    .station-card {

        padding: 1.5rem;

    }



    .station-card-name {

        font-size: 1.4rem;

    }



    .station-card-metric-value {

        font-size: 1.2rem;

    }

}
