/* =====================================================================
   Balaton WindPRO térkép (wind_map.php) – teljes képernyős felület
   A színek és betűk az rs-theme.css tokenjeiből jönnek.
   ===================================================================== */

html, body.wm-body { height: 100%; margin: 0; overflow: hidden; background: var(--rs-bg); }

.wm-app { position: fixed; inset: 0; color: var(--rs-text); }
.wm-map { position: absolute; inset: 0; }
#windParticles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }

/* ---------------- Felső sáv ---------------- */
.wm-top {
    position: absolute; top: 0; left: 0; right: 0; z-index: 5;
    display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
    padding: 0.7rem 1rem;
    padding-top: max(0.7rem, env(safe-area-inset-top));
    background: linear-gradient(to bottom, rgba(10, 17, 29, 0.92) 0%, rgba(10, 17, 29, 0.55) 70%, rgba(10, 17, 29, 0) 100%);
}
.wm-back {
    width: 38px; height: 38px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; border: 1px solid var(--rs-border-strong);
    background: rgba(255, 255, 255, 0.05); color: var(--rs-text); text-decoration: none;
}
.wm-back:hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); }
.wm-brand {
    font-family: var(--rs-font-brand); font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
    font-size: 0.9rem; color: #ffffff; text-decoration: none; white-space: nowrap;
}
.wm-brand span { color: var(--rs-accent); }
.wm-brand:hover { color: #ffffff; }

.wm-layers {
    display: flex; gap: 2px; padding: 3px; border-radius: 999px;
    background: rgba(10, 17, 29, 0.85); border: 1px solid var(--rs-border-strong);
}
.wm-layer-btn {
    border: 0; background: none; color: var(--rs-text-2);
    font-size: 0.82rem; font-weight: 600; padding: 0.32rem 0.8rem; border-radius: 999px; white-space: nowrap;
}
.wm-layer-btn:hover { color: #ffffff; }
.wm-layer-btn.is-active { background: var(--rs-accent); color: #10192b; }

.wm-tools { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }
.wm-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    height: 34px; padding: 0 0.8rem; border-radius: 999px;
    border: 1px solid var(--rs-border-strong); background: rgba(10, 17, 29, 0.85);
    color: var(--rs-text-2); font-size: 0.82rem; font-weight: 600; white-space: nowrap;
}
.wm-btn:hover:not(:disabled) { color: #ffffff; border-color: rgba(255, 255, 255, 0.28); }
.wm-btn.is-on { color: #10192b; background: var(--rs-accent); border-color: var(--rs-accent); }
.wm-btn:disabled { opacity: 0.4; }

/* ---------------- Jelmagyarázat ---------------- */
.wm-legend {
    position: absolute; left: 1rem; bottom: 8.5rem; z-index: 4;
    width: 210px; padding: 0.6rem 0.75rem 0.5rem;
    border-radius: var(--rs-radius); background: rgba(10, 17, 29, 0.86);
    border: 1px solid var(--rs-border-strong);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.wm-legend[hidden] { display: none; }
.wm-legend-title { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rs-muted); margin-bottom: 0.35rem; }
.wm-legend-bar { height: 8px; border-radius: 999px; }
.wm-legend-scale { display: flex; justify-content: space-between; font-family: var(--rs-font-mono); font-size: 0.68rem; color: var(--rs-muted); margin-top: 0.25rem; }

/* ---------------- Idősáv ---------------- */
.wm-player {
    position: absolute; left: 50%; transform: translateX(-50%); bottom: 1.2rem; bottom: max(1.2rem, env(safe-area-inset-bottom));
    z-index: 5; width: min(640px, calc(100% - 2rem));
    padding: 0.7rem 1rem 0.55rem;
    border-radius: var(--rs-radius-lg); background: rgba(10, 17, 29, 0.9);
    border: 1px solid var(--rs-border-strong);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.wm-player[hidden] { display: none; }
.wm-player-row[hidden] { display: none; }
.wm-player-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; margin-bottom: 0.4rem; }
.wm-time { font-family: var(--rs-font-mono); font-size: 0.95rem; font-weight: 600; color: #ffffff; }
.wm-source { font-size: 0.78rem; color: var(--rs-muted); text-align: right; }
.wm-player-row { display: flex; align-items: center; gap: 0.75rem; }
.wm-play {
    width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%;
    background: var(--rs-accent); color: #10192b; font-size: 1.15rem;
    display: inline-flex; align-items: center; justify-content: center;
}
.wm-track { flex: 1 1 auto; min-width: 0; }
.wm-track input[type="range"] { width: 100%; accent-color: var(--rs-accent); }
.wm-ticks { position: relative; height: 14px; margin-top: 0.1rem; }
.wm-tick { position: absolute; top: 0; transform: translateX(-50%); font-size: 0.68rem; color: var(--rs-faint); white-space: nowrap; }
.wm-tick.is-strong { color: var(--rs-muted); }
.wm-watermark { margin-top: 0.5rem; padding-top: 0.4rem; border-top: 1px solid var(--rs-border); font-size: 0.65rem; line-height: 1.35; color: var(--rs-faint); text-align: center; }

/* ---------------- Felbukkanó adatok ---------------- */
.wm-popup .maplibregl-popup-content {
    background: var(--rs-surface-2); color: var(--rs-text);
    border: 1px solid var(--rs-border-strong); border-radius: var(--rs-radius);
    padding: 0.7rem 0.9rem; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}
.wm-popup .maplibregl-popup-tip { border-top-color: var(--rs-surface-2); border-bottom-color: var(--rs-surface-2); }
.wm-popup .maplibregl-popup-close-button { color: var(--rs-muted); font-size: 1.1rem; padding: 0 0.35rem; }
.wm-pop { text-align: center; min-width: 140px; }
.wm-pop-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.2rem; }
.wm-pop-main { font-family: var(--rs-font-mono); font-size: 1.05rem; color: #ffffff; }
.wm-pop-main strong { font-size: 1.35rem; }
.wm-pop-gust { font-size: 0.8rem; color: var(--rs-danger-text); margin-top: 0.2rem; }

/* ---------------- Betöltés, üzenet ---------------- */
.wm-loading {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 6;
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 1.1rem; border-radius: 999px;
    background: rgba(10, 17, 29, 0.9); border: 1px solid var(--rs-border-strong); color: var(--rs-text-2);
}
.wm-loading[hidden] { display: none; }
.wm-toast {
    position: absolute; left: 50%; transform: translateX(-50%); bottom: 9.5rem; z-index: 7;
    padding: 0.5rem 1rem; border-radius: 999px; max-width: 90vw; text-align: center;
    background: rgba(28, 42, 69, 0.96); border: 1px solid var(--rs-border-strong);
    font-size: 0.86rem; color: var(--rs-text);
}
.wm-toast[hidden] { display: none; }

/* ---------------- Fizetési fal ---------------- */
.wm-paywall {
    position: absolute; inset: 0; z-index: 10;
    display: flex; align-items: center; justify-content: center; padding: 1.25rem;
    background: rgba(10, 17, 29, 0.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.wm-paywall-card {
    width: 100%; max-width: 480px; padding: 2rem;
    border-radius: var(--rs-radius-lg); background: var(--rs-surface);
    border: 1px solid var(--rs-accent-line); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
    text-align: center;
}
.wm-paywall-list { list-style: none; margin: 1.25rem auto; padding: 0; max-width: 320px; text-align: left; }
.wm-paywall-list li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.92rem; color: var(--rs-text-2); margin-bottom: 0.5rem; }
.wm-paywall-list i { color: var(--rs-success); margin-top: 0.15rem; }

/* ---------------- Mobil ---------------- */
@media (max-width: 767.98px) {
    .wm-top { gap: 0.5rem; padding-left: 0.7rem; padding-right: 0.7rem; }
    .wm-brand { display: none; }
    .wm-layers { order: 3; width: 100%; justify-content: space-between; }
    .wm-layer-btn { flex: 1 1 0; padding: 0.32rem 0.4rem; text-align: center; }
    .wm-tools { gap: 0.3rem; }
    .wm-btn { height: 32px; padding: 0 0.6rem; font-size: 0.78rem; }
    .wm-btn .wm-btn-text { display: none; }
    /* Mobilon a jelmagyarázat egy sorba kerül: cím | színsáv a számokkal */
    .wm-legend {
        left: 0.7rem; right: 0.7rem; width: auto; bottom: 10.5rem;
        display: grid; grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas: "title bar" "title scale";
        column-gap: 0.7rem; padding: 0.45rem 0.7rem;
    }
    .wm-legend-title { grid-area: title; align-self: center; margin: 0; }
    .wm-legend-bar { grid-area: bar; align-self: end; }
    .wm-legend-scale { grid-area: scale; margin-top: 0.15rem; font-size: 0.62rem; }
    /* a térkép forrásfelirata (OpenFreeMap / OpenStreetMap) a sáv alatt maradjon látható */
    .wm-player { width: calc(100% - 1.4rem); padding: 0.6rem 0.8rem 0.5rem; bottom: max(1.9rem, env(safe-area-inset-bottom)); }
    /* a réteg leírása külön sorba kerül a szűk sávban */
    .wm-player-head { flex-wrap: wrap; gap: 0.1rem 0.5rem; margin-bottom: 0.3rem; }
    .wm-source { width: 100%; text-align: left; font-size: 0.7rem; }
    .wm-toast { bottom: 12.2rem; }
}
