/* ============================================================
   Nautische Nomade — Bodemhoogte (diepte.js)
   Rasterlaag + doorzicht-slider + peiling-popup + disclaimer.
   ============================================================ */

/* ---------- Toggle-knop ---------- */

.nn-dieptetoggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid rgba(239, 230, 214, 0.16);
  border-radius: var(--r-sm);
  background: rgba(30, 26, 20, 0.82);
  backdrop-filter: blur(6px);
  color: #EFE6D6;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: background var(--dur-fast) var(--ease-out);
}
.nn-dieptetoggle:hover { background: rgba(194, 90, 61, 0.92); }
.nn-dieptetoggle.is-active {
  background: var(--terracotta-500);
  border-color: transparent;
}

/* ---------- Paneel ---------- */

.nn-dieptebar {
  position: absolute;
  z-index: 7;
  right: 14px;
  top: 68px;
  width: 236px;
  padding: 11px 13px 9px;
  border: 1px solid rgba(239, 230, 214, 0.14);
  border-radius: var(--r-md);
  background: rgba(30, 26, 20, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity var(--dur-mid) var(--ease-out), transform var(--dur-mid) var(--ease-out);
}
.nn-dieptebar.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nn-dieptebar__head { margin-bottom: 9px; }
.nn-dieptebar__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta-400);
}
.nn-dieptebar__eenheid {
  display: block;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  color: rgba(239, 230, 214, 0.45);
  margin-top: 2px;
}

.nn-dieptebar__rij {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: rgba(239, 230, 214, 0.7);
  cursor: pointer;
}
.nn-dieptebar__rij > span { flex: 0 0 auto; }
.nn-dieptebar__rij--check { gap: 7px; }

.nn-dieptebar__slider {
  flex: 1;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  border-radius: var(--r-pill);
  background: rgba(239, 230, 214, 0.18);
  outline-offset: 4px;
  cursor: pointer;
}
.nn-dieptebar__slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--terracotta-500);
  border: 2px solid #FBF7EE;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: grab;
}
.nn-dieptebar__slider::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--terracotta-500);
  border: 2px solid #FBF7EE;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: grab;
}
.nn-dieptebar__hs,
.nn-dieptebar__lijnen { accent-color: var(--terracotta-500); cursor: pointer; }

/* De ondiepte-grens hoort bij de dieptelijnen: pas tonen als die aanstaan */
.nn-dieptebar__ondiepte { display: none; }
.nn-dieptebar.heeft-lijnen .nn-dieptebar__ondiepte { display: block; }

.nn-dieptebar__grens {
  flex: 1;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  border-radius: var(--r-pill);
  background: rgba(239, 230, 214, 0.18);
  outline-offset: 4px;
  cursor: pointer;
}
.nn-dieptebar__grens::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #E8542F;
  border: 2px solid #FBF7EE;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  cursor: grab;
}
.nn-dieptebar__grens::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #E8542F;
  border: 2px solid #FBF7EE;
  cursor: grab;
}
.nn-dieptebar__grensval {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: #FF7A52;
}
.nn-dieptebar__lijnstatus {
  display: block;
  margin: 2px 0 6px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--terracotta-400);
}

/* Het reliëf is een grijze arcering. Met gewone alpha legt die een grijze
   waas over de kleurentrap; met multiply verdonkert hij alleen de hellingen
   en blijft de kleur (en dus de afleesbaarheid) intact. */
.leaflet-nn-dieptehs-pane { mix-blend-mode: multiply; }

/* ---------- Dieptelijnen + dieptecijfers ---------- */

.nn-dieptelabel-wrap,
.nn-dieptecijfer-wrap { background: none; border: none; }

