/* ==========================================================================
   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 {
    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: Circular, Arial, sans-serif;
    font-size: 10.5px;
    color: #4a5a64;
    line-height: 1;
    white-space: nowrap;
}

/* ---- Adreszoeker (desktop: linksboven, de vrije hoek) -------------------
   Staat buiten `weerlab-map-wrap`, dus de map-freeze raakt het veld niet.
   Zichtbaarheid loopt via de `hidden` class uit pin_state.js. */
.weerlab-address-search {
    position: fixed;
    left: 16px;
    top: calc(var(--nav-h) + 16px);
    z-index: 845;
    width: 320px;
    max-width: calc(100vw - 32px);
    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: 10px 13px 12px;
    font-family: Circular, Arial, sans-serif;
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
                opacity 0.25s ease;
}

.weerlab-address-search.hidden {
    transform: translateY(-16px);
    opacity: 0;
    pointer-events: none;
}

/* ---- Zoekveld + suggestielijst -------------------------------------------
   Als de bedrijvenkaart in omgevingsmonitor: wit met een duidelijke schaduw.
   Dat leest beter over een drukke kaart dan glas op glas. */
/* Eén opmaak voor alle kopjes boven een bediening: tijdslider, viewerkeuze,
   adreszoeker en legenda-eenheid. Geen text-transform: de legenda zet hier
   "m/s" neer, en "M/S" is geen eenheid. */
.weerlab-label {
    font-family: Circular, Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #00577d;
    line-height: 1.3;
}

.weerlab-address-search .weerlab-label {
    margin-bottom: 4px;
}

/* Op id: Dash 4 laat de className van een `dcc.Input` vallen. */
#address-search-input {
    width: 100%;
    box-sizing: border-box;
    height: 36px;
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 14px;
    color: #212529;
    outline: none;
}

#address-search-input:focus {
    border-color: #00827d;
}

.weerlab-address-search__msg:not(:empty) {
    display: block;
    margin-top: 5px;
    font-size: 11.5px;
    color: #91004b;
}

.weerlab-sug-dropdown {
    position: absolute;
    top: 42px;
    left: 0;
    z-index: 870;
    width: 100%;
    min-width: 260px;
    max-height: 320px;
    overflow-y: auto;
    /* Zonder dit scrollt de kaart mee zodra de lijst aan zijn eind is. */
    overscroll-behavior: contain;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 40, 60, 0.18);
    padding: 4px;
    animation: weerlabDropIn 0.15s ease;
    scrollbar-width: thin;
    scrollbar-color: #d8d8d8 transparent;
}

@keyframes weerlabDropIn {
    from { transform: translateY(-4px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.weerlab-sug-dropdown::-webkit-scrollbar { width: 8px; }
.weerlab-sug-dropdown::-webkit-scrollbar-thumb {
    background: #d8d8d8;
    border-radius: 4px;
}

.weerlab-sug {
    padding: 7px 10px;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1.3;
}

.weerlab-sug:hover { background: #eef3f5; }

.weerlab-sug__naam {
    font-size: 13.5px;
    color: #212529;
}

.weerlab-sug__sub {
    font-size: 11.5px;
    color: #68767f;
}

/* Sectiekop boven de bedrijven en boven de adressen. */
.weerlab-sug__kop {
    padding: 6px 10px 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8a979f;
}

.weerlab-sug__melding {
    padding: 8px 10px;
    font-size: 12.5px;
    color: #212529;
    line-height: 1.4;
}

/* Laadregel: verborgen tot de clientside callback de open-class zet. */
#address-sug-loading {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 12.5px;
    color: #68767f;
}

#address-sug-loading.weerlab-sug-dropdown--open { display: flex; }

.weerlab-spinner {
    flex: none;
    width: 14px;
    height: 14px;
    border: 2px solid #d5e0e5;
    border-top-color: #00577d;
    border-radius: 50%;
    animation: weerlabSpin 0.7s linear infinite;
}

@keyframes weerlabSpin { to { transform: rotate(360deg); } }

/* ---- Locaties op dit adres, in de bevestigstap -------------------------- */
.weerlab-address-confirm__match {
    font-size: 11.5px;
    line-height: 1.4;
    color: #00577d;
}

.weerlab-locaties {
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* Zes regels, daarna scrollen: op Wenckebachstraat 1 staan 25 locaties. */
    max-height: 150px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #d8d8d8 transparent;
}

.weerlab-locaties::-webkit-scrollbar { width: 8px; }
.weerlab-locaties::-webkit-scrollbar-thumb {
    background: #d8d8d8;
    border-radius: 4px;
}

.weerlab-locatie {
    text-align: left;
    border: 0;
    background: transparent;
    padding: 4px 6px;
    border-radius: 4px;
    font: inherit;
    font-size: 11.5px;
    line-height: 1.3;
    color: #212529;
    cursor: pointer;
}

.weerlab-locatie:hover { background: #eef3f5; }

.weerlab-locatie.is-actief {
    background: rgba(0, 130, 125, 0.12);
    color: #00577d;
    font-weight: 700;
}

.weerlab-address-search__hint {
    margin-top: 6px;
    font-size: 10.5px;
    line-height: 1.35;
    color: rgba(0, 87, 125, 0.60);
}

/* Alleen zichtbaar in de `confirm` state; pin_state.js zet die class. */
.weerlab-address-confirm {
    display: none;
    flex-direction: column;
    gap: 7px;
    margin-top: 9px;
}

.weerlab-address-search.is-confirming .weerlab-address-confirm {
    display: flex;
}

.weerlab-address-search.is-confirming .weerlab-address-search__hint {
    display: none;
}

.weerlab-address-confirm__text {
    font-size: 11px;
    font-weight: 700;
    color: #00577d;
}

/* ---- 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: Circular, Arial, sans-serif;
    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: Circular, Arial, sans-serif;
    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: Circular, Arial, sans-serif;
    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;
}

/* Lat/lon display */
.weerlab-coords {
    font-family: Circular, Arial, sans-serif;
    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%;
    }
}
