/* ===================================================================
   Zoo, Garden & Museum Spots — theme + layout
   Same flatly/darkly palette as the other apps in this family.
   =================================================================== */

:root { --pad: 10px; --radius: 6px; }

.theme-light {
  --bg: #ffffff;
  --panel-bg: #f8f9fa;
  --panel-border: #dee2e6;
  --input-bg: #ffffff;
  --input-fg: #212529;
  --input-border: #ced4da;
  --muted: #6c757d;
  --title-fg: #2c3e50;
  --primary: #2c3e50;
  --primary-fg: #ffffff;
  --sel-bg: #e8f4fd;
  --warn-bg: #fff3b0;
  --shadow: 0 1px 3px rgba(0,0,0,.12);
}
.theme-dark {
  --bg: #222222;
  --panel-bg: #2b2b2b;
  --panel-border: #3a3a3a;
  --input-bg: #303030;
  --input-fg: #e9ecef;
  --input-border: #4a4a4a;
  --muted: #adb5bd;
  --title-fg: #e9ecef;
  --primary: #375a7f;
  --primary-fg: #ffffff;
  --sel-bg: #2f4257;
  --warn-bg: #5a4b1f;
  --shadow: 0 1px 3px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--input-fg);
  font: 14px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  display: flex; flex-direction: column; overflow: hidden;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
a { color: #3498db; }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px var(--pad); background: var(--panel-bg); border-bottom: 1px solid var(--panel-border);
}
.brand { font-size: 18px; font-weight: 600; color: var(--title-fg); white-space: nowrap; }
.brand-mark { margin-right: 2px; }
.place-form { display: flex; gap: 6px; flex: 1 1 320px; min-width: 0; }
.place-form .input { flex: 1 1 auto; min-width: 0; }
.topbar-right { display: flex; gap: 6px; flex-wrap: wrap; }

.input {
  background: var(--input-bg); color: var(--input-fg); border: 1px solid var(--input-border);
  border-radius: var(--radius); padding: 7px 10px; font: inherit; min-width: 0;
}
.input:focus { outline: 2px solid #3498db55; border-color: #3498db; }
.btn {
  border-radius: var(--radius); border: 1px solid transparent; padding: 7px 14px; font: inherit;
  cursor: pointer; white-space: nowrap; min-height: 34px;
}
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-outline { background: transparent; color: var(--input-fg); border-color: var(--input-border); }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:disabled { opacity: .45; cursor: default; }

/* ---- layout ---- */
.layout { flex: 1 1 auto; display: flex; min-height: 0; }
.map-wrap { flex: 1 1 auto; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: #ddd; }
.theme-dark #map { background: #1b1b1b; }
.theme-dark .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9); }
.side {
  flex: 0 0 340px; overflow-y: auto; padding: var(--pad); display: flex; flex-direction: column; gap: var(--pad);
  background: var(--bg); border-left: 1px solid var(--panel-border);
}
.status {
  position: absolute; left: 50%; transform: translateX(-50%); top: 10px; z-index: 900;
  background: var(--panel-bg); color: var(--input-fg); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 6px 12px; box-shadow: var(--shadow); max-width: 90%;
}