/* Contourlabel: het niveau van de lijn, in m NAP */
.nn-dieptelabel,
.nn-dieptecijfer {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  /* Halo rondom: de cijfers moeten leesbaar blijven op elke bodemkleur */
  text-shadow:
     0 0 2px rgba(12, 10, 8, 0.95), 0 0 2px rgba(12, 10, 8, 0.95),
     1px 1px 2px rgba(12, 10, 8, 0.9), -1px -1px 2px rgba(12, 10, 8, 0.9);
}
.nn-dieptelabel { color: #BFDCE8; }
.nn-dieptecijfer {
  color: rgba(239, 230, 214, 0.82);
  font-weight: 400;
  font-size: 8.5px;
}
/* Ondieper dan de ingestelde grens: dít is waar je aan de grond loopt */
.nn-dieptelabel.is-ondiep,
.nn-dieptecijfer.is-ondiep {
  color: #FF7A52;
  font-weight: 700;
}

/* ---------- Legenda ---------- */

.nn-dieptebar__legendaknop {
  width: 100%;
  margin: 2px 0 7px;
  padding: 5px 8px;
  border: 1px solid rgba(239, 230, 214, 0.14);
  border-radius: var(--r-sm);
  background: transparent;
  color: rgba(239, 230, 214, 0.7);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.nn-dieptebar__legendaknop:hover {
  background: rgba(239, 230, 214, 0.08);
  color: #EFE6D6;
}
/* De GetLegendGraphic is een lange kleurentrap (169×1105) — dus scrollen */
.nn-dieptebar__legenda {
  max-height: 190px;
  overflow-y: auto;
  margin-bottom: 8px;
  padding: 6px;
  border-radius: var(--r-sm);
  background: rgba(251, 247, 238, 0.94);
}
.nn-dieptebar__legenda img { display: block; width: 100%; height: auto; }

/* ---------- Disclaimer: verplicht, blijft staan ---------- */

.nn-dieptebar__waarschuwing {
  padding: 7px 8px;
  border: 1px solid rgba(210, 122, 94, 0.45);
  border-left-width: 3px;
  border-radius: var(--r-sm);
  background: rgba(166, 69, 44, 0.18);
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: rgba(239, 230, 214, 0.9);
}

.nn-dieptebar__foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 7px;
}
.nn-dieptebar__hint {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: rgba(239, 230, 214, 0.5);
}
.nn-dieptebar__bron {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.03em;
  color: rgba(239, 230, 214, 0.45);
  text-decoration: none;
}
.nn-dieptebar__bron:hover { color: rgba(239, 230, 214, 0.8); text-decoration: underline; }

/* ---------- Peiling-popup ---------- */

.nn-dieptepopup .leaflet-popup-content-wrapper {
  background: rgba(30, 26, 20, 0.96);
  color: #EFE6D6;
  border: 1px solid rgba(239, 230, 214, 0.14);
  border-radius: var(--r-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.nn-dieptepopup .leaflet-popup-content { margin: 11px 13px; width: 196px !important; }
.nn-dieptepopup .leaflet-popup-tip { background: rgba(30, 26, 20, 0.96); }
.nn-dieptepopup .leaflet-popup-close-button { color: rgba(239, 230, 214, 0.5); }
.nn-dieptepopup .leaflet-popup-close-button:hover { color: #EFE6D6; }

.nn-dieptepopup__kop {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta-400);
}
.nn-dieptepopup__waarde {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 1px;
  font-family: var(--font-body);
  font-size: 26px;
  font-weight: 800;
  color: #FBF7EE;
}
.nn-dieptepopup__eenheid {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(239, 230, 214, 0.5);
}
.nn-dieptepopup__diepte {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(239, 230, 214, 0.8);
}
/* Waarom dit géén zeekaart-diepte is */
.nn-dieptepopup__let {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.45;
  color: rgba(239, 230, 214, 0.5);
}
.nn-dieptepopup__waarschuwing {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(210, 122, 94, 0.4);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.45;
  color: rgba(210, 122, 94, 0.95);
}

.nn-dieptepopup__laden,
.nn-dieptepopup__geen {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(239, 230, 214, 0.7);
}
.nn-dieptepopup__geen strong {
  display: block;
  font-family: var(--font-body);
  font-size: 14px;
  color: #FBF7EE;
  margin-bottom: 2px;
}
.nn-dieptepopup__geen span {
  display: block;
  font-size: 9px;
  color: rgba(239, 230, 214, 0.5);
}

/* ---------- Mobiel ---------- */

@media (max-width: 900px) {
  .nn-dieptebar {
    right: 12px;
    left: 12px;
    top: 58px;
    width: auto;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nn-dieptebar { transition: none; }
}
