/* ==========================================================================
   WeerLab map-first layout
   ========================================================================== */

:root {
    --nav-h: 45px;
}

html,
body {
    height: 100%;
    overflow: hidden;
    margin: 0;
}

/* Map container over de volle breedte, direct onder de vaste navigation bar. */
.weerlab-map-wrap {
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    overflow: hidden;
}

.weerlab-map-wrap > div:not(.weerlab-map-legend),
.weerlab-map-wrap ._dash-loading-callback,
.weerlab-map-wrap ._dash-loading-callback > div:last-child {
    height: 100% !important;
}

/* Blokkeer map interactions zolang het timeseries panel open staat. */
.weerlab-map-wrap.frozen .js-plotly-plot {
    pointer-events: none;
}

/* Lock-laag over de kaart tijdens het kiezen van de windrichting en tijdens het
   laden van de grafieken. Standaard transparant en click-through; `.active` vangt
   alle pointer events op zodat er niet door de kaart heen gepind/gepand kan worden.
*/
.weerlab-map-scrim {
    position: absolute;
    inset: 0;
    z-index: 500;
    pointer-events: none;
    background: transparent;
}

.weerlab-map-scrim.active {
    pointer-events: auto;
    cursor: progress;
}

/* ---- control bar ----------------- */
.weerlab-control-bar {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    width: min(900px, calc(100% - 40px));
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 87, 125, 0.18);
    padding: 14px 20px;
    z-index: 850;
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
                opacity 0.25s ease;
}

.weerlab-control-bar.hidden {
    transform: translateX(-50%) translateY(140%);
    opacity: 0;
    pointer-events: none;
}

/* Dit vervangt de oude Plotly colorbar trace.  Deze HTML legend zweeft
   over de map in dezelfde glass style als de control bar. Desktop krijgt de grote
   versie. */
.weerlab-map-legend {
    --map-legend-bar-height: 240px;
    --map-legend-bar-width: 13px;
    position: absolute;
    right: 16px;
    top: 16px;
    bottom: auto;
    z-index: 840;               
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 87, 125, 0.18);
    padding: 13px 15px 14px;
    font-family: Circular, Arial, sans-serif;
    pointer-events: none;
}

.weerlab-map-legend__title {
    font-family: "JetBrains Mono", Menlo, monospace;
    font-size: 11px;
    font-weight: 700;
    color: #00577d;
    text-align: center;
    margin-bottom: 8px;
}

.weerlab-map-legend__body {
    display: flex;
    gap: 6px;
}

.weerlab-map-legend__bar {
    position: relative;
    width: var(--map-legend-bar-width);
    height: var(--map-legend-bar-height);
    border-radius: 7px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.weerlab-map-legend__labels {
    position: relative;
    width: 32px;
    height: var(--map-legend-bar-height);
}

.weerlab-map-legend__tick {
    position: absolute;
    left: 0;
    transform: translateY(50%);
    font-family: "JetBrains Mono", Menlo, monospace;
    font-size: 10.5px;
    color: #4a5a64;
    line-height: 1;
    white-space: nowrap;
}

/* ---- Info-hub knop + kaart (desktop: rechtsonder, telefoon: linksboven) ---- */
.weerlab-map-info-btn {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 855;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    box-shadow: 0 8px 32px rgba(0, 87, 125, 0.18);
    color: #00577d;
    font-family: "JetBrains Mono", Menlo, monospace;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, box-shadow 0.15s;
}

.weerlab-map-info-btn:hover,
.weerlab-map-info-btn.is-active {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 34px rgba(0, 87, 125, 0.26);
}

.weerlab-map-info-card {
    position: fixed;
    right: 16px;
    bottom: 60px;
    z-index: 865;
    width: 320px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - var(--nav-h) - 100px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 87, 125, 0.18);
    padding: 14px 16px 16px;
    font-family: Circular, Arial, sans-serif;
    /* Verborgen tot map_info.js .is-open zet. klapt op desktop omhoog uit. */
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.weerlab-map-info-card.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.weerlab-map-info__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.weerlab-map-info__title {
    font-family: "JetBrains Mono", Menlo, monospace;
    font-size: 12px;
    font-weight: 700;
    color: #00577d;
}

.weerlab-map-info__close {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #4a5a64;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weerlab-map-info__close:hover {
    background: rgba(0, 87, 125, 0.08);
    color: #00577d;
}

.weerlab-map-info__section {
    margin-top: 12px;
}

.weerlab-map-info__subtitle {
    font-size: 12px;
    font-weight: 700;
    color: #00827d;
    margin-bottom: 3px;
}

.weerlab-map-info__text {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: #4a5a64;
}

/* Credit-blok voor knmi en cartomaps */
.weerlab-map-info__credits {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 87, 125, 0.12);
}