/* ---- panels ---- */
.panel { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: var(--pad); }
.list-panel { display: flex; flex-direction: column; min-height: 240px; flex: 1 1 auto; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.panel-title { margin: 0; font-size: 14px; color: var(--title-fg); text-transform: uppercase; letter-spacing: .04em; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: #3498db; }

.program-list { display: flex; flex-direction: column; gap: 4px; }
.program {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: var(--radius); cursor: pointer;
}
.program:hover { background: var(--sel-bg); }
.program input { width: 18px; height: 18px; accent-color: var(--c); flex: none; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px #0004; flex: none; }
.program-text { flex: 1 1 auto; min-width: 0; }
.program-name { font-weight: 600; }
.program-sub { font-size: 12px; color: var(--muted); }

.home-row { display: flex; gap: 6px; }

.list-panel .input { width: 100%; margin-bottom: 6px; }
.venue-list { overflow-y: auto; flex: 1 1 auto; min-height: 0; max-height: 46vh; }
.venue {
  display: flex; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--panel-border); cursor: pointer; align-items: flex-start;
}
.venue:hover { background: var(--sel-bg); }
.venue .dot { margin-top: 3px; }
.venue-name { font-weight: 600; }
.venue-sub { font-size: 12px; color: var(--muted); }
.venue.excluded .venue-name { color: var(--muted); }
.empty { color: var(--muted); padding: 10px 4px; }

/* ---- map popups ---- */
.pop h3 { margin: 0 0 2px; font-size: 15px; }
.pop .badge { display: inline-block; color: #fff; background: var(--c); border-radius: 10px; padding: 0 8px; font-size: 11px; margin-bottom: 4px; }
.pop p { margin: 3px 0; }
.pop .benefit { font-weight: 600; }
.pop .warn { background: #fff3b0; color: #5a4b00; border-radius: 4px; padding: 2px 6px; }
.pop .links a { margin-right: 10px; }
.theme-dark .leaflet-popup-content-wrapper, .theme-dark .leaflet-popup-tip { background: #2b2b2b; color: #e9ecef; }
.theme-dark .leaflet-container a { color: #6cb8f0; }
.leaflet-popup-content { margin: 10px 14px; min-width: 180px; }

/* ---- modal (no backdrop dismiss; explicit buttons only) ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 5000; display: flex; align-items: center; justify-content: center; padding: 12px; }
.modal { background: var(--bg); color: var(--input-fg); border-radius: 8px; width: min(720px, 100%); max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.modal-title { font-size: 18px; font-weight: 600; padding: 14px 18px 8px; color: var(--title-fg); }
.modal-body { padding: 4px 18px 10px; overflow-y: auto; }
.modal-actions { padding: 10px 18px 14px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--panel-border); }
.about-grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.about-grid dt { font-weight: 600; color: var(--muted); }
.about-grid dd { margin: 0; }
.help-h { margin: 16px 0 4px; font-size: 15px; color: var(--title-fg); }
.help-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
.help-dl dt { font-weight: 600; } .help-dl dd { margin: 0; }
.modal ul { padding-left: 20px; }

/* ---- help infographic: four steps that light up in turn ---- */
.flow { display: flex; align-items: stretch; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 4px; }
.flow-step {
  flex: 1 1 120px; max-width: 160px; text-align: center; padding: 10px 8px; border-radius: 10px;
  border: 2px solid var(--panel-border); background: var(--panel-bg); font-size: 12px; color: var(--muted);
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  animation: flow-glow 8s infinite; animation-delay: calc(var(--i) * 2s);
}
.flow-step b { color: var(--title-fg); font-size: 13px; }
.flow-icon { font-size: 28px; line-height: 1.1; }
.flow-arrow { align-self: center; font-size: 20px; color: var(--muted); }
@keyframes flow-glow {
  0%, 22% { border-color: #3498db; background: var(--sel-bg); transform: translateY(-3px); }
  26%, 100% { border-color: var(--panel-border); background: var(--panel-bg); transform: none; }
}
@media (prefers-reduced-motion: reduce) { .flow-step { animation: none; } }

/* ---- narrow screens: stack, let the page scroll ---- */
@media (max-width: 820px) {
  body { overflow: auto; display: block; height: auto; }
  html { height: auto; }
  .topbar { gap: 6px; }
  .place-form { flex-basis: 100%; order: 3; }
  .layout { display: block; }
  .map-wrap { height: 62vh; min-height: 320px; }
  .side { border-left: 0; border-top: 1px solid var(--panel-border); overflow: visible; }
  .venue-list { max-height: none; }
  .btn { min-height: 40px; }
  .program { padding: 10px 4px; }
  .modal { max-height: 96vh; }
  .flow-arrow { display: none; }
}
