/* ══════════════════════════════════════════════════════════════════════
   radar.css — Mapa radaru opadów Pogodynka.eu
   Styl: minimalistyczny panel sterowania pod mapą Leaflet.
   Paletka i komponenty spójne z resztą serwisu.
══════════════════════════════════════════════════════════════════════ */

.radar-section { margin-bottom: 3rem; }

/* Karta-kontener całego radaru */
.radar-layout {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    border-radius: 20px;
    gap: 0;
}

/* ── Status bar ─────────────────────────────────────────────────── */
.radar-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: rgba(5, 18, 48, 0.05);
    border-bottom: 1px solid rgba(148, 163, 184, .14);
    flex-shrink: 0;
}
.radar-time-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .92rem;
    font-weight: 800;
    color: var(--text, #0f2340);
    font-variant-numeric: tabular-nums;
    letter-spacing: .02em;
}
.radar-status-right {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: var(--text-muted, #5d7186);
}

/* ── Mapa ───────────────────────────────────────────────────────── */
.radar-map-wrap { position: relative; flex-shrink: 0; }

#radar-map {
    height: 560px;
    width: 100%;
    background: #dfe6ee;
}

/* Legenda na mapie (overlay) */
.radar-map-legend {
    position: absolute;
    bottom: 28px;
    left: 12px;
    z-index: 500;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(148, 163, 184, .25);
    border-radius: 12px;
    padding: 9px 12px;
    min-width: 148px;
    box-shadow: 0 2px 8px rgba(15, 35, 80, .12);
}
.rml-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}
.rml-label {
    font-size: .73rem;
    font-weight: 700;
    color: #3b526a;
    width: 38px;
    flex-shrink: 0;
}
.rml-bar {
    flex: 1;
    height: 10px;
    border-radius: 4px;
}
.rain-bar { background: linear-gradient(to right, #cce8ff, #77bbff, #2277dd, #003399); }
.snow-bar { background: linear-gradient(to right, #ffe0f5, #ff99cc, #cc44aa, #880066); }
.rml-scale {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0;
    padding-left: 46px;
}
.rml-scale span { font-size: .65rem; color: #7a94ad; font-weight: 600; }

/* Loading overlay */
.radar-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(240, 245, 250, .82);
    backdrop-filter: blur(4px);
    z-index: 1000;
    font-size: .9rem;
    color: #4a607a;
    font-weight: 600;
    transition: opacity .25s;
}
.radar-loader.is-hidden {
    display: none;
}

/* ── Oś czasu / suwak ───────────────────────────────────────────── */
.radar-timeline {
    padding: 14px 18px 10px;
    background: rgba(5, 18, 48, .04);
    border-top: 1px solid rgba(148, 163, 184, .12);
    flex-shrink: 0;
}
.radar-timeline-labels {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.rtl-label {
    font-size: .72rem;
    font-weight: 700;
    color: var(--text-muted, #5d7186);
    white-space: nowrap;
    flex-shrink: 0;
}
.rtl-ticks {
    position: relative;
    flex: 1;
    height: 20px;
}
.rtl-tick {
    position: absolute;
    transform: translateX(-50%);
    font-size: .68rem;
    color: #5d7186;
    font-weight: 600;
    cursor: pointer;
    top: 0;
    white-space: nowrap;
}
.rtl-tick:hover { color: #1c6dd0; }
.rtl-tick.is-nowcast { color: #f97316; }
.rtl-now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1.5px;
    background: rgba(28, 109, 208, .4);
    transform: translateX(-50%);
    border-radius: 1px;
}

.radar-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.radar-step-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, .3);
    background: #fff;
    color: #274060;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .14s, border-color .14s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.radar-step-btn:hover { background: #eef4fb; border-color: #7ba0cc; }

.radar-slider {
    flex: 1;
    height: 6px;
    accent-color: #1c6dd0;
    cursor: pointer;
    border-radius: 999px;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(to right, #1c6dd0 var(--pct, 0%), #c8d6e8 var(--pct, 0%));
    outline: none;
}
.radar-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #1c6dd0; cursor: pointer; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(28,109,208,.35); }
.radar-slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #1c6dd0; cursor: pointer; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(28,109,208,.35); }

/* ── Panel kontrolny ────────────────────────────────────────────── */
.radar-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    padding: 12px 18px;
    background: rgba(5, 18, 48, .05);
    border-top: 1px solid rgba(148, 163, 184, .1);
}

.radar-section-label {
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-muted, #5d7186);
    margin-right: 4px;
    white-space: nowrap;
}

/* Przycisk Play/Pauza */
.radar-play-section {
    display: flex;
    align-items: center;
    gap: 10px;
}
.radar-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px 9px 16px;
    border-radius: 12px;
    background: #1c6dd0;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: .88rem;
    font-weight: 800;
    transition: background .14s, transform .1s;
    box-shadow: 0 2px 8px rgba(28, 109, 208, .3);
}
.radar-play-btn:hover { background: #1558b0; }
.radar-play-btn:active { transform: scale(.97); }
.radar-play-btn #radar-play-icon { font-size: .85rem; }

/* Chipsy (prędkość, warstwy) */
.radar-speed-group,
.radar-layer-section { display: flex; align-items: center; gap: 6px; }
.radar-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .3);
    background: #fff;
    color: #374151;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .14s, border-color .14s, color .14s;
    white-space: nowrap;
}
.radar-chip:hover { background: #eef4fb; border-color: #7ba0cc; }
.radar-chip.is-active,
.radar-chip[data-on="1"] { background: #1c6dd0; color: #fff; border-color: #1c6dd0; }
.rchip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Krycie */
.radar-opacity-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.radar-mini-slider {
    width: 90px;
    height: 5px;
    accent-color: #1c6dd0;
    cursor: pointer;
}
#radar-opacity-val {
    font-size: .78rem;
    font-weight: 700;
    color: var(--text-muted, #5d7186);
    min-width: 32px;
    text-align: right;
}

/* ── Responsywność ──────────────────────────────────────────────── */
@media (max-width: 900px) {
    #radar-map { height: 440px; }
    .radar-controls { gap: 10px; }
    .radar-opacity-section { margin-left: 0; }
}
@media (max-width: 600px) {
    #radar-map { height: 310px; }
    .radar-map-legend { display: none; }  /* zbyt ciasno na małym ekranie */
    .radar-timeline { padding: 12px 16px 10px; }
    .radar-timeline-labels {
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 10px;
    }
    .rtl-ticks { display: none; }
    .radar-controls { flex-direction: column; align-items: flex-start; gap: 10px; }
    .radar-play-section { flex-wrap: wrap; }
    .radar-mini-slider { width: 70px; }
}
@media (max-width: 380px) {
    #radar-map { height: 240px; }
}
