:root {
  --bg: #f4f1ea;
  --paneel: #ffffff;
  --rand: #e0dacd;
  --tekst: #2b2b2b;
  --zacht: #6b6b6b;
  --accent: #1f6f5c;
  --accent-licht: #e6f0ed;
  --hotel: #c0569b;
  --bezienswaardigheid: #2f6fb0;
  --things: #e08a1e;
  --eten: #d1483c;
  --stilte: #6a5acd;
  --topbar-h: 52px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--tekst);
  background: var(--bg);
  overflow: hidden;
}

/* Topbar */
#topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: var(--accent);
  color: #fff;
  position: relative;
  z-index: 1200;
}
#topbar h1 { font-size: 15px; font-weight: 600; margin: 0; text-align: center; }
#trip-select {
  flex: 1 1 auto;
  max-width: 420px;
  margin: 0 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-align-last: center;
}
#trip-select option { color: #2b2b2b; }
.icoon-knop {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 8px;
}
.icoon-knop:active { background: rgba(255,255,255,0.15); }

/* Layout */
#app {
  display: flex;
  height: calc(100% - var(--topbar-h));
  position: relative;
}
#zijbalk {
  width: 300px;
  flex: 0 0 300px;
  background: var(--bg);
  border-right: 1px solid var(--rand);
  overflow-y: auto;
  padding: 12px;
}
#kaart { flex: 1 1 auto; height: 100%; }
#chatpaneel {
  width: 340px;
  flex: 0 0 340px;
  background: var(--paneel);
  border-left: 1px solid var(--rand);
  display: flex;
  flex-direction: column;
}

/* Panelen in zijbalk */
.paneel {
  background: var(--paneel);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}
.paneel h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--zacht); margin: 0 0 10px; }
.filter-groep { margin-bottom: 12px; }
.filter-groep strong { display: block; font-size: 13px; margin-bottom: 4px; }
.filter-groep label { display: flex; align-items: center; gap: 6px; font-size: 14px; padding: 3px 0; cursor: pointer; }
.punt { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

/* Tijdlijn */
#tijdlijn { list-style: none; margin: 0; padding: 0; }
#tijdlijn li {
  border-left: 3px solid var(--rand);
  padding: 6px 0 10px 12px;
  margin-left: 4px;
  cursor: pointer;
}
#tijdlijn li:hover { border-left-color: var(--accent); }
#tijdlijn li.actief { border-left-color: var(--accent); }
#tijdlijn .stop-naam { font-weight: 600; font-size: 14px; }
#tijdlijn .stop-naam.actief { color: var(--accent); }
#tijdlijn .stop-data { font-size: 12px; color: var(--zacht); }
#tijdlijn .deel-kop { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); font-weight: 700; margin: 10px 0 4px; }
.tekst-knop { background: none; border: 0; color: var(--accent); font-size: 13px; cursor: pointer; padding: 6px 0 0; }

/* Reis-paneel */
.trip-datum { font-size: 13px; color: var(--zacht); margin-bottom: 6px; }
.reisinfo { margin: 8px 0; }
.reisinfo summary { font-size: 13px; cursor: pointer; color: var(--accent); }
.reisinfo textarea { width: 100%; margin-top: 8px; padding: 8px; border: 1px solid var(--rand); border-radius: 8px; font: inherit; resize: vertical; }
.mini-knop { margin-top: 6px; padding: 6px 10px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-size: 13px; cursor: pointer; }
.gevaar-knop { display: block; margin-top: 10px; padding: 6px 10px; border: 1px solid var(--eten); border-radius: 8px; background: #fff; color: var(--eten); font-size: 13px; cursor: pointer; }
#tijdlijn li.leeg { border: 0; color: var(--zacht); font-size: 13px; padding-left: 0; cursor: default; }
#tijdlijn li { position: relative; }
.stop-del {
  position: absolute; top: 6px; right: 0;
  width: 22px; height: 22px; line-height: 20px; text-align: center;
  background: none; border: 0; color: var(--zacht); font-size: 18px; cursor: pointer; border-radius: 6px;
}
.stop-del:hover { color: var(--eten); background: #f3eceb; }
.stop-naam, .stop-data { padding-right: 24px; }

/* Formulier */
#spot-form input, #spot-form select, #spot-form textarea {
  width: 100%;
  padding: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--rand);
  border-radius: 8px;
  font: inherit;
}
#spot-form .rij { display: flex; gap: 8px; }
#spot-form .rij input { width: 50%; }
#spot-form .check { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 8px; }
#spot-form button[type=submit] {
  width: 100%; padding: 9px; border: 0; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 600; cursor: pointer;
}
.hint { font-size: 12px; color: var(--zacht); margin: 6px 0 0; }

