/*
  Visitivo static layout prototype.
  Four visible panes: events, map, plan, ads.
*/

:root {
  color-scheme: light;
  --navy-900: #04142b;
  --navy-800: #08244b;
  --navy-700: #123b74;
  --navy-600: #1d5aa8;
  --navy-500: #3b82f6;
  --gold-700: #d9981e;
  --gold-600: #f9b233;
  --gold-500: #ffbf3f;
  --gold-400: #ffd166;
  --gold-300: #ffe6a3;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #d1d5db;
  --text: #1f2937;
  --muted: #6b7280;
  --muted-soft: #9ca3af;
  --primary: var(--navy-800);
  --primary-strong: var(--navy-900);
  --primary-soft: #e8f0fb;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --info: #2563eb;
  --gold: var(--gold-600);
  --events: #f97316;
  --culture: #8b5cf6;
  --food: #ef4444;
  --kids: #06b6d4;
  --outdoor: #22c55e;
  --free: #14b8a6;
  --evening: #4f46e5;
  --shadow: 0 8px 24px rgb(8 36 75 / 9%);
  --radius: 8px;
  --space: 16px;
  --z-map-overlay: 500;
  --z-modal: 3000;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  height: 100vh;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
}

body.has-open-modal {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

p,
h2 {
  margin: 0;
}

p,
small {
  color: var(--muted);
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  overflow: hidden;
}

.topbar,
.searchbar,
.filterbar,
.footer {
  display: flex;
  align-items: center;
  gap: var(--space);
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.searchbar,
.filterbar {
  row-gap: 12px;
}

.topbar {
  justify-content: space-between;
  border-color: var(--primary-strong);
  background: var(--primary);
  color: #ffffff;
}

.brand,
.language-switcher,
.row,
.filterbar,
.pager {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-size: 20px;
  font-weight: 760;
  color: #ffffff;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 9px;
  object-fit: contain;
  flex: 0 0 auto;
  box-shadow: 0 4px 12px rgb(4 20 43 / 22%);
}

.language-switcher,
.filterbar,
.row,
.pager {
  gap: 8px;
}

.language-switcher,
.row,
.pager {
  flex-wrap: wrap;
}

.filterbar {
  flex-wrap: nowrap;
  min-height: 61px;
  overflow: hidden;
}

.filterbar .chip {
  flex: 0 0 auto;
}

.language-link {
  min-width: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 10%);
  color: #ffffff;
}

.searchbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 160px 160px auto;
}

.input {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.field {
  display: grid;
  gap: 4px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(8 36 75 / 14%);
}

.button,
.chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-weight: 700;
}

.button {
  background: var(--primary);
  color: #ffffff;
}

.button:hover {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
}

