:root {
  --bg: #0f1b2d;
  --bg-alt: #16273f;
  --card-bg: #1c2f4a;
  --gold: #e8b84b;
  --red: #c0392b;
  --green: #3fa66b;
  --text: #eef2f7;
  --text-muted: #9fb0c3;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at top, var(--bg-alt), var(--bg) 65%);
  color: var(--text);
  min-height: 100vh;
}

h1, h2 { font-family: inherit; margin: 0; }

.hero h1, .hero .eyebrow {
  font-family: "Mountains of Christmas", "Segoe UI", cursive;
}

#snowfall {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

.snowflake {
  position: absolute;
  top: -10%;
  color: #fff;
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
  animation-name: snow-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes snow-fall {
  to { transform: translateY(115vh) translateX(20px) rotate(360deg); }
}

.hero {
  position: relative;
  padding: 56px 24px 40px;
  text-align: center;
  background: linear-gradient(160deg, #16273f 0%, #0f1b2d 70%);
  border-bottom: 3px solid var(--gold);
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 6px;
  background: repeating-linear-gradient(
    45deg,
    var(--red) 0 10px,
    #f5f5f5 10px 20px
  );
}

.eyebrow {
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  font-size: 0.85rem;
  margin: 0 0 8px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 18px rgba(232, 184, 75, 0.35);
}

.hero-dates {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-families {
  margin-top: 6px;
  color: var(--gold);
  font-size: 0.9rem;
}

.hero-families .family-note {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
}

#layout {
  display: flex;
  align-items: flex-start;
  max-width: 1400px;
  margin: 0 auto;
}

main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

section h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
  color: var(--gold);
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-heading-row h2 { margin-bottom: 0; }

.play-btn {
  background: linear-gradient(120deg, var(--gold), #f3cd7a);
  color: #241a05;
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(232, 184, 75, 0.25);
  transition: transform 0.15s ease;
  margin-bottom: 16px;
}

.play-btn:hover { transform: translateY(-2px); }

.map-section { margin-bottom: 48px; }

#map {
  position: relative;
  z-index: 0;
  height: 420px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.map-legend {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 6px 0 16px;
  vertical-align: middle;
}
.legend-dot:first-of-type { margin-left: 0; }
.legend-dot.confirmed { background: var(--green); }
.legend-dot.proposed { background: var(--gold); }
.legend-dot.planning { background: var(--text-muted); }
.legend-dot.daytrip { background: #5aa9e6; }

/* Lettered A/B/C\u2026 badges over each unique route stop on the main map,
   showing trip direction at a glance since the dashed line alone doesn't. */
.stop-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(10, 18, 32, 0.9);
  border: 2px solid var(--gold);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.day-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.day-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.45);
}

.day-card::before {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 184, 75, 0.25), transparent 70%);
}

.day-card.confirmed { border-left: 4px solid var(--green); }
.day-card.proposed { border-left: 4px dashed var(--gold); }
.day-card.planning { border-left: 4px dashed rgba(255, 255, 255, 0.25); }

.xmas-ribbon {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--red), #e74c3c);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.day-num {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}

.day-weekday {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.day-city {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 14px;
}

.day-city.tbd { color: var(--text-muted); font-style: italic; font-weight: 400; }

.day-card.proposed .day-city { color: var(--gold); font-style: italic; }

.day-country { color: var(--text-muted); font-size: 0.9rem; }

.status-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.confirmed {
  background: rgba(63, 166, 107, 0.18);
  color: var(--green);
}

.status-badge.proposed {
  background: rgba(232, 184, 75, 0.18);
  color: var(--gold);
}

.status-badge.planning {
  background: rgba(159, 176, 195, 0.15);
  color: var(--text-muted);
}

.flight-flag {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--gold);
}

.options-flag {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.daytrip-flag {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #5aa9e6;
}

/* Modal styles removed - replaced by docked .detail-panel below */

footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 24px 0 0;
}

footer code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Detail panel - docked to the right, reflows layout instead of overlapping it */
.detail-panel {
  flex: 0 0 0;
  width: 0;
  overflow: hidden;
  align-self: stretch;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--card-bg);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.25);
  transition: width 0.25s ease;
}

