/* ═══════════════════════════════════════════════════════════════════
   KNRM Namenzoeker – Reddingboot Wijk aan Zee
   Herontwerp 2026 – KNRM Huisstijl
   Fonts: Barlow Condensed (display) + Barlow (body)
═══════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── KNRM Merkkleuren ── */
  --blue:       #00476D;   /* KNRM donkerblauw */
  --blue-dark:  #002A42;
  --blue-mid:   #005A8A;
  --orange:     #E67601;   /* KNRM oranje */
  --orange-dk:  #C46401;
  --teal:       #74B7C6;   /* KNRM lichtblauw */
  --lblue:      #A4DBF8;

  /* ── Neutrals ── */
  --white:      #FFFFFF;
  --offwhite:   #F4F7FA;
  --cloud:      #E8EEF3;
  --gray:       #7A8F9E;
  --gray-lt:    #B0C0CB;
  --text:       #1A2E3B;

  /* ── Typography ── */
  --display: 'Barlow Condensed', sans-serif;
  --font:    'Barlow', sans-serif;

  /* ── Radii ── */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
}

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

body {
  background: var(--offwhite);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; cursor: pointer; border: none; }
input  { font-family: inherit; }

/* ── Views ──────────────────────────────────────────────────────── */
.view { display: none; min-height: 100vh; flex-direction: column; }
.view.active { display: flex; }

/* ════════════════════════════════════════════════════════════════════
   LOADING OVERLAY
════════════════════════════════════════════════════════════════════ */
#loading-overlay {
  position: fixed; inset: 0;
  background: var(--blue);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 10000;
  gap: 20px;
  color: var(--white);
}

.loader-ring {
  width: 52px; height: 52px;
  border: 4px solid rgba(255,255,255,0.15);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loading-overlay p {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0.85;
}
.loading-name {
  font-size: 0.8rem;
  opacity: 0.5;
  font-style: italic;
  max-width: 300px;
  text-align: center;
}

/* ════════════════════════════════════════════════════════════════════
   LANDING VIEW
════════════════════════════════════════════════════════════════════ */
#view-landing {
  background: var(--blue);
  position: relative;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100vh;
}

/* Achtergrond foto */
#landing-bg {
  position: fixed;
  inset: 0;
  background-image: url('images/knrm_bg.jpg');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  opacity: 0.55;
  z-index: 0;
}

/* Gradient overlay */
#view-landing::after {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(
    175deg,
    rgba(0,71,109,0.20) 0%,
    rgba(0,42,66,0.38) 50%,
    rgba(0,15,28,0.55) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.landing-waves {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 140px;
  overflow: hidden;
  z-index: 2;
  pointer-events: none;
}
.landing-waves .wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100%;
  fill: currentColor;
}
.wave-1 { color: rgba(0,55,90,0.80);   animation: wave-drift 10s linear infinite; }
.wave-2 { color: rgba(0,100,160,0.50); animation: wave-drift 17s linear infinite reverse; }
.wave-3 { color: rgba(116,183,198,0.35); animation: wave-drift 7s linear infinite; }

/* Top waves */
.landing-waves-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 400px;
  overflow: hidden;
  z-index: 2;
  pointer-events: none;
}
.landing-waves-top .wave {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  fill: currentColor;
}
.wave-t1 { color: rgba(255,255,255,0.35); animation: wave-drift 22s linear infinite; }
.wave-t2 { color: rgba(255,255,255,0.20); animation: wave-drift 35s linear infinite reverse; }

