/* Deelmobiliteitskaart: gedeelde stijl van alle pagina's (kaart, Buiten hubs geparkeerd, Cijfers).
   Wat alleen bij een pagina hoort, staat in index.css, parkeren.css of statistieken.css. */

/* Lettertype Roboto, op de eigen server (geen verbinding met Google nodig). */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 300; font-display: swap; src: url(fonts/roboto-300.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/roboto-400.woff2) format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/roboto-500.woff2) format("woff2"); }

/* Material Design 3. Primaire kleur is het rood uit het logo van de gemeente Groningen. */
:root {
  --primary: #d82838;
  --on-primary: #ffffff;
  --secondary-container: #dfe9f2;
  --on-secondary-container: #0f1b26;
  --surface: #f4f7fa;
  --sc-low: #ffffff;
  --sc: #eef2f6;
  --sc-high: #ffffff;
  --on-surface: #14202b;
  --on-surface-var: #4a5a68;
  --outline: #7b8a97;
  --outline-var: #d6dee5;
  --error: #ba1a1a;
  --off: #8a8a8a;
  --me: #1d6fe0;
  --scrim: rgba(0, 0, 0, .32);
  --glass: rgba(255, 255, 255, .66);
  --glass-hi: rgba(255, 255, 255, .82);
  --glass-line: rgba(255, 255, 255, .7);
  --blur: blur(22px) saturate(1.7);
  --e1: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px 1px rgba(0,0,0,.15);
  --e2: 0 1px 2px rgba(0,0,0,.3), 0 2px 6px 2px rgba(0,0,0,.15);
  --e3: 0 1px 3px rgba(0,0,0,.3), 0 4px 8px 3px rgba(0,0,0,.15);
  --ease: cubic-bezier(.2, 0, 0, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #ff8c96; --on-primary: #5c0011; --secondary-container: #2a3947; --on-secondary-container: #d9e6f2;
    --surface: #0f1419; --sc-low: #161c22; --sc: #1b222a; --sc-high: #222a33;
    --on-surface: #e3e9ee; --on-surface-var: #b4c0cb; --outline: #80909e; --outline-var: #34404b;
    --error: #ffb4ab; --off: #6f6f6f; --me: #6aa8ff; --scrim: rgba(0, 0, 0, .6);
    --glass: rgba(24, 31, 38, .62); --glass-hi: rgba(28, 36, 44, .8); --glass-line: rgba(255, 255, 255, .14);
    color-scheme: dark;
  }
}
/* Zelf gekozen donkere modus (knop in Filters en info) */
:root[data-theme="dark"] {
    --primary: #ff8c96; --on-primary: #5c0011; --secondary-container: #2a3947; --on-secondary-container: #d9e6f2;
    --surface: #0f1419; --sc-low: #161c22; --sc: #1b222a; --sc-high: #222a33;
    --on-surface: #e3e9ee; --on-surface-var: #b4c0cb; --outline: #80909e; --outline-var: #34404b;
    --error: #ffb4ab; --off: #6f6f6f; --me: #6aa8ff; --scrim: rgba(0, 0, 0, .6);
    --glass: rgba(24, 31, 38, .62); --glass-hi: rgba(28, 36, 44, .8); --glass-line: rgba(255, 255, 255, .14);
    color-scheme: dark;
}
* { box-sizing: border-box; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: var(--sc-high); --glass-hi: var(--sc-high); }
  :root:not([data-theme="light"]) { --glass: var(--sc-high); --glass-hi: var(--sc-high); }
}

/* Iconen als lijntekening */
.stroke-icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Kaart (index.html en parkeren.html) */
.leaflet-container { font-family: inherit; background: #e6eaee; }
/* Zwart-witte basemap, zodat de kleuren van de aanbieders opvallen */
.leaflet-tile-pane { filter: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .leaflet-container { background: #171c21; }
  :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) brightness(.85) contrast(.9); }
}
:root[data-theme="dark"] .leaflet-container { background: #171c21; }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) brightness(.85) contrast(.9); }
#map.aerial .leaflet-tile-pane,
:root:not([data-theme="light"]) #map.aerial .leaflet-tile-pane { filter: none; }
.basemap-btn {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 12px;
  background: var(--glass-hi); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line); color: var(--on-surface); box-shadow: var(--e2); cursor: pointer; padding: 0;
}
.basemap-btn:hover { background: color-mix(in srgb, var(--on-surface) 10%, var(--glass-hi)); }
.basemap-btn[aria-pressed="true"] { background: var(--secondary-container); color: var(--on-secondary-container); }
.basemap-btn svg { width: 24px; height: 24px; }
.leaflet-popup-content-wrapper {
  border-radius: 16px; box-shadow: var(--e3); color: var(--on-surface); background: var(--glass-hi);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-line);
}
.leaflet-popup-tip { background: var(--glass-hi); }
/* Sluitknop van popups: op telefoon en desktop even groot (tikvlak van 40 px, kruisje van 28 px). */
.leaflet-container a.leaflet-popup-close-button {
  top: 4px; right: 4px; width: 40px; height: 40px; border-radius: 50%; font: 28px/40px Roboto, sans-serif; text-align: center; padding: 0;
  color: var(--on-surface-var);
}
.leaflet-container a.leaflet-popup-close-button:hover, .leaflet-container a.leaflet-popup-close-button:active { background: color-mix(in srgb, var(--on-surface) 12%, transparent); }
.leaflet-popup-content-wrapper .pop-title { padding-right: 30px; }
.leaflet-popup-content { font-family: inherit; font-size: 14px; line-height: 20px; margin: 12px 16px; }
/* Zoomknoppen. Ook met ".leaflet-touch" ervoor: Leaflet haalt op apparaten met een touchscreen anders de schaduw weg. */
.leaflet-bar, .leaflet-touch .leaflet-bar {
  border: 1px solid var(--glass-line); border-radius: 12px; box-shadow: var(--e2); overflow: hidden;
  background: var(--glass-hi); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.leaflet-bar a, .leaflet-bar a:hover { background: transparent; color: var(--on-surface); border-bottom-color: var(--outline-var); }
.leaflet-bar a:hover { background: color-mix(in srgb, var(--on-surface) 8%, transparent); }
.leaflet-control-attribution {
  background: transparent !important; color: var(--on-surface-var); font-size: 10px; line-height: 14px; padding: 0 6px;
  text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface);
}
.leaflet-control-attribution a { color: inherit; }
.leaflet-bar a, .leaflet-touch .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; font-size: 20px; }

