/* ============================================================
   webcam.css  –  Section Webcam / Météo du lac
   À inclure dans _Layout.cshtml :
     <link rel="stylesheet" href="~/css/webcam.css" asp-append-version="true" />
   ============================================================ */

/* ---------- Conteneur de section ---------- */
.webcam-section {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
    border-radius: 12px;
    padding: 2rem 1.5rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px rgba(0, 80, 160, 0.08);
}

.webcam-section-title {
    text-align: center;
    font-size: 1.6rem;
    color: #1a4a7a;
    margin-bottom: 0.3rem;
}

.webcam-section-subtitle {
    text-align: center;
    color: #5a7a9a;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ---------- Grille à 2 caméras ---------- */
.webcam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

/* ---------- Carte caméra ---------- */
.webcam-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.webcam-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 80, 160, 0.15);
}

/* Étiquette de titre de caméra */
.webcam-label {
    background: #1a4a7a;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.45rem 1rem;
    letter-spacing: 0.03em;
}

.webcam-icon {
    margin-right: 0.3em;
}

/* ---------- Wrapper image + overlays ---------- */
.webcam-img-wrapper {
    position: relative;
    width: 100%;
    /* Ratio 4/3 par défaut – ajustable selon vos snapshots */
    aspect-ratio: 4 / 3;
    background: #0d2d4a;
    overflow: hidden;
}

.webcam-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.4s ease;
}

/* Pendant le chargement / rafraîchissement */
.webcam-img.loading {
    opacity: 0.5;
}

/* ---------- Overlay horodatage (bas de l'image) ---------- */
.webcam-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.4rem 0.7rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
    pointer-events: none;
}

.webcam-status {
    color: #fff;
    font-size: 0.78rem;
    font-family: 'Courier New', monospace;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

/* ---------- Indicateur de rafraîchissement (coin haut-droit) ---------- */
.webcam-refresh-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.6rem;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.webcam-refresh-indicator.spinning {
    opacity: 1;
    animation: webcam-spin 1s linear infinite;
}

@keyframes webcam-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ---------- Badge « Indisponible » ---------- */
.webcam-status.unavailable {
    color: #ffcf70;
}

/* ---------- Note de compte à rebours ---------- */
.webcam-note {
    text-align: center;
    margin-top: 1rem;
    color: #7a99b8;
    font-size: 0.82rem;
}

/* ---------- Responsive mobile ---------- */
@media (max-width: 600px) {
    .webcam-section {
        padding: 1.2rem 0.8rem;
    }
    .webcam-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .webcam-section-title {
        font-size: 1.3rem;
    }
}