@keyframes wave-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.landing-content {
  position: relative;
  z-index: 3;
  padding: 48px 24px 140px;
  max-width: 680px;
  width: 100%;
  animation: fadeUp 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

.landing-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 36px;
}
.landing-logo img {
  max-width: min(360px, 78vw);
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.landing-title {
  font-family: var(--display);
  font-size: clamp(2.6rem, 7.5vw, 4.4rem);
  font-weight: 600;
  color: var(--white);
  margin-bottom: 10px;
  line-height: 1.0;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.landing-subtitle {
  font-family: var(--font);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: 500;
  color: var(--teal);
  margin-bottom: 48px;
  letter-spacing: 0.3px;
}

/* Zoekbalk */
.landing-search-row {
  display: flex;
  gap: 0;
  max-width: 520px;
  margin: 0 auto;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
}

.landing-search-row input {
  flex: 1;
  padding: 18px 22px;
  font-size: 1rem;
  font-family: var(--font);
  border: none;
  outline: none;
  background: var(--white);
  color: var(--text);
}
.landing-search-row input::placeholder { color: var(--gray-lt); text-align: center; }
.landing-search-row input { text-align: center; }

.landing-search-row button {
  padding: 18px 30px;
  background: var(--orange);
  color: var(--white);
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: background 0.2s ease;
  white-space: nowrap;
  border-left: none;
}
.landing-search-row button:hover { background: var(--orange-dk); }

/* ════════════════════════════════════════════════════════════════════
   RESULTS VIEW
════════════════════════════════════════════════════════════════════ */
#view-results { min-height: 100vh; }

/* ── Header ──────────────────────────────────────────────────────── */
.results-header {
  background: var(--blue);
  border-bottom: 3px solid var(--orange);
}

.results-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 14px 24px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
}

.header-brand img {
  height: 36px;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.header-brand-text {
  color: var(--white);
  font-family: var(--display);
  font-size: 1.0rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1.2;
  text-transform: uppercase;
}
.header-brand-text small {
  display: block;
  font-family: var(--font);
  font-weight: 400;
  color: var(--teal);
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Zoekbalk resultaten ─────────────────────────────────────────── */
.search-section {
  background: var(--blue);
  padding: 18px 24px 22px;
  position: relative;
  z-index: 1;
}

.search-wave {
  display: block;
  width: 100%;
  height: 52px;
  overflow: hidden;
  line-height: 0;
}
.search-wave svg {
  display: block;
  width: 100%;
  height: 52px;
}

.search-bar-wrap {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.search-bar-wrap input {
  flex: 1;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-family: var(--font);
  border: none;
  outline: none;
  background: var(--white);
  color: var(--text);
  min-width: 0;
}
.search-bar-wrap input::placeholder { color: var(--gray-lt); }

.btn-search {
  padding: 14px 24px;
  background: var(--orange);
  color: var(--white);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: background 0.2s;
  white-space: nowrap;
}
.btn-search:hover { background: var(--orange-dk); }

.btn-clear {
  padding: 14px 16px;
  background: var(--white);
  color: var(--gray);
  font-size: 1.1rem;
  border-left: 1px solid var(--cloud);
  transition: color 0.15s;
}
.btn-clear:hover { color: var(--orange); }
.btn-clear.has-query { color: var(--text); }

/* Gevonden-badge */
.found-badge {
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--white);
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.found-badge.show { display: inline-flex; }
.found-badge .dot {
  width: 7px; height: 7px;
  background: #4EC96B;
  border-radius: 50%;
}

.search-meta {
  max-width: 640px;
  margin: 10px auto 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px;
  position: relative;
  z-index: 2;
}

/* ── Resultaten body ─────────────────────────────────────────────── */
.results-body {
  flex: 1;
  padding: 32px 24px 80px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.results-section-title {
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray);
  margin-bottom: 18px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 90px 20px;
  color: var(--gray);
}
.empty-state .icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  display: block;
  opacity: 0.55;
}
.empty-state h2 {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.empty-state p { font-size: 0.95rem; }

/* Resultaten grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

/* Card reveal animatie */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-card {
  background: var(--white);
  border-radius: var(--r-md);
  box-shadow: 0 2px 10px rgba(0,71,109,0.07);
  padding: 18px 20px;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 0.18s,
              border-left-color 0.18s;
  border-left: 4px solid var(--blue);
  border-top: 1px solid var(--cloud);
  border-right: 1px solid var(--cloud);
  border-bottom: 1px solid var(--cloud);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: cardIn 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.result-card:nth-child(1)  { animation-delay:   0ms; }
.result-card:nth-child(2)  { animation-delay:  40ms; }
.result-card:nth-child(3)  { animation-delay:  80ms; }
.result-card:nth-child(4)  { animation-delay: 120ms; }
.result-card:nth-child(5)  { animation-delay: 160ms; }
.result-card:nth-child(6)  { animation-delay: 200ms; }
.result-card:nth-child(7)  { animation-delay: 240ms; }
.result-card:nth-child(8)  { animation-delay: 280ms; }

.result-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,71,109,0.15);
  border-left-color: var(--orange);
}

.result-name {
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
  line-height: 1.3;
}
.result-name mark {
  background: none;
  color: var(--orange);
  font-weight: 800;
}

.result-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--gray);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
}
.result-location .loc-dot {
  width: 9px; height: 9px;
  background: var(--teal);
  border: 2px solid var(--blue);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Geen resultaten */
.no-results {
  text-align: center;
  padding: 70px 20px;
  color: var(--gray);
  font-size: 0.95rem;
}
.no-results strong { color: var(--text); }

/* ════════════════════════════════════════════════════════════════════
   DETAIL VIEW
════════════════════════════════════════════════════════════════════ */
#view-detail {
  background: var(--orange);
  min-height: 100vh;
}

.boat-overlay.collapsed .boat-overview {
  display: none;
}

@media (max-width: 600px) {
  .boat-hotspot-dot { width: 10px; height: 10px; }
  .boat-overlay { width: 200px; bottom: 72px; right: 8px; }
  .boat-overlay:not(.collapsed) { width: 240px; }
  .landing-waves-top { height: 150px; }
  .landing-logo img { max-width: min(220px, 60vw); }
  .trans-boat-wrap { width: 98vw; }
  .trans-label { font-size: 0.7rem; }

  /* Verberg de positie-widget tijdens typen — anders botst hij met de
     autocomplete-dropdown wanneer de toetsenbord-laag de visual viewport
     verkleint en de fixed overlay omhoog schuift. */
  body:has(input:focus) .boat-overlay { display: none !important; }
}

/* ── Detail header ───────────────────────────────────────────────── */
.detail-header {
  background: var(--blue);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 3px solid var(--orange);
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border-radius: var(--r-sm);
  padding: 8px 16px;
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: background 0.15s;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-back:hover { background: rgba(255,255,255,0.2); }
.btn-back svg { flex-shrink: 0; }

.detail-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.detail-title span {
  display: inline;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--teal);
  margin-top: 1px;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Detail zoekbalk ─────────────────────────────────────────────── */
.detail-search-wrap {
  display: flex;
  flex: 1;
  max-width: 400px;
  border-radius: var(--r-sm);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.detail-search-wrap input {
  flex: 1;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-family: var(--font);
  border: none;
  outline: none;
  background: var(--white);
  color: var(--text);
  min-width: 0;
}
.detail-search-wrap input::placeholder { color: var(--gray-lt); }
.btn-detail-search {
  padding: 8px 16px;
  font-size: 0.82rem;
}

/* ── Deelknoppen ─────────────────────────────────────────────────── */
.btn-share, .btn-share-results {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-share {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-share:hover { background: rgba(255,255,255,0.2); }

.btn-share-results {
  background: var(--white);
  color: var(--gray);
  border: none;
}
.btn-share-results:hover { color: var(--blue); }

.btn-share.share-copied, .btn-share-results.share-copied {
  color: #4CAF50;
}

/* ── Image viewer ────────────────────────────────────────────────── */
.viewer-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--orange);
  background: var(--orange);
  min-height: calc(100vh - 120px);
  cursor: grab;
}
.viewer-container.grabbing { cursor: grabbing; }

#canvas-wrap {
  position: absolute;
  top: 0; left: 0;
  transform-origin: 0 0;
}

#viewer-img {
  display: block;
  max-width: none;
}

/* Loupe-markering (vervangt kader + cirkel + label) */
#pos-marker, #name-label { display: none !important; }

#name-rect {
  position: absolute;
  display: none;
  pointer-events: none;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#name-rect::after {
  display: none;
}