.detail-panel.open {
  flex-basis: 400px;
  width: 400px;
}

#panel-content {
  width: 400px;
  height: 100%;
  overflow-y: auto;
  padding: 32px 28px;
  box-sizing: border-box;
}

.panel-placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.panel-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  z-index: 1;
}
.panel-close:hover { color: var(--text); }

.panel-content-inner h3 { margin: 0 0 4px; font-size: 1.5rem; }
.panel-content-inner .panel-sub { color: var(--text-muted); margin-bottom: 20px; }

.panel-section { margin-bottom: 18px; }
.panel-section h4 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
}
.panel-section p, .panel-section ul { margin: 0; color: var(--text); }
.panel-section ul { padding-left: 20px; }
.panel-section .empty { color: var(--text-muted); font-style: italic; }

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(232, 184, 75, 0.4);
  border-radius: 10px;
  padding: 12px 14px;
}

.option-card h5 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: var(--text);
}

.option-card ul { margin: 0; padding-left: 18px; color: var(--text); }
.option-card .empty { color: var(--text-muted); font-style: italic; margin: 0; }

.option-note {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
}

.accommodation-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.accommodation-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(232, 184, 75, 0.12);
  color: var(--gold);
  border: 1px solid rgba(232, 184, 75, 0.35);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.accommodation-link:hover { background: rgba(232, 184, 75, 0.22); }

@media (max-width: 900px) {
  .detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 60;
    box-shadow: -12px 0 30px rgba(0, 0, 0, 0.5);
  }
  .detail-panel.open { width: min(100vw, 400px); }
}

/* Timeline animation overlay */
.timeline-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 11, 20, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.timeline-overlay.open { display: flex; }

.timeline-modal {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 24px;
  width: min(720px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.timeline-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.timeline-modal-header h3 {
  margin: 0;
  color: var(--gold);
  font-size: 1.2rem;
}

.timeline-modal .panel-close {
  position: static;
  font-size: 1.4rem;
}

.timeline-map-wrap {
  position: relative;
}

#timeline-map {
  position: relative;
  z-index: 0;
  height: 360px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Big "day" badge overlaid on the timeline map \u2013 pops with each new date */
.timeline-date-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 650;
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: rgba(10, 18, 32, 0.72);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(232, 184, 75, 0.45);
  border-radius: 14px;
  padding: 6px 16px 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.timeline-date-num {
  font-family: "Mountains of Christmas", cursive;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.timeline-date-weekday {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.timeline-date-badge.pop { animation: timeline-badge-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }

@keyframes timeline-badge-pop {
  0% { transform: scale(0.6) translateY(-6px); opacity: 0.3; }
  60% { transform: scale(1.12) translateY(0); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Festive "postcard" that cycles through moments during idle/stay days */
.timeline-visual-card {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translate(-50%, 12px);
  z-index: 650;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(90%, 380px);
  background: rgba(10, 18, 32, 0.82);
  border: 1px solid rgba(232, 184, 75, 0.4);
  border-radius: 999px;
  padding: 8px 18px 8px 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.timeline-visual-card.show {
  opacity: 1;
  transform: translate(-50%, 0);
  animation: timeline-visual-pop 0.5s ease;
}

@keyframes timeline-visual-pop {
  0% { transform: translate(-50%, 10px) scale(0.92); opacity: 0; }
  100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

.timeline-visual-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex: none;
}

.timeline-visual-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
}

.timeline-visual-text strong {
  color: var(--gold);
  font-size: 0.85rem;
}

.timeline-visual-text span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.timeline-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.timeline-btn {
  background: rgba(232, 184, 75, 0.12);
  color: var(--gold);
  border: 1px solid rgba(232, 184, 75, 0.35);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.timeline-btn:hover { background: rgba(232, 184, 75, 0.22); }

.timeline-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-left: auto;
}

.traveler-marker {
  display: block;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
  transition: left 0.05s linear, top 0.05s linear;
}

.traveler-marker svg { display: block; }

.leaflet-tooltip.traveler-tooltip {
  background: rgba(28, 47, 74, 0.9);
  color: var(--text);
  border: none;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  box-shadow: none;
}
.leaflet-tooltip.traveler-tooltip::before { display: none; }