/* Adres zoeken (PDOK Locatieserver) */
.addr { position: fixed; z-index: 1250; display: flex; flex-direction: column; font-family: inherit; }
.addr-box {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 4px 0 12px; border-radius: 12px;
  background: var(--glass-hi); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line); box-shadow: var(--e2); color: var(--on-surface);
}
.addr-box > svg { flex: none; width: 20px; height: 20px; color: var(--on-surface-var); }
.addr-box input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: inherit;
  font: 400 15px/20px Roboto, "Helvetica Neue", Arial, sans-serif; letter-spacing: .01em;
}
.addr-box input::-webkit-search-cancel-button, .addr-box input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.addr-box input::placeholder { color: var(--on-surface-var); }
.addr-x {
  flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--on-surface-var); cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.addr-x:hover { background: color-mix(in srgb, var(--on-surface) 10%, transparent); }
.addr-x svg { width: 20px; height: 20px; fill: currentColor; }
.addr-list {
  list-style: none; margin: 8px 0 0; padding: 6px; border-radius: 12px; max-height: min(320px, 50dvh); overflow: auto;
  background: var(--glass-hi); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--glass-line); box-shadow: var(--e2); scrollbar-width: none;
}
.addr-list::-webkit-scrollbar { display: none; }
.addr-list li {
  display: flex; flex-direction: column; gap: 0; padding: 9px 12px; border-radius: 8px; cursor: pointer;
  color: var(--on-surface); font-size: 14px; line-height: 20px;
}
.addr-list li small { color: var(--on-surface-var); font-size: 12px; line-height: 16px; }
.addr-list li:hover, .addr-list li[aria-selected="true"] { background: color-mix(in srgb, var(--on-surface) 9%, transparent); }
.addr-list li.msg { cursor: default; color: var(--on-surface-var); }
.addr-list li.msg:hover { background: none; }
.addr-pin { position: relative; width: 30px; height: 40px; }
.addr-pin::before {
  content: ""; position: absolute; box-sizing: border-box; left: 3px; top: 0; width: 24px; height: 24px; background: var(--primary);
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 1px 4px rgba(0,0,0,.4); border: 2px solid #fff;
}
.addr-pin::after { content: ""; position: absolute; left: 11px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: #fff; }


/* Indeling van beide kaarten op een computer: alles 16 px van de rand en 16 px uit elkaar.
   Paneel links (360 px breed), zoomknoppen direct rechts daarvan, zoekveld daarnaast, overige knoppen rechtsboven.
   Bovenkant van paneel, zoomknoppen, zoekveld en knoppen rechts liggen op één lijn. */
.addr { top: 16px; left: 452px; width: 340px; }
@media (min-width: 840px) {
  .leaflet-top { top: 4px; }
  .leaflet-top .leaflet-control { margin-top: 12px; }
  .leaflet-left { margin-left: 376px; }
  .leaflet-left .leaflet-control { margin-left: 16px; }
  .leaflet-right .leaflet-control { margin-right: 16px; }
}

/* Op een telefoon staat het zoekveld als balk bovenin, even groot en op dezelfde plek als de kopbalk
   van de hoofdkaart. De knoppen beginnen op beide kaarten direct daaronder. */
.search-btn { display: none; }
@media (max-width: 839px) {
  .search-btn { display: flex; }
  .addr { display: none; z-index: 1300; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top, 0px)); width: auto; max-width: 380px; margin: 0 auto; }
  body.addr-open .addr { display: flex; }
  .addr-box, .addr-list { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
  /* Knoppen op 12 px van de rand, net als de balken boven- en onderin */
  .leaflet-left .leaflet-control { margin-left: 12px; }
  .leaflet-right .leaflet-control { margin-right: 12px; }
  .addr-box { height: 56px; border-radius: 28px; padding: 0 8px 0 18px; box-shadow: var(--e3); }
  .addr-list { border-radius: 20px; }
  .leaflet-top { margin-top: calc(76px + env(safe-area-inset-top, 0px)); }
  /* Popup open: knoppen bovenin even weg, zodat de popup er niet achter valt */
  /* visibility in plaats van alleen pointer-events: de knoppen zelf hebben in Leaflet pointer-events: auto en bleven anders tikbaar */
  .leaflet-top { transition: opacity .15s, visibility 0s; }
  .popup-open .leaflet-top { opacity: 0; visibility: hidden; transition: opacity .15s, visibility 0s .15s; }
  .popup-open .leaflet-top .leaflet-control { pointer-events: none; }
}