/* ── Zoom-balk ───────────────────────────────────────────────────── */
.zoom-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0,27,42,0.88);
  border: 1px solid rgba(116,183,198,0.2);
  border-radius: 30px;
  padding: 8px 18px;
  backdrop-filter: blur(12px);
  z-index: 20;
}

.zoom-btn {
  width: 32px; height: 32px;
  background: var(--blue);
  color: var(--white);
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.zoom-btn:hover { background: var(--orange); }

#zoom-slider {
  -webkit-appearance: none;
  width: 120px;
  height: 4px;
  border-radius: 2px;
  background: rgba(116,183,198,0.25);
  outline: none;
}
#zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--teal);
  cursor: pointer;
}
#zoom-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--teal);
  border: none;
  cursor: pointer;
}

#zoom-pct {
  color: rgba(116,183,198,0.85);
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 600;
  min-width: 38px;
  text-align: center;
  letter-spacing: 0.5px;
}

/* ── Vergrootglas loupe ──────────────────────────────────────────── */
#viewer-loupe {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 4px solid var(--blue-dark);
  box-shadow:
    0 2px 24px rgba(0,0,0,0.5),
    0 0 0 2px rgba(255,255,255,0.18),
    inset 0 0 0 1px rgba(0,0,0,0.1);
  overflow: hidden;
  pointer-events: none;
  display: none;
  z-index: 50;
  transform: translate(-50%, -50%);
}

