/**
 * meteo-radar.css — Page Radar précipitations + Qualité de l'air
 */

/* ------------------------------------------------------------------ */
/* Header                                                               */
/* ------------------------------------------------------------------ */
.radar-header {
    padding: 1.5rem 0 0.75rem;
}
.radar-header h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.3rem;
}
.radar-subtitle {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0;
}

/* ------------------------------------------------------------------ */
/* Carte radar                                                          */
/* ------------------------------------------------------------------ */
.radar-map-wrap {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
}

#radarMap {
    width: 100%;
    height: clamp(320px, 55vw, 600px);
    background: #1a1a2e;
    display: block;
}

/* Station marker */
.radar-station-marker {
    font-size: 1.6rem;
    line-height: 1;
    color: #ff3333;
    text-shadow: 0 0 6px rgba(255, 51, 51, 0.8);
    font-weight: 900;
    cursor: default;
}

/* ------------------------------------------------------------------ */
/* Contrôles                                                           */
/* ------------------------------------------------------------------ */
.radar-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 800;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    background: rgba(15, 20, 40, 0.88);
    backdrop-filter: blur(6px);
}

.radar-btn {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.radar-btn:hover { background: rgba(255, 255, 255, 0.18); }

.radar-timeline {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.radar-tl-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.radar-tl-progress {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    background: rgba(100, 200, 255, 0.7);
    border-radius: 3px;
    pointer-events: none;
    transition: width 0.15s;
}

.radar-tl-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #64c8ff;
    border: 2px solid #fff;
    pointer-events: none;
    transition: left 0.15s;
}

.radar-tl-label {
    flex-shrink: 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.8);
    min-width: 3rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ */
/* Légende                                                             */
/* ------------------------------------------------------------------ */
.radar-legend {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 800;
    background: rgba(15, 20, 40, 0.82);
    backdrop-filter: blur(4px);
    border-radius: 8px;
    padding: 0.4rem 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.85);
}

.radar-legend-title {
    font-weight: 600;
    margin-right: 0.25rem;
    white-space: nowrap;
}

.radar-legend-scale {
    display: flex;
    align-items: center;
    gap: 2px;
}

.rl-swatch {
    display: inline-block;
    width: 14px;
    height: 10px;
    border-radius: 2px;
}

.rl-val {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.7);
    margin-right: 2px;
}

/* ------------------------------------------------------------------ */
/* Grid infos (AQ + station)                                           */
/* ------------------------------------------------------------------ */
.radar-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    padding: 1rem 0 2rem;
}

@media (max-width: 640px) {
    .radar-info-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ */
/* Carte qualité de l'air (page radar)                                 */
/* ------------------------------------------------------------------ */
.aq-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 1.1rem 1.2rem;
}

.aq-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.8rem;
}
.aq-head__icon { font-size: 1.5rem; }
.aq-head__title { font-weight: 700; font-size: 0.95rem; color: #fff; }
.aq-head__src   { font-size: 0.72rem; color: rgba(255,255,255,0.45); margin-top: 1px; }
.aq-badge {
    margin-left: auto;
    flex-shrink: 0;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.aq-bar-wrap {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    margin-bottom: 0.55rem;
    overflow: hidden;
}
.aq-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s, background 0.5s;
    width: 0%;
}

.aq-label-text {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.7rem;
}

.aq-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    font-size: 0.78rem;
}
.aq-stat { text-align: center; }
.aq-stat span   { display: block; color: rgba(255,255,255,0.5); margin-bottom: 2px; font-size: 0.7rem; }
.aq-stat strong { font-weight: 600; color: #fff; }

/* ------------------------------------------------------------------ */
/* Carte info station                                                   */
/* ------------------------------------------------------------------ */
.radar-station-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 1.1rem 1.2rem;
}
.radar-station-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem;
}
.radar-station-card p {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.65);
    margin: 0 0 0.4rem;
    line-height: 1.5;
}
.radar-note {
    font-size: 0.75rem !important;
    color: rgba(255,255,255,0.45) !important;
}

/* ------------------------------------------------------------------ */
/* Carte AQ sur le dashboard (suffixe D)                               */
/* ------------------------------------------------------------------ */
.aq-card--dashboard {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1rem;
}
.aq-card--dashboard .aq-head__title { font-size: 0.9rem; }
.aq-card--dashboard .aq-stats { grid-template-columns: repeat(4,1fr); }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */
@media (max-width: 768px) {
    .radar-legend { display: none; }  /* trop petit sur mobile */
    .aq-stats { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
}

@media (max-width: 480px) {
    .radar-controls { gap: 0.35rem; padding: 0.4rem 0.5rem; }
    .radar-btn      { width: 1.75rem; height: 1.75rem; font-size: 0.8rem; }
}
