/* ═══════════════════════════════════════════════════════ */
/*  HORIZON DESIGN SYSTEM — Editorial Nature Aesthetic     */
/*  Tokens from DESIGN.md + Mobile/Desktop UI (image.png)  */
/* ═══════════════════════════════════════════════════════ */

:root {
  --color-canvas: #F8F6F0;
  --color-surface: #FFFFFF;
  --color-soft: #F2EFE9;
  --color-strong: #E5E2D9;
  --color-ink: #181D26;
  --color-body: #333840;
  --color-muted: #6B7280;
  --color-forest: #0A2E0E;
  --color-forest-deep: #14381C;
  --color-forest-card: #1E3E28;
  --color-coral: #AA2D00;
  --color-cream: #F5E9D4;
  --color-peach: #FCAB79;
  --color-mint: #A8D8C4;
  --color-yellow: #F4D35E;
  --color-hairline: #E5E7EB;
  --color-hairline-warm: #E5E0D5;
}

* {
  box-sizing: border-box;
}

html {
  background-color: var(--color-canvas);
  color: var(--color-ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background-color: var(--color-canvas);
  color: var(--color-ink);
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════ */
/*  TIMELINE STEPPER CONNECTORS (from image.png screen 3)  */
/* ═══════════════════════════════════════════════════════ */

.timeline-connector {
  position: relative;
}

.timeline-connector::before {
  content: '';
  position: absolute;
  top: 36px;
  bottom: -18px;
  left: 17px;
  width: 2px;
  border-left: 2px dashed #CBD5E1;
  z-index: 0;
}

.timeline-connector:last-child::before {
  display: none;
}

/* Pulsing ring on active stop (image.png Screen 3 Step 2) */
.badge-active-pulse {
  box-shadow: 0 0 0 4px rgba(170, 45, 0, 0.2);
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(170, 45, 0, 0.25);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(170, 45, 0, 0.08);
  }
}

/* Custom scrollbar for warm linen canvas */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9CA3AF;
}

/* Utilities to hide scrollbars completely on rails and carousels */
.scrollbar-none::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.scrollbar-none,
.no-scrollbar {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

/* ═══════════════════════════════════════════════════════ */
/*  LEAFLET MAP PINS (Styled matching image.png badges)    */
/* ═══════════════════════════════════════════════════════ */

.custom-trip-marker {
  display: flex !important;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
}

.custom-pin-inner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 4px 12px rgba(10, 46, 14, 0.25);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.custom-pin-inner:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 16px rgba(10, 46, 14, 0.35);
}

.custom-pin-inner.is-selected {
  width: 36px;
  height: 36px;
  background-color: var(--color-coral) !important;
  font-size: 14px;
  border-width: 3px;
  box-shadow: 0 0 0 5px rgba(170, 45, 0, 0.25), 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
  border-radius: 14px !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid var(--color-hairline-warm, #E6E2D8) !important;
  padding: 3px !important;
  background: #FFFFFF !important;
  overflow: hidden !important;
}

.leaflet-popup-content {
  margin: 5px 6px !important;
  min-width: 170px !important;
  max-width: 220px !important;
  width: auto !important;
  box-sizing: border-box !important;
}

.leaflet-popup-content img {
  max-width: 100% !important;
  display: block;
}

/* Compact Popup Layout on Small & Mobile Screens */
.custom-map-popup-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-family: inherit;
  box-sizing: border-box;
}

.custom-map-popup-inner .popup-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background-color: #1E3A2B;
}

.custom-map-popup-inner .popup-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.custom-map-popup-inner .popup-info {
  min-width: 0;
  flex: 1;
}

.custom-map-popup-inner .popup-stop-tag {
  font-size: 9px;
  font-weight: 700;
  color: #1E3A2B;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.1;
}