#loupe-canvas-wrap {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

#loupe-img {
  display: block;
  max-width: none;
}

body.picking-pos #viewer-loupe { display: none !important; }

/* ── Afbeelding-kiezer ───────────────────────────────────────────── */
.img-switcher {
  position: absolute;
  top: 14px; right: 14px;
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 20;
}

.img-switch-btn {
  padding: 6px 14px;
  background: rgba(0,27,42,0.88);
  border: 1px solid rgba(116,183,198,0.2);
  border-radius: var(--r-sm);
  color: var(--teal);
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.15s;
  text-align: left;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}
.img-switch-btn:hover { border-color: var(--orange); color: var(--white); }
.img-switch-btn.active {
  background: var(--blue);
  border-color: var(--teal);
  color: var(--white);
}

/* ════════════════════════════════════════════════════════════════════
   AUTOCOMPLETE DROPDOWN
════════════════════════════════════════════════════════════════════ */
#autocomplete-dropdown {
  position: fixed;
  background: var(--white);
  border-radius: var(--r-md);
  box-shadow: 0 12px 40px rgba(0,71,109,0.2);
  max-height: 340px;
  overflow-y: auto;
  z-index: 9999;
  display: none;
  min-width: 280px;
  border: 1px solid var(--cloud);
}
#autocomplete-dropdown.open { display: block; }

.ac-count {
  padding: 8px 16px;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--gray);
  border-bottom: 1px solid var(--cloud);
  position: sticky; top: 0;
  background: var(--white);
}

.ac-item {
  padding: 11px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #F0F4F7;
  font-size: 0.88rem;
  color: var(--text);
  transition: background 0.1s;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: var(--offwhite); }
.ac-item.active { background: var(--blue); color: var(--white); }
.ac-item.active .ac-badge { background: rgba(255,255,255,0.15); color: var(--white); border-color: transparent; }

.ac-item mark {
  background: rgba(0, 71, 109, 0.15);
  color: var(--blue);
  font-weight: 700;
  border-radius: 2px;
  padding: 0 2px;
}
.ac-item.active mark {
  background: rgba(255, 255, 255, 0.25);
  color: var(--white);
}

.ac-badge {
  font-family: var(--display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--offwhite);
  color: var(--blue);
  border: 1px solid var(--cloud);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════════
   BEHEER (Beheer-modus)
════════════════════════════════════════════════════════════════════ */

/* Beheer-knop in header */
/* Beheerknop op landingspagina (onderaan, klein met cog) */
.btn-beheer-landing {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.35);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  z-index: 10;
}
.btn-beheer-landing:hover {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
}
.btn-beheer-landing.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

/* Beheerknop op resultatenpagina (rechtsboven in header) */
.btn-beheer-results {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  margin-left: auto;
  flex-shrink: 0;
}
.btn-beheer-results:hover {
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.8);
}
.btn-beheer-results.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

/* Kaart-acties in beheer-modus */
.card-actions { display: none; gap: 4px; flex-shrink: 0; }
body.beheer-mode .card-actions { display: flex; }
body.beheer-mode .result-card { border-left-color: var(--orange); }
body.beheer-mode .result-location { display: none; }