/* Markers */
.marker-icoon {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  font-size: 15px;
}
.marker-icoon span { transform: rotate(45deg); }
.marker-geboekt { outline: 3px solid #1f6f5c; outline-offset: 1px; }

/* Popup */
.leaflet-popup-content { margin: 10px 12px; font-size: 14px; }
.popup-naam { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.popup-type { font-size: 12px; color: var(--zacht); margin-bottom: 6px; }
.popup-rij { margin: 4px 0; }
.popup-vlag { font-size: 12px; color: var(--eten); }
.popup select { font: inherit; padding: 4px; border-radius: 6px; border: 1px solid var(--rand); }
.popup-del { background: none; border: 0; color: var(--eten); cursor: pointer; font-size: 13px; padding: 6px 0 0; }
.popup a { color: var(--accent); }

/* Chat */
.chat-kop { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--rand); }
.chat-kop h2 { margin: 0; font-size: 15px; }
.chat-kop .icoon-knop { color: var(--zacht); }
#chat-log { flex: 1 1 auto; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.bericht { max-width: 85%; padding: 9px 11px; border-radius: 12px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; }
.bericht.ik { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 3px; }
.bericht.bot { align-self: flex-start; background: var(--accent-licht); border-bottom-left-radius: 3px; }
.bericht.denkt { font-style: italic; color: var(--zacht); background: transparent; }
.voorstel {
  align-self: flex-start; max-width: 90%;
  border: 1px solid var(--accent); border-radius: 12px; padding: 10px; background: #fff;
}
.voorstel .v-naam { font-weight: 700; }
.voorstel .v-meta { font-size: 12px; color: var(--zacht); margin: 2px 0 6px; }
.voorstel button { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 7px 12px; cursor: pointer; font-weight: 600; }
.voorstel button:disabled { background: var(--zacht); }
#chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--rand); align-items: flex-end; }
#chat-input { flex: 1; resize: none; padding: 8px; border: 1px solid var(--rand); border-radius: 8px; font: inherit; }

/* Inspreken */
.veld-met-mic { position: relative; }
.veld-met-mic textarea { width: 100%; padding: 8px 40px 8px 8px; border: 1px solid var(--rand); border-radius: 8px; font: inherit; resize: vertical; }
.mic-knop {
  border: 1px solid var(--rand); background: #fff; border-radius: 8px;
  width: 34px; height: 34px; font-size: 16px; cursor: pointer; flex: 0 0 auto;
}
.veld-met-mic .mic-knop { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; }
.mic-knop:disabled { opacity: 0.4; cursor: default; }
.mic-knop.opnemen { background: var(--eten); color: #fff; border-color: var(--eten); animation: pols 1s infinite; }
@keyframes pols { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
.mic-status { font-size: 12px; color: var(--accent); margin-left: 6px; }
#chat-verstuur { border: 0; border-radius: 8px; background: var(--accent); color: #fff; padding: 0 14px; font-weight: 600; cursor: pointer; }

/* Overlay voor mobiel */
#overlay {
  display: none; position: absolute; inset: 0; background: rgba(0,0,0,0.35); z-index: 1000;
}
#overlay.aan { display: block; }

/* Mobiel */
@media (max-width: 860px) {
  #zijbalk, #chatpaneel {
    position: absolute; top: 0; bottom: 0; z-index: 1100;
    width: 85%; max-width: 340px;
    transform: translateX(-100%); transition: transform 0.25s ease;
  }
  #zijbalk { left: 0; }
  #chatpaneel { right: 0; left: auto; transform: translateX(100%); }
  #zijbalk.open { transform: translateX(0); }
  #chatpaneel.open { transform: translateX(0); }
  #kaart { width: 100%; }
}

@media (min-width: 861px) {
  #menu-knop, #chat-knop, #chat-sluit { display: none; }
}