.button--secondary,
.chip {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.chip[data-active="true"] {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(360px, 1fr) minmax(180px, 240px) minmax(160px, 220px);
}

.pane {
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.pane:last-child {
  border-right: 0;
}

.pane--events,
.pane--plan {
  overflow: auto;
}

.pane-header,
.compact-list,
.ad-box {
  display: grid;
  gap: 10px;
}

.pane-header {
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.plan-actions {
  display: grid;
  gap: 8px;
}

.plan-actions .button {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.pane-progress {
  height: 3px;
  overflow: hidden;
  background: var(--gold-300);
}

.pane-progress[hidden] {
  display: none;
}

.pane-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: 999px;
  background: var(--gold);
  animation: pane-progress 0.9s ease-in-out infinite;
}

@keyframes pane-progress {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(250%);
  }
}

.compact-list {
  padding: 12px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.count {
  font-size: 14px;
}

.plan-meta:empty {
  display: none;
}

.event-box,
.ad-box,
.modal-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.event-box {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 12px;
  text-align: left;
}

.event-main {
  display: grid;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.event-box span,
.event-main span {
  font-weight: 750;
  line-height: 1.25;
}

.event-state {
  justify-self: start;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.category-tag {
  justify-self: start;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.category-tag--event {
  background: #ffedd5;
  color: var(--events);
}

.category-tag--events {
  background: #ffedd5;
  color: var(--events);
}

.category-tag--culture {
  background: #ede9fe;
  color: var(--culture);
}

.category-tag--food {
  background: #fee2e2;
  color: var(--food);
}

.category-tag--kids {
  background: #cffafe;
  color: var(--kids);
}

.category-tag--outdoor {
  background: #dcfce7;
  color: var(--outdoor);
}

.category-tag--free {
  background: #ccfbf1;
  color: var(--free);
}

.category-tag--evening {
  background: #e0e7ff;
  color: var(--evening);
}

.category-tag--open-now {
  background: #dcfce7;
  color: var(--success);
}

.event-box.is-pinned {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.event-box.is-selected {
  outline: 3px solid rgb(249 178 51 / 28%);
}

.event-box--skeleton {
  min-height: 96px;
  overflow: hidden;
  box-shadow: none;
}

.event-box--skeleton::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 65%), transparent);
  animation: skeleton-sheen 1.1s ease-in-out infinite;
}

.skeleton-line {
  display: block;
  height: 11px;
  border-radius: 999px;
  background: #e5e7eb;
}

.skeleton-line--title {
  width: 72%;
  height: 14px;
}

.skeleton-line--meta {
  width: 54%;
}

.skeleton-line--short {
  width: 34%;
}

@keyframes skeleton-sheen {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.trust-line {
  color: var(--muted);
  font-size: 12px;
}

.event-preview {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  z-index: 5;
  width: 240px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.event-box:hover .event-preview {
  display: block;
}

.pager {
  position: sticky;
  bottom: 0;
  justify-content: space-between;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
}

.pane--map {
  background: #dbeafe;
}

.map-placeholder,
.small-map,
.large-map {
  position: relative;
  display: block;
  width: 100%;
  min-height: 100%;
  border: 0;
  color: inherit;
  text-align: left;
  background: #dbeafe;
}

.map-card {
  position: absolute;
  left: 58px;
  top: 16px;
  z-index: var(--z-map-overlay);
  width: min(230px, calc(100% - 32px));
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 92%);
  box-shadow: var(--shadow);
}

.map-card-text {
  display: none;
}

.map-progress {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: var(--z-map-overlay);
  height: 4px;
  overflow: hidden;
  background: rgb(255 255 255 / 62%);
}

.map-progress[hidden] {
  display: none;
}

.map-progress span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: 999px;
  background: var(--gold);
  animation: map-progress 1s ease-in-out infinite;
}

@keyframes map-progress {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(280%);
  }
}

.map-mode {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.map-mode-button {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.map-mode-button[data-active="true"] {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.map-hint {
  color: var(--primary);
  font-size: 12px;
  font-weight: 750;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 1px rgb(8 36 75 / 18%);
}

.legend-dot--planned {
  border-color: var(--text);
  box-shadow: 0 0 0 2px rgb(8 36 75 / 14%);
}

.map-expand {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: var(--z-map-overlay);
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 94%);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.leaflet-map {
  width: 100%;
  height: 100%;
  min-height: inherit;
  border-radius: inherit;
  font: inherit;
}

.pane--map .map-placeholder,
.pane--map .leaflet-map {
  height: 100%;
  min-height: 420px;
}

.leaflet-container {
  background: #dbeafe;
  color: var(--text);
  font: inherit;
}

.leaflet-control-attribution {
  font-size: 10px;
}

.map-pin {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 3px solid var(--surface);
  border-radius: 999px;
  background: var(--primary);
  box-shadow: var(--shadow);
}

.map-pin--planned {
  background: var(--gold);
}

.map-pin--selected {
  width: 22px;
  height: 22px;
  outline: 4px solid rgb(249 178 51 / 28%);
}

.map-pin--one {
  left: 66%;
  top: 58%;
}

.map-pin--two {
  left: 52%;
  top: 72%;
  background: var(--gold);
}

.map-pin--three {
  left: 76%;
  top: 28%;
}

.map-pin--culture {
  background: var(--culture);
}

.map-pin--food {
  background: var(--food);
}

.map-pin--outdoor {
  background: var(--outdoor);
}

.map-pin--events {
  background: var(--events);
}

.map-pin--kids {
  background: var(--kids);
}

.map-pin--free {
  background: var(--free);
}

.map-pin--evening {
  background: var(--evening);
}

.map-pin--open-now {
  background: var(--success);
}

.visitivo-marker {
  position: absolute;
  border: 3px solid var(--surface);
  border-radius: 999px;
  background: var(--primary);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.visitivo-marker.map-pin--events,
.visitivo-cluster.map-pin--events {
  background: var(--events);
}

.visitivo-marker.map-pin--culture,
.visitivo-cluster.map-pin--culture {
  background: var(--culture);
}

.visitivo-marker.map-pin--food,
.visitivo-cluster.map-pin--food {
  background: var(--food);
}

.visitivo-marker.map-pin--kids,
.visitivo-cluster.map-pin--kids {
  background: var(--kids);
}

.visitivo-marker.map-pin--outdoor,
.visitivo-cluster.map-pin--outdoor {
  background: var(--outdoor);
}

.visitivo-marker.map-pin--free,
.visitivo-cluster.map-pin--free {
  background: var(--free);
}

.visitivo-marker.map-pin--evening,
.visitivo-cluster.map-pin--evening {
  background: var(--evening);
}

.visitivo-marker.map-pin--open-now,
.visitivo-cluster.map-pin--open-now {
  background: var(--success);
}

.visitivo-marker--planned {
  border-color: var(--text);
  box-shadow:
    0 0 0 3px rgb(8 36 75 / 13%),
    var(--shadow);
}

.visitivo-marker--planned::after {
  position: absolute;
  right: -5px;
  top: -6px;
  width: 12px;
  height: 12px;
  display: grid;
  place-items: center;
  border: 1px solid var(--surface);
  border-radius: 999px;
  background: var(--gold);
  color: #ffffff;
  content: "✓";
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
}

.visitivo-marker--selected {
  outline: 4px solid rgb(249 178 51 / 28%);
}

.visitivo-cluster--selected {
  outline: 4px solid rgb(249 178 51 / 28%);
}

.visitivo-cluster {
  position: absolute;
  display: grid;
  place-items: center;
  border: 3px solid var(--surface);
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.visitivo-cluster--planned {
  border-color: var(--text);
  box-shadow:
    0 0 0 3px rgb(8 36 75 / 13%),
    var(--shadow);
}

.visitivo-cluster--planned::after {
  position: absolute;
  right: -4px;
  top: -5px;
  width: 13px;
  height: 13px;
  display: grid;
  place-items: center;
  border: 1px solid var(--surface);
  border-radius: 999px;
  background: var(--gold);
  color: #ffffff;
  content: "✓";
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
}

.visitivo-cluster span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.venue-popup .leaflet-popup-content {
  margin: 10px;
}

.venue-popup-list {
  display: grid;
  gap: 8px;
}

.venue-popup-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.venue-popup-event {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.venue-popup-event:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.venue-popup-event strong {
  font-size: 13px;
  line-height: 1.25;
}

.venue-popup-event span,
.venue-popup-more {
  color: var(--muted);
  font-size: 12px;
}

.ad-box {
  margin: 12px;
  padding: 14px;
  background: var(--bg);
  box-shadow: none;
}

.ad-box strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.footer {
  justify-content: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.modal {
  display: none;
}

.modal.is-open {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgb(4 20 43 / 58%);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  display: grid;
  gap: var(--space);
  padding: 20px;
}

.modal-close {
  justify-self: end;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.modal-date {
  color: var(--primary);
  font-size: 14px;
  font-weight: 800;
}

#modal-description {
  max-height: min(420px, 52vh);
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.modal-list-pager {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 96%);
}

.modal-list-pager span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.modal-list-pager .button {
  min-height: 32px;
  padding: 0 10px;
}

.venue-popup-event--loading {
  pointer-events: none;
}

.modal-card--map {
  width: min(900px, 100%);
  max-height: min(780px, calc(100vh - 48px));
}

.small-map {
  min-height: 220px;
  border-radius: var(--radius);
}

.large-map {
  min-height: 560px;
  border-radius: var(--radius);
}

.empty-state {
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
}

.print-plan {
  display: none;
}

@media (max-width: 1050px) {
  body,
  .app-shell {
    height: auto;
    overflow: visible;
  }

  .app-shell {
    grid-template-columns: minmax(240px, 320px) minmax(320px, 1fr);
    grid-template-rows: auto auto auto auto minmax(420px, 1fr) auto auto;
  }

  .topbar,
  .searchbar,
  .filterbar,
  .footer {
    grid-column: 1 / -1;
  }

  .searchbar {
    grid-template-columns: minmax(260px, 1fr) minmax(180px, 260px) minmax(150px, 1fr) minmax(150px, 1fr);
  }

  .searchbar .button {
    width: 100%;
  }

  .workspace {
    display: contents;
  }

  .pane {
    border-top: 0;
  }

  .pane--ads {
    grid-column: 1 / -1;
    grid-row: 4;
    display: flex;
    align-items: stretch;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .pane--ads .pane-header {
    min-width: 150px;
    border-bottom: 0;
    border-right: 1px solid var(--border);
  }

  .pane--ads .ad-box {
    flex: 1;
    min-width: 180px;
  }

  .pane--events {
    grid-column: 1;
    grid-row: 5;
    min-height: 0;
    border-right: 1px solid var(--border);
  }

  .pane--map {
    grid-column: 2;
    grid-row: 5;
    min-height: 420px;
    border-right: 0;
  }

  .pane--plan {
    grid-column: 1 / -1;
    grid-row: 6;
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 0;
    border-top: 1px solid var(--border);
  }

  .pane--plan .pane-header {
    border-bottom: 0;
    border-right: 1px solid var(--border);
  }

  .footer {
    grid-row: 7;
  }
}

@media (max-width: 900px) {
  .topbar,
  .searchbar,
  .filterbar {
    padding: 12px 16px;
  }

  .app-shell,
  .searchbar {
    grid-template-columns: 1fr;
  }

  .app-shell {
    display: grid;
    grid-template-rows: auto auto auto auto auto auto auto auto;
  }

  .workspace {
    display: contents;
  }

  .pane--ads {
    grid-row: 4;
    display: block;
  }

  .pane--ads .ad-box {
    min-width: 0;
  }

  .pane--events {
    grid-row: 5;
  }

  .pane--map {
    grid-row: 6;
    height: 320px;
    min-height: 320px;
  }

  .pane--map .map-placeholder {
    height: 320px;
    min-height: 320px;
  }

  .pane--map .leaflet-map {
    height: 320px;
    min-height: 320px;
  }

  .pane--plan {
    grid-row: 7;
    display: block;
  }

  .pane {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .pane--ads .pane-header,
  .pane--plan .pane-header {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .pane--plan .pane-header {
    gap: 8px;
    padding: 12px 16px;
  }

  .event-preview {
    display: none;
  }

  .button {
    width: 100%;
  }

  .pager .button {
    width: auto;
  }
}

@media print {
  .topbar,
  .searchbar,
  .filterbar,
  .pane--events,
  .pane--map,
  .pane--ads,
  .footer,
  .modal {
    display: none;
  }

  .app-shell,
  .workspace {
    display: block;
  }

  .pane--plan {
    border: 0;
  }

  .pane--plan .pane-header,
  #plan-list {
    display: none;
  }

  .print-plan {
    display: block;
    padding: 0;
  }

  .print-plan h1 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 24px;
  }

  .print-plan-meta {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 13px;
  }

  .print-event-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 22px;
  }

  .print-event-list li {
    break-inside: avoid;
    padding: 8px 0;
  }

  .print-event-list strong,
  .print-event-list span,
  .print-event-list address {
    display: block;
  }

  .print-event-list strong {
    color: var(--text);
    font-size: 15px;
  }

  .print-event-list span {
    color: var(--muted);
    font-size: 12px;
  }

  .print-event-list address {
    margin-top: 3px;
    color: var(--text);
    font-size: 13px;
    font-style: normal;
  }
}
