/* +15 GO: Calgary-sunset theme. Colours mirror COLORS in app.py. */
:root {
  --violet: #7b2ff7;
  --magenta: #ff2e88;
  --orange: #ff8a00;
  --gold: #ffc93c;
  --lavender: #b388ff;
  --ink: #1b1035;
  --muted: #6b5d86;
  --line: rgba(123, 47, 247, .14);
  --glass: rgba(255, 255, 255, .86);
  --sunset: linear-gradient(120deg, var(--violet) 0%, var(--magenta) 55%, var(--orange) 100%);
  --sunset-soft: linear-gradient(120deg, #f1e8ff 0%, #ffe6f1 55%, #fff1df 100%);
  --shadow: 0 10px 30px rgba(59, 16, 120, .22);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #f4efff;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); }
button { font-family: inherit; }

.app { position: relative; height: 100vh; height: 100dvh; }
#map { position: absolute; inset: 0; z-index: 0; background: #f4efff; }
/* Soft lavender-tinted basemap so the sunset-coloured routes and network stand out. */
.leaflet-tile-pane { filter: saturate(.45) brightness(1.06) contrast(.92) sepia(.12) hue-rotate(215deg); }

/* ---- search card ---- */
.search-card {
  position: absolute; z-index: 1000; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px;
  max-width: 440px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 22px; padding: 12px 12px 8px; box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .7);
}
.search-card::before { /* sunset stripe along the top edge */
  content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--sunset);
}
.brand { display: flex; align-items: center; gap: 10px; margin: 2px 2px 10px; }
.logo {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; flex: none;
  background: var(--sunset); color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -.5px;
  box-shadow: 0 6px 16px rgba(255, 46, 136, .4);
}
.brand > div { display: flex; flex-direction: column; line-height: 1.1; }
.wordmark { font-weight: 800; font-size: 22px; letter-spacing: -.5px;
  background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { font-size: 12px; color: var(--muted); font-weight: 600; }

.search-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.search-row .dash-dropdown-wrapper { flex: 1; min-width: 0; }
.place { width: 100%; font-size: 16px; /* 16px stops iOS zooming on focus */ }
.place .dash-dropdown-grid-container { border-radius: 14px; border-color: var(--line); background: #fff; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.dot-from { border: 3.5px solid var(--violet); background: #fff; }
.dot-to { background: var(--sunset); box-shadow: 0 0 0 3px rgba(255, 46, 136, .2); }
.icon-btn {
  flex: none; width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--sunset-soft); color: var(--violet); font-size: 18px; font-weight: 700;
  transition: transform .2s;
}
.icon-btn:active { transform: rotate(180deg); }
.tap-row { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); padding: 2px 4px; }
.tap-mode { display: flex; gap: 6px; }
.tap-mode label { display: inline-flex; align-items: center; cursor: pointer; padding: 4px 10px; border-radius: 999px;
  background: #f4efff; color: var(--ink); }
.tap-mode label:has(input:checked) { background: var(--sunset); color: #fff; }
.tap-mode input { display: none; }

/* ---- floating controls ---- */
.locate-btn {
  position: absolute; z-index: 1000; right: 14px; bottom: calc(min(46vh, 400px) + 16px);
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--sunset); color: #fff; font-size: 26px; box-shadow: 0 8px 20px rgba(255, 46, 136, .45);
}
.leaflet-bottomright { bottom: calc(min(46vh, 400px) + 76px) !important; }
.leaflet-touch .leaflet-bar { border: none; box-shadow: var(--shadow); border-radius: 14px; overflow: hidden; }
.leaflet-touch .leaflet-bar a { color: var(--violet); font-weight: 700; }
.leaflet-control-attribution { font-size: 10px; border-radius: 8px 0 0 0; }

.toast {
  position: absolute; z-index: 1100; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---- bottom sheet ---- */
.sheet {
  position: absolute; z-index: 1000; left: 0; right: 0; bottom: 0; max-height: min(46vh, 400px);
  overflow-y: auto; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: 26px 26px 0 0; padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 30px rgba(59, 16, 120, .18);
}
.sheet::before { content: ""; display: block; width: 42px; height: 5px; border-radius: 3px;
  background: var(--sunset); opacity: .5; margin: 0 auto 10px; }
@media (min-width: 900px) {
  .sheet { left: 12px; right: auto; width: 440px; bottom: 12px; border-radius: 22px; max-height: 56vh; }
  .locate-btn { bottom: 24px; right: 24px; }
  .leaflet-bottomright { bottom: 84px !important; }
}

.hero { padding: 2px 2px 6px; }
.hero-title { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.hero-sub { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
  padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: transform .15s, box-shadow .15s;
}
.chip:hover, .chip:active { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(123, 47, 247, .18); }

.status .hint { color: var(--muted); font-size: 14px; padding: 4px 2px 8px; }
.status .trip { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; margin: 0 2px 10px; min-width: 0; }
.trip-from, .trip-to { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.trip-arrow { flex: none; color: var(--magenta); }
.status .warn { background: linear-gradient(120deg, #fff4d6, #ffe3ef); color: #7a3a00; font-size: 13px;
  border-radius: 14px; padding: 9px 12px; margin-bottom: 10px; }

/* Route options swipe sideways on phones, Google-Maps style. */
.route-cards { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 8px;
  scrollbar-width: none; }
.route-cards::-webkit-scrollbar { display: none; }
.route-card {
  flex: 0 0 min(78%, 260px); scroll-snap-align: start; text-align: left; cursor: pointer; color: inherit;
  border: 2px solid transparent; border-radius: 20px; padding: 12px 14px; background: #fff;
  box-shadow: 0 4px 14px rgba(59, 16, 120, .1); transition: transform .15s;
}
.route-card:active { transform: scale(.98); }
.route-card.selected {
  background: linear-gradient(#fff, #fff) padding-box, var(--sunset) border-box;
  box-shadow: 0 10px 24px rgba(255, 46, 136, .25);
}
.route-card .row0 { display: flex; justify-content: space-between; align-items: center; }
.tag { font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 999px; letter-spacing: .2px; }
.tag-warm { background: #f1e8ff; color: var(--violet); }
.tag-fast { background: #ffe6f1; color: #c4005f; }
.tag-street { background: #fff1df; color: #b35c00; }
.route-card .dist { color: var(--muted); font-size: 13px; font-weight: 600; }
.route-card .time { font-size: 28px; font-weight: 800; letter-spacing: -.8px; margin: 6px 0 0; }
.route-card.selected .time { background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent; }
.route-card .name { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.route-card .bar { height: 7px; border-radius: 4px; overflow: hidden;
  background: repeating-linear-gradient(90deg, var(--orange) 0 3px, transparent 3px 7px); }
.route-card .bar-fill { height: 100%; border-radius: 4px; background: var(--sunset); }
.route-card .stats { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: 12px; font-weight: 600; }

.share-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 4px 0 2px;
  border: none; border-radius: 16px; padding: 13px; cursor: pointer; color: #fff; font-size: 15px; font-weight: 800;
  background: var(--sunset); background-size: 200% 100%; box-shadow: 0 8px 20px rgba(255, 46, 136, .35);
  animation: shimmer 4s ease-in-out infinite;
}
@keyframes shimmer { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }

.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 22px; height: 6px; border-radius: 3px; }
.swatch.solid { background: var(--magenta); box-shadow: 0 0 6px rgba(255, 46, 136, .6); }
.swatch.dotted { background: repeating-linear-gradient(90deg, var(--orange) 0 3px, transparent 3px 7px); }
.swatch.area { height: 12px; background: rgba(179, 136, 255, .45); border: 1.5px solid var(--violet); }

/* ---- map overlays ---- */
.route-flow { stroke-dasharray: 2 16; animation: flow 1.1s linear infinite; }
.route-street { animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -18; } }

.pin { display: grid; place-items: center; font-size: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 6px 16px rgba(59, 16, 120, .3); }
/* Animate the emoji inside the pin, never the pin itself: Leaflet positions markers with transform. */
.pin-dest { font-size: 22px; border: 3px solid var(--magenta); }
.pin-dest .bob { display: inline-block; animation: bob 2s ease-in-out infinite; }
.pin-start { border: 3px solid var(--violet); }
.pin-step { font-size: 13px; border: 2px solid var(--violet); }
@keyframes bob { 50% { transform: translateY(-4px); } }

.me-icon { position: relative; }
.me-dot { position: absolute; inset: 3px; border-radius: 50%; background: var(--violet); border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.me-pulse { position: absolute; inset: -10px; border-radius: 50%; background: rgba(123, 47, 247, .35);
  animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .route-flow, .route-street, .pin-dest .bob, .me-pulse, .share-btn { animation: none; }
}