.weerlab-map-info__sublabel {
    font-family: "JetBrains Mono", Menlo, monospace;
    font-size: 10px;
    font-weight: 700;
    color: #00827d;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 4px;
}

.weerlab-map-info__filename {
    margin: 0 0 5px;
    color: #8b959c;
    font-family: Circular, Arial, sans-serif;
    font-size: 9px;
    font-weight: 400;
    font-style: italic;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.weerlab-map-wrap .maplibregl-ctrl-attrib,
.weerlab-map-wrap .maplibregl-ctrl-bottom-right {
    display: none !important;
}

/* ---- Slide-in data panel ---------------------------------------- */
.weerlab-panel {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    bottom: 0;
    width: 70%;
    background: #fff;
    box-shadow: -16px 0 40px rgba(0, 87, 125, 0.18);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
    z-index: 950;
    display: flex;
    flex-direction: column;
}

.weerlab-panel.open {
    transform: translateX(0);
}

.weerlab-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #ececec;
    flex-shrink: 0;
}

.weerlab-panel-body {
    position: relative;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px 24px 28px;
    background: #f5f5f5;
}

/* Monospace lat/lon display */
.weerlab-coords {
    font-family: "JetBrains Mono", Menlo, Consolas, monospace;
    font-size: 13px;
}

/* Plot cards inside the panel */
.weerlab-plot-card {
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 4px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.weerlab-panel-loader {
    margin-top: clamp(180px, 32vh, 300px);
}

.weerlab-progress-overlay {
    display: none;
}

.weerlab-progress-overlay.visible {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 245, 245, 0.85);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Houd compass labels in hetzelfde app font. */
#compass-svg text {
    font-family: Circular, Arial, sans-serif;
}

.compass-overlay {
    position: fixed;
    top: calc(var(--nav-h) + 32px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-radius: 16px;
    padding: 24px 28px;
    z-index: 900;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 40px rgba(0, 87, 125, 0.20);
    min-width: 300px;
}

/* ---- Signaal-secties ---------------------------------------------------- */
.weerlab-chart-section {
    margin: 0;
}

.weerlab-chart-section__toggle {
    display: block;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: #00577d;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
    cursor: default;
}

.weerlab-chart-section + .weerlab-chart-section .weerlab-chart-section__toggle {
    padding-top: 8px;
}

.weerlab-chart-section__body {
    display: block;
}

.weerlab-chart-section__chevron {
    display: none;
}

/* Chip-legend voor de wind chart. Op desktop blijft de normale Plotly legend
   zichtbaar, responsive.css zet deze rij alleen op telefoon aan. */
.weerlab-chiplegend {
    display: none;
}

.weerlab-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #333;
}

.weerlab-chip__swatch {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}

/* Weercode-scrubber en stepper voor telefoon */
.wc-scrubber {
    display: none;
}

.weerlab-frame-stepper {
    display: none;
}

/* Mobile: laat het panel de volledige viewport width gebruiken. */
@media (max-width: 720px) {
    .weerlab-panel {
        width: 100%;
    }
}