.btn-card-edit, .btn-card-del {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s;
}
.btn-card-edit { background: var(--blue); color: var(--white); }
.btn-card-edit:hover { background: var(--blue-mid); }
.btn-card-del { background: #C0392B; color: var(--white); }
.btn-card-del:hover { background: #A93226; }

/* Toevoeg-balk */
#add-bar {
  display: none;
  background: #FFF8E8;
  border: 1px solid #F4C842;
  border-radius: var(--r-md);
  padding: 10px 18px;
  margin-bottom: 24px;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
body.beheer-mode #add-bar { display: flex; }
#add-bar p { font-size: 0.82rem; color: #7A5F00; flex: 1; min-width: 160px; }

.btn-add-name {
  padding: 8px 20px;
  background: var(--orange);
  color: var(--white);
  border-radius: var(--r-sm);
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: background 0.15s;
}
.btn-add-name:hover { background: var(--orange-dk); }

/* Opslaan-balk */
#save-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--blue);
  color: var(--white);
  padding: 12px 24px;
  z-index: 500;
  align-items: center;
  gap: 14px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  border-top: 3px solid var(--orange);
}
body.beheer-mode #save-bar { display: flex; }
#save-bar p { flex: 1; font-size: 0.85rem; }
#save-bar p strong { color: var(--orange); }

.btn-save {
  padding: 8px 22px;
  background: #27AE60;
  color: var(--white);
  border-radius: var(--r-sm);
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: background 0.15s;
}
.btn-save:hover { background: #219A52; }
.btn-save:disabled { background: #7FBFA0; cursor: not-allowed; }

.btn-export {
  padding: 8px 18px;
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--r-sm);
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: background 0.15s;
}
.btn-export:hover { background: rgba(255,255,255,0.2); }

.btn-stop-beheer {
  padding: 8px 16px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 0.82rem;
  transition: background 0.15s;
}
.btn-stop-beheer:hover { background: rgba(255,255,255,0.16); color: var(--white); }

/* ════════════════════════════════════════════════════════════════════
   MODAAL (naam bewerken / toevoegen)
════════════════════════════════════════════════════════════════════ */
#pw-modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}
#pw-modal.open { display: flex; }
.pw-error { color: #c0392b; min-height: 1.2em; margin-top: 6px; }

#edit-modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}
#edit-modal.open { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: 32px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  border-top: 4px solid var(--orange);
}
.modal-box h2 {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-field { margin-bottom: 18px; }
.modal-field label {
  display: block;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 7px;
}
.modal-field input,
.modal-field select {
  width: 100%;
  padding: 11px 16px;
  font-size: 0.95rem;
  font-family: var(--font);
  border: 1.5px solid var(--cloud);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color 0.15s;
  background: var(--white);
  color: var(--text);
}
.modal-field input:focus,
.modal-field select:focus { border-color: var(--blue); }

.modal-pos-hint { font-size: 0.78rem; color: var(--gray); margin-top: 7px; }
.modal-pos-hint strong { color: var(--blue); }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 26px;
  justify-content: flex-end;
}

.btn-modal-save {
  padding: 10px 26px;
  background: var(--blue);
  color: var(--white);
  border-radius: var(--r-sm);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: background 0.15s;
}
.btn-modal-save:hover { background: var(--blue-mid); }

.btn-modal-cancel {
  padding: 10px 20px;
  background: var(--offwhite);
  color: var(--text);
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  border: 1px solid var(--cloud);
  transition: background 0.15s;
}
.btn-modal-cancel:hover { background: var(--cloud); }

/* Positieprikker */
body.picking-pos .viewer-container { cursor: crosshair !important; }

.pos-pick-overlay {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0;
  background: rgba(240,115,57,0.9);
  color: white;
  text-align: center;
  padding: 10px;
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  z-index: 30;
  pointer-events: none;
}
body.picking-pos .pos-pick-overlay { display: block; }

/* ════════════════════════════════════════════════════════════════════
   MOBILE
════════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .results-grid { grid-template-columns: 1fr; }
  .landing-content { padding-bottom: 140px; }
  .search-bar-wrap { flex-wrap: nowrap; }

  /* Op mobiel grid i.p.v. flex — drie rijen:
     rij 1 = HOME links, delen rechts
     rij 2 = titel gecentreerd over volle breedte
     rij 3 = zoekbalk over volle breedte. */
  .detail-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto auto;
    column-gap: 10px;
    row-gap: 8px;
    align-items: center;
  }
  .btn-back           { grid-column: 1; grid-row: 1; }
  .btn-share          { grid-column: 3; grid-row: 1; justify-self: end; }
  .detail-title       { grid-column: 1 / -1; grid-row: 2; }
  .detail-search-wrap { grid-column: 1 / -1; grid-row: 3; max-width: none; }

  .detail-title {
    font-size: 0.9rem;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #zoom-slider { width: 80px; }
}

/* ════════════════════════════════════════════════════════════════════
   CINEMATIC TRANSITION OVERLAY
════════════════════════════════════════════════════════════════════ */
#transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: none;
  overflow: hidden;
}
#transition-overlay.active { display: block; }

