/*
 * Tuinzon — huisstijl overgenomen van MVGM Atlas (design-tokens 1:1),
 * inclusief het signature één-ronde-hoek-motief en teal-getinte schaduwen.
 * Layout: app-model — kaart + bediening passen altijd samen in beeld,
 * het rechterpaneel scrolt onafhankelijk.
 */
:root {
  --teal: #03506b;
  --teal-hover: #023d52;
  --blue: #0085b0;
  --orange: #f28a3d;
  --teal-muted: #315a62;
  --light-blue: #b2d6db;
  --ink: #394a4f;
  --heading: #1f3238;
  --muted: #667378;
  --g100: #e7ebec;
  --border: #cdd8e0;
  --border-subtle: #e7ebec;
  --surface: #ffffff;
  --surface-tint: #e6f0f3;
  --surface-subtle: #f4f6f7;
  --surface-canvas: #eef3f4;
  --danger: #c0392b;

  --grad-topbar: linear-gradient(120deg, #03506b, #0a6180);
  --grad-hero: linear-gradient(150deg, #03506b, #0a6180, #127a95);

  --font-heading: 'Roboto Slab', Georgia, serif;
  --font-body: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-data: 'Roboto Mono', ui-monospace, Menlo, monospace;

  --radius-lg: 8px;
  --radius-card: 14px;
  --radius-pill: 20px;
  --corner-tick: 10px 2px 2px 2px;
  --corner-chip: 8px 2px 2px 2px;

  --shadow-sm: 0 1px 2px rgba(3, 80, 107, 0.08), 0 1px 3px rgba(3, 80, 107, 0.06);
  --shadow-md: 0 8px 22px rgba(3, 80, 107, 0.13);

  --header-h: 58px;
  --panel-right-w: 384px;

  --motion-fast: 140ms;
  --motion-base: 200ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface-canvas);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
}

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: var(--grad-topbar);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  flex: none;
}
.merk { display: flex; align-items: center; gap: 10px; }
.merk-glyph {
  width: 34px; height: 34px;
  border-radius: var(--corner-tick);
  background: rgba(255, 255, 255, 0.14);
  display: grid; place-items: center;
  font-size: 18px;
}
.merk-naam {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.merk-sub {
  font-size: 12px;
  color: var(--light-blue);
  margin-top: 1px;
}

.zoek { position: relative; flex: 1; max-width: 480px; margin-left: auto; }
.zoek input {
  width: 100%;
  height: 36px;
  border: none;
  border-radius: var(--radius-lg);
  padding: 0 14px 0 36px;
  font: 14px var(--font-body);
  color: var(--heading);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%23667378' stroke-width='2.4'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") 12px center no-repeat;
}
.suggesties {
  position: absolute; top: 42px; left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  z-index: 30;
}
.suggesties button {
  display: block; width: 100%;
  padding: 9px 14px;
  border: none; background: none;
  font: 13px var(--font-body); color: var(--ink);
  text-align: left;
}
.suggesties button:hover { background: var(--surface-tint); }

/* ── Lege staat ─────────────────────────────────────────────────── */
.leeg {
  flex: 1;
  display: grid;
  place-items: center;
  background: var(--grad-hero);
  padding: 24px;
  overflow: auto;
}
.leeg-kaart {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
  max-width: 560px;
  padding: 38px 42px;
}
.leeg-kaart h1 {
  font-family: var(--font-heading);
  color: var(--heading);
  font-size: 29px;
  margin-bottom: 10px;
}
.leeg-kaart h1 .zonchip { color: var(--orange); }
.leeg-kaart p { font-size: 14px; line-height: 1.65; margin-bottom: 10px; }
.leeg-kaart .bron { font-size: 12px; color: var(--muted); margin-top: 16px; }

/* ── Werkblad: kaartkolom + scrollend paneel ────────────────────── */
.werkblad {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 16px;
  padding: 16px;
}
.kaartkolom {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
}

.kaartframe {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 10px 12px 12px;
}

/* Toolbar boven de kaart: weergave links, legenda rechts */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 2px 2px 10px;
}
.legenda { margin-left: auto; display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.legenda .chip { display: inline-flex; align-items: center; gap: 5px; }
.legenda .blok {
  width: 12px; height: 12px; border-radius: 3px; display: inline-block;
  border: 1px solid rgba(31, 50, 56, 0.15);
}
.legenda .grad {
  width: 64px; height: 12px; border-radius: 3px; display: inline-block;
  background: linear-gradient(90deg, rgba(10, 37, 48, 0.72), rgba(240, 180, 41, 0.85));
  border: 1px solid rgba(31, 50, 56, 0.15);
}

/* De kaart zelf: vierkant, en altijd passend in de resterende hoogte */
.kaartvlak {
  position: relative;
  flex: 1;
  min-height: 0;
  aspect-ratio: 1;
  max-width: 100%;
  align-self: center;
  border-radius: var(--corner-tick);
  overflow: hidden;
  cursor: crosshair;
  background: var(--g100);
  touch-action: none;
}
.zoomlaag {
  position: absolute; inset: 0;
  transform-origin: 0 0;
}
.zoomlaag canvas, .zoomlaag img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.zoomlaag .wmslaag { pointer-events: none; display: none; }
.zoomlaag .wmslaag.aan { display: block; }
#overlay { filter: blur(1px); }
#marker {
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--orange);
  border: 2.5px solid #fff;
  box-shadow: 0 1px 5px rgba(3, 80, 107, 0.45);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(calc(1 / var(--zoom, 1)));
}
#gl {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: grab;
  z-index: 5;
}
#gl:active { cursor: grabbing; }
.hint3d {
  position: absolute; top: 12px; left: 12px;
  background: rgba(3, 80, 107, 0.85);
  color: #fff;
  font-size: 11.5px;
  padding: 6px 11px;
  border-radius: var(--corner-chip);
  pointer-events: none;
  z-index: 6;
}