.custom-map-popup-inner .popup-title {
  font-size: 11px;
  font-weight: 800;
  color: #1B221B;
  margin: 1px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-map-popup-inner .popup-meta {
  font-size: 9px;
  color: #71766F;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-map-popup-inner .popup-price {
  font-size: 10px;
  font-weight: 800;
  color: #E26D38;
  margin-top: 1px;
}

.custom-map-popup-inner .popup-maps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  background-color: #1E3A2B;
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: all 0.15s ease;
  cursor: pointer;
}

.custom-map-popup-inner .popup-maps-btn:hover {
  background-color: #14281E;
  color: #ffffff !important;
  transform: translateY(-0.5px);
}

@media (min-width: 640px) {
  .leaflet-popup-content {
    min-width: 190px !important;
    max-width: 240px !important;
  }
  .custom-map-popup-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .custom-map-popup-inner .popup-thumb {
    width: 100%;
    height: 80px;
  }
  .custom-map-popup-inner .popup-stop-tag {
    font-size: 10px;
  }
  .custom-map-popup-inner .popup-title {
    font-size: 12px;
  }
  .custom-map-popup-inner .popup-meta {
    font-size: 10px;
  }
}

.leaflet-container a.leaflet-popup-close-button {
  top: 6px !important;
  right: 6px !important;
  width: 18px !important;
  height: 18px !important;
  background: rgba(0, 0, 0, 0.5) !important;
  color: #FFFFFF !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  font-family: inherit !important;
  padding: 0 !important;
  z-index: 10 !important;
  backdrop-filter: blur(2px) !important;
  transition: background-color 0.15s ease !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important;
}

.leaflet-container a.leaflet-popup-close-button:hover {
  background: rgba(0, 0, 0, 0.8) !important;
  color: #FFFFFF !important;
}

.leaflet-popup-tip {
  background: #FFFFFF !important;
}

/* Position attribution above floating bottom waypoints bar */
.leaflet-bottom.leaflet-right .leaflet-control-attribution {
  margin-bottom: 46px !important;
  margin-right: 8px !important;
  padding: 1px 6px !important;
  font-size: 8px !important;
  background: rgba(255, 255, 255, 0.75) !important;
  backdrop-filter: blur(4px) !important;
  border-radius: 4px !important;
}

/* ═══════════════════════════════════════════════════════ */
/*  LEAFLET ZOOM CONTROL STYLING & POSITIONING            */
/* ═══════════════════════════════════════════════════════ */

.leaflet-top.leaflet-right {
  top: 12px !important;
  right: 12px !important;
  z-index: 500 !important;
}

.leaflet-touch .leaflet-bar,
.leaflet-bar {
  border: 1px solid var(--color-hairline-warm, #E6E2D8) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08) !important;
  overflow: hidden !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(8px) !important;
}

.leaflet-touch .leaflet-bar a,
.leaflet-bar a {
  background-color: #FFFFFF !important;
  color: #1B221B !important;
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  text-align: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
  border-bottom: 1px solid var(--color-hairline-warm, #E6E2D8) !important;
}

.leaflet-touch .leaflet-bar a:last-child,
.leaflet-bar a:last-child {
  border-bottom: none !important;
}

.leaflet-touch .leaflet-bar a:hover,
.leaflet-bar a:hover {
  background-color: #FAF9F5 !important;
  color: #E26D38 !important;
}

.leaflet-touch .leaflet-bar a.leaflet-disabled,
.leaflet-bar a.leaflet-disabled {
  color: #BBB8AF !important;
  background-color: #FAF9F5 !important;
  cursor: default !important;
}

/* Fallback: If any zoom control is in top-left, push it below the telemetry badges */
.leaflet-top.leaflet-left .leaflet-control-zoom {
  margin-top: 76px !important;
}

/* ═══════════════════════════════════════════════════════ */
/*  PRINT STYLING                                         */
/* ═══════════════════════════════════════════════════════ */

@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  header, #btn-share, #btn-print, .no-print {
    display: none !important;
  }
  main {
    padding: 0 !important;
    display: block !important;
  }
}