.trans-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #001824 0%, #000C14 100%);
}

.trans-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center,
    transparent 30%,
    rgba(0,12,20,0.6) 70%,
    rgba(0,8,14,0.95) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.trans-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(116,183,198,0.15) 20%,
    rgba(164,219,248,0.4) 50%,
    rgba(116,183,198,0.15) 80%,
    transparent 100%
  );
  z-index: 3;
  opacity: 0;
  pointer-events: none;
}
#transition-overlay.active .trans-scan-line {
  opacity: 1;
  animation: scanDown 1.8s ease-in-out forwards;
}
@keyframes scanDown {
  0%   { top: -3px; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* Boot image in transition — starts large, fills the screen */
.trans-boat-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  opacity: 0;
  z-index: 1;
  width: 92vw;
  max-width: 1100px;
}
#transition-overlay.phase-boat .trans-boat-wrap {
  animation: boatReveal 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes boatReveal {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.85); filter: brightness(0.2) blur(12px); }
  40%  { opacity: 1; filter: brightness(0.6) blur(2px); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: brightness(1) blur(0); }
}

.trans-boat-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  box-shadow: 0 30px 100px rgba(0,0,0,0.7), 0 0 1px rgba(116,183,198,0.3);
}

/* Ping pulse at hotspot */
.trans-ping {
  position: absolute;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  z-index: 4;
  opacity: 0;
  pointer-events: none;
}
#transition-overlay.phase-boat .trans-ping {
  opacity: 1;
  animation: pingAppear 0.4s ease 0.8s both;
}
/* During zoom phase, scale the ping up to stay visible */
#transition-overlay.phase-zoom .trans-ping {
  transition: opacity 0.3s ease 0.4s;
  opacity: 0;
}
@keyframes pingAppear {
  from { opacity: 0; }
  to { opacity: 1; }
}
.trans-ping::before,
.trans-ping::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}
.trans-ping::before {
  width: 10px;
  height: 10px;
  background: var(--orange);
  box-shadow: 0 0 12px 4px rgba(240,115,57,0.6);
  z-index: 2;
}
.trans-ping::after {
  width: 10px;
  height: 10px;
  border: 2px solid var(--orange);
  animation: sonarPulse 1.2s ease-out infinite;
  z-index: 1;
}
@keyframes sonarPulse {
  0%   { width: 10px; height: 10px; opacity: 0.8; border-width: 2px; }
  100% { width: 60px; height: 60px; opacity: 0; border-width: 1px; }
}

/* Label at hotspot */
.trans-label {
  position: absolute;
  transform: translate(-50%, calc(-100% - 22px));
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--white);
  background: rgba(0,71,109,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(116,183,198,0.3);
  padding: 5px 14px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  z-index: 5;
  pointer-events: none;
}
.trans-label::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: rgba(0,71,109,0.85);
  border-right: 1px solid rgba(116,183,198,0.3);
  border-bottom: 1px solid rgba(116,183,198,0.3);
}
#transition-overlay.phase-boat .trans-label {
  animation: labelIn 0.4s ease 0.9s both;
}
#transition-overlay.phase-zoom .trans-label {
  transition: opacity 0.25s ease 0.3s;
  opacity: 0;
}
@keyframes labelIn {
  0%   { opacity: 0; transform: translate(-50%, calc(-100% - 14px)); }
  100% { opacity: 1; transform: translate(-50%, calc(-100% - 22px)); }
}