.zoomknoppen {
  position: absolute; right: 12px; bottom: 12px;
  display: flex; flex-direction: column; gap: 5px;
  z-index: 6;
}
.zoomknoppen button {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  color: var(--teal);
  font-size: 16px;
  line-height: 1;
  box-shadow: var(--shadow-sm);
}
.zoomknoppen button:hover { background: var(--surface-tint); }

.status {
  position: absolute; left: 12px; bottom: 12px;
  z-index: 7;
  background: rgba(3, 80, 107, 0.92);
  color: #fff;
  font-size: 12.5px;
  padding: 7px 13px;
  border-radius: var(--corner-chip);
  max-width: 75%;
}
.status.busy::after {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Bedieningsstrip in het kaartframe ──────────────────────────── */
.bediening {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
  padding: 12px 2px 0;
  margin-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.groep { display: flex; align-items: center; gap: 8px; }
.groep .lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--teal-muted);
}
.groep input[type='date'] {
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0 8px;
  font: 13px var(--font-body);
  color: var(--heading);
}
.chip {
  height: 26px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font: 12px var(--font-body);
  color: var(--ink);
  transition: background var(--motion-fast) var(--ease-standard);
}
.chip:hover { background: var(--surface-tint); }
.chip.actief {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
#tijdgroep { flex: 1; min-width: 240px; }
#tijdgroep.gedimd { opacity: 0.35; pointer-events: none; }
.gedimd3d { opacity: 0.35; pointer-events: none; }
#tijd { flex: 1; accent-color: var(--teal); }
#tijdlabel {
  font-family: var(--font-data);
  font-size: 15px;
  color: var(--heading);
  min-width: 46px;
  text-align: right;
}
#afspelen {
  width: 30px; height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  font-size: 12px;
  color: var(--teal);
}
#afspelen:hover { background: var(--surface-tint); }
.toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.toggle button {
  height: 28px;
  padding: 0 12px;
  border: none;
  background: var(--surface);
  font: 12.5px var(--font-body);
  color: var(--ink);
}
.toggle button.actief { background: var(--teal); color: #fff; }
.laagknoppen { display: flex; gap: 6px; }

/* ── Rechterpaneel (scrolt onafhankelijk) ───────────────────────── */
.paneel {
  width: var(--panel-right-w);
  flex: none;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 2px;
}
.paneelkaart {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  flex: none;
}
.paneelkaart h3 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--teal-muted);
  margin-bottom: 12px;
}
.locatienaam {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 600;
  color: var(--heading);
  line-height: 1.35;
}
.zonop-rij {
  display: flex; gap: 18px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}
.zonop-rij b { color: var(--heading); font-family: var(--font-data); font-weight: 500; }

.punthint {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
  background: var(--surface-tint);
  border-radius: var(--corner-chip);
  padding: 12px 14px;
}

.venster {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.venster:last-child { border-bottom: none; }
.v-tijd {
  font-family: var(--font-data);
  font-size: 21px;
  color: var(--heading);
}
.v-pijl { font-size: 12px; color: var(--muted); }
.v-duur {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--teal-muted);
  background: var(--surface-tint);
  border-radius: var(--corner-chip);
  padding: 3px 9px;
}
.geen-zon { font-size: 13.5px; color: var(--danger); padding: 6px 0; }
.totaalrij {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--muted);
}
.totaalrij b {
  font-family: var(--font-data);
  font-size: 15px;
  color: var(--heading);
  font-weight: 500;
}
.hoogte { margin-left: auto; font-size: 12px; color: var(--muted); }

.kijkhoogte {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.kijkhoogte .lbl {
  font-size: 11px; font-weight: 600; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--teal-muted);
  margin-right: 2px;
}
.naar3d {
  display: block;
  width: 100%;
  margin-top: 12px;
  height: 34px;
  border-radius: var(--corner-chip);
  background: var(--surface-tint);
  border-color: var(--light-blue);
  color: var(--teal);
  font-weight: 500;
  font-size: 12.5px;
}
.naar3d:hover { background: var(--light-blue); }

.band-rij { display: flex; gap: 6px; }
.band-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  text-align: right;
  flex: none;
}
#jaarband {
  flex: 1;
  min-width: 0;
  height: 150px;
  border-radius: var(--corner-chip);
  cursor: pointer;
  display: block;
}
.band-as {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 4px;
  padding-left: 38px;
}
.band-legenda { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.band-legenda .blok { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(31,50,56,0.15); }
.band-legenda span { display: inline-flex; align-items: center; gap: 5px; }

.uitleg { font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.uitleg b { color: var(--ink); }

.hidden { display: none !important; }

/* ── Smal scherm: gewone paginascroll, gestapelde kolommen ──────── */
@media (max-width: 900px) {
  body { overflow: auto; }
  .werkblad { flex-direction: column; min-height: auto; }
  .kaartvlak { width: 100%; flex: none; align-self: stretch; }
  .paneel { width: 100%; overflow: visible; }
  .merk-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .status.busy::after { animation: none; }
  .chip { transition: none; }
}