/* ═══ Name Reveal Animation on Marker (disabled) ═══════════════════ */
#name-rect.revealing,
#name-rect.revealed {
  animation: none;
  border: none;
  background: transparent;
  box-shadow: none;
}

/* ════════════════════════════════════════════════════════════════════
   BOAT OVERLAY – REDESIGN
════════════════════════════════════════════════════════════════════ */
.boat-overlay {
  position: fixed;
  bottom: 80px;
  right: 14px;
  z-index: 200;
  display: none;
  width: 320px;
  min-width: 180px;
  max-width: 90vw;
  border-radius: 12px;
  overflow: visible;
  box-shadow:
    0 8px 32px rgba(0,24,36,0.5),
    0 0 0 1px rgba(116,183,198,0.15),
    inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(16px);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Resize handle – linkerbovenhoek */
.boat-resize-handle {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 10;
  border-radius: 4px 0 0 0;
}
.boat-resize-handle::before,
.boat-resize-handle::after {
  content: '';
  position: absolute;
  background: rgba(164,219,248,0.45);
  border-radius: 1px;
}
.boat-resize-handle::before {
  top: 4px; left: 3px;
  width: 10px; height: 1.5px;
  transform: rotate(-45deg);
}
.boat-resize-handle::after {
  top: 7px; left: 1px;
  width: 7px; height: 1.5px;
  transform: rotate(-45deg);
}
.boat-resize-handle:hover::before,
.boat-resize-handle:hover::after {
  background: var(--orange);
}
.boat-overlay.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.boat-overlay-inner {
  border-radius: 12px;
  overflow: hidden;
}
.boat-overlay-header {
  background: linear-gradient(135deg, rgba(0,71,109,0.95), rgba(0,42,66,0.95));
  color: var(--white);
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(116,183,198,0.2);
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  user-select: none;
}
.boat-overlay-header::after {
  content: '';
  margin-left: auto;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(255,255,255,0.5);
  transition: transform 0.25s;
}
.boat-overlay.collapsed .boat-overlay-header::after {
  transform: rotate(-90deg);
}

.boat-overview {
  background: linear-gradient(180deg, #001420 0%, #001824 100%);
  padding: 12px;
  position: relative;
}

.boat-overview-wrap {
  position: relative;
  display: block;
  line-height: 0;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.boat-overview-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

/* Subtle grid overlay for technical feel */
.boat-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(116,183,198,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(116,183,198,0.06) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  z-index: 1;
}

/* Hotspot redesign */
.boat-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 5;
}

.boat-hotspot-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(116,183,198,0.3);
  border: 1.5px solid rgba(164,219,248,0.5);
  box-shadow: 0 0 8px rgba(116,183,198,0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.boat-hotspot:hover .boat-hotspot-dot {
  background: rgba(240,115,57,0.6);
  border-color: var(--white);
  box-shadow: 0 0 16px rgba(240,115,57,0.5);
  transform: scale(1.4);
}

.boat-hotspot.active .boat-hotspot-dot {
  background: #FFE500;
  border-color: #FFE500;
  box-shadow: 0 0 20px rgba(255,229,0,0.9);
  transform: scale(1.3);
  animation: hotspotPulse 2s ease-in-out infinite;
}
@keyframes hotspotPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(255,229,0,0.7); transform: scale(1.3); }
  50%      { box-shadow: 0 0 24px rgba(255,229,0,1); transform: scale(1.5); }
}

/* Sonar ring around active hotspot */
.boat-hotspot.active .boat-hotspot-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--orange);
  animation: hotspotSonar 2s ease-out infinite;
}
@keyframes hotspotSonar {
  0%   { width: 12px; height: 12px; opacity: 0.7; }
  100% { width: 40px; height: 40px; opacity: 0; }
}

.boat-hotspot-label {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(0,42,66,0.9);
  backdrop-filter: blur(8px);
  color: var(--white);
  font-family: var(--display);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 10px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  border: 1px solid rgba(116,183,198,0.2);
}

.boat-hotspot:hover .boat-hotspot-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.boat-hotspot.active .boat-hotspot-label {
  display: none;
}

/* Detail view entry animation */
#view-detail.entering .viewer-container {
  animation: viewerFadeIn 0.5s ease 0.1s both;
}
@keyframes viewerFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-lt); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }
