*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface2: #1a1a26;
  --border: rgba(255,255,255,0.06);
  --text: #e8e8ed;
  --text2: #8888a0;
  --accent: #6366f1;
  --accent2: #818cf8;
  --green: #22c55e;
  --orange: #f59e0b;
  --radius: 16px;
  --glass: rgba(255,255,255,0.03);
}

html { scroll-behavior: smooth; overflow-x: hidden; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; width: 100%; }

/* Google Places autocomplete mobile fix */
.pac-container { max-width: 100vw !important; }

/* Turnstile widget mobile fix */
#turnstileWidget iframe { max-width: 100% !important; }
#turnstileWidget { transform-origin: center; }
@media (max-width: 360px) {
  #turnstileWidget { transform: scale(0.9); }
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

/* Hero */
.hero { position: relative; height: 100vh; min-height: 600px; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 20%, rgba(99,102,241,0.15), transparent 60%), radial-gradient(ellipse at 70% 80%, rgba(139,92,246,0.1), transparent 50%), radial-gradient(ellipse at 50% 50%, rgba(14,165,233,0.08), transparent 70%); animation: heroPulse 8s ease-in-out infinite alternate; }
@keyframes heroPulse { 0% { opacity: 0.8; transform: scale(1); } 100% { opacity: 1; transform: scale(1.05); } }
.hero-content { position: relative; z-index: 1; }
.hero-title { font-size: clamp(3rem, 8vw, 6rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 16px; }
.accent { background: linear-gradient(135deg, var(--accent), #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { font-size: clamp(1rem, 2.5vw, 1.25rem); color: var(--text2); max-width: 600px; margin: 0 auto 48px; font-weight: 300; }
.btn-surprise-hero { margin-bottom: 32px; padding: 14px 32px; background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.4); border-radius: 100px; color: var(--accent2); font-size: 1.05rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; gap: 8px; }
.btn-surprise-hero:hover { background: rgba(99,102,241,0.25); border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(99,102,241,0.2); }
.btn-surprise-search { width: 100%; margin-top: 10px; padding: 12px; background: transparent; border: 1px dashed rgba(99,102,241,0.35); border-radius: 12px; color: var(--accent2); font-size: 0.9rem; font-weight: 500; font-family: inherit; cursor: pointer; transition: all 0.2s; }
.btn-surprise-search:hover { background: rgba(99,102,241,0.08); border-color: var(--accent); }
.scroll-hint { animation: bounce 2s infinite; color: var(--text2); }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(10px); } }

/* Section */
.section-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 32px; text-align: center; }

/* Search */
.search-section { padding: 80px 0; }
.search-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; backdrop-filter: blur(20px); max-width: 700px; margin: 0 auto; }
/* Seasonal badge */
.seasonal-badge { text-align: center; padding: 8px 16px; margin-bottom: 16px; border-radius: 100px; font-size: 0.85rem; font-weight: 500; background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.2); color: var(--accent2); }

.search-row { display: flex; gap: 12px; margin-bottom: 20px; }
.input-group { flex: 1; position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text2); pointer-events: none; }
.input-group input { width: 100%; padding: 14px 14px 14px 44px; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 1rem; font-family: inherit; outline: none; transition: border-color 0.2s; }
.input-group input:focus { border-color: var(--accent); }
.input-group input::placeholder { color: var(--text2); }
select { padding: 14px 16px; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-size: 0.9rem; font-family: inherit; cursor: pointer; outline: none; min-width: 0; flex-shrink: 0; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--surface2); border: 1px solid var(--border); border-radius: 100px; color: var(--text2); font-size: 0.85rem; font-family: inherit; cursor: pointer; transition: all 0.2s; }
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: rgba(99,102,241,0.15); border-color: var(--accent); color: var(--accent2); }

/* Toggles Row */
.toggles-row { display: flex; flex-wrap: wrap; gap: 16px 24px; margin-bottom: 20px; }
.toggle-item { display: flex; align-items: center; gap: 12px; }

/* Round Trip Toggle (legacy compat) */
.round-trip-toggle { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.toggle-label { color: var(--text2); font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.toggle-switch { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--surface2); border: 1px solid var(--border); border-radius: 26px; transition: all 0.3s; }
.toggle-slider::before { content: ''; position: absolute; height: 20px; width: 20px; left: 2px; bottom: 2px; background: var(--text2); border-radius: 50%; transition: all 0.3s; }
.toggle-switch input:checked + .toggle-slider { background: rgba(99,102,241,0.3); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); background: var(--accent2); }
.toggle-switch input:checked ~ .toggle-label, .round-trip-toggle:has(input:checked) .toggle-label, .toggle-item:has(input:checked) .toggle-label { color: var(--accent2); }

/* Buttons */
.btn-primary { width: 100%; padding: 16px; background: linear-gradient(135deg, var(--accent), #7c3aed); border: none; border-radius: 12px; color: #fff; font-size: 1rem; font-weight: 600; font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: all 0.3s; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(99,102,241,0.3); }
.btn-primary:active { transform: translateY(0); }
.btn-sm { padding: 8px 16px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 0.8rem; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s; }
.btn-sm:hover { border-color: var(--accent); }
.btn-gmaps { background: #1a73484d; border-color: #34a853; color: #34a853; }
.btn-gmaps:hover { background: #34a853; color: #fff; border-color: #34a853; }
.btn-close { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 8px; color: var(--text); cursor: pointer; transition: all 0.2s; }
.btn-close:hover { background: rgba(239,68,68,0.2); border-color: #ef4444; }

/* Loading */
.loading-section { padding: 80px 0; text-align: center; }
.loader-wrap { display: flex; flex-direction: column; align-items: center; gap: 24px; color: var(--text2); }
.loader-ring { width: 48px; height: 48px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Routes Grid */
.results-section { padding: 40px 0 80px; }
.routes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 20px; }

/* Route Card */
.route-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; cursor: pointer; transition: all 0.3s; position: relative; overflow: hidden; touch-action: manipulation; -webkit-tap-highlight-color: rgba(99,102,241,0.2); }
.route-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--card-gradient, linear-gradient(90deg, var(--accent), #a78bfa)); opacity: 0; transition: opacity 0.3s; }
.route-card:hover { transform: translateY(-4px); border-color: rgba(99,102,241,0.3); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }
.route-card:hover::before { opacity: 1; }
.route-card h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 8px; }
.route-card p { color: var(--text2); font-size: 0.9rem; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.route-meta { display: flex; gap: 16px; font-size: 0.8rem; color: var(--text2); margin-bottom: 12px; }
.route-meta span { display: flex; align-items: center; gap: 4px; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 100px; font-size: 0.75rem; font-weight: 500; }
.badge-Mountains { background: rgba(34,197,94,0.12); color: #4ade80; }
.badge-Coastal { background: rgba(14,165,233,0.12); color: #38bdf8; }
.badge-Desert { background: rgba(245,158,11,0.12); color: #fbbf24; }
.badge-Forest { background: rgba(34,197,94,0.12); color: #86efac; }
.badge-Countryside { background: rgba(168,85,247,0.12); color: #c084fc; }
.badge-Canyon { background: rgba(239,68,68,0.12); color: #f87171; }
.badge-Alpine { background: rgba(147,197,253,0.12); color: #93c5fd; }
.badge-Lakeside { background: rgba(34,211,238,0.12); color: #22d3ee; }
.badge-Wine\ Country, .badge-WineCountry { background: rgba(190,18,60,0.12); color: #fb7185; }
[class*="badge-Wine"] { background: rgba(190,18,60,0.12); color: #fb7185; }
.badge-Historic { background: rgba(180,130,70,0.12); color: #d4a053; }
.badge-Volcanic { background: rgba(239,68,68,0.15); color: #ef4444; }
.badge-Prairie { background: rgba(234,179,8,0.12); color: #facc15; }
.badge-Tropical { background: rgba(52,211,153,0.12); color: #34d399; }
.badge-Riverside { background: rgba(59,130,246,0.12); color: #60a5fa; }
.badge-Cityscape { background: rgba(148,163,184,0.15); color: #cbd5e1; }
[class*="badge-Small"] { background: rgba(251,146,60,0.12); color: #fb923c; }
.rating { color: var(--orange); font-weight: 600; font-size: 0.85rem; margin-left: auto; }

/* Scenery gradients */
.card-Mountains { --card-gradient: linear-gradient(90deg, #22c55e, #4ade80); }
.card-Coastal { --card-gradient: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.card-Desert { --card-gradient: linear-gradient(90deg, #f59e0b, #fbbf24); }
.card-Forest { --card-gradient: linear-gradient(90deg, #16a34a, #86efac); }
.card-Countryside { --card-gradient: linear-gradient(90deg, #a855f7, #c084fc); }
.card-Canyon { --card-gradient: linear-gradient(90deg, #ef4444, #f87171); }
.card-Alpine { --card-gradient: linear-gradient(90deg, #60a5fa, #93c5fd); }
.card-Lakeside { --card-gradient: linear-gradient(90deg, #06b6d4, #22d3ee); }
[class*="card-Wine"] { --card-gradient: linear-gradient(90deg, #be123c, #fb7185); }
.card-Historic { --card-gradient: linear-gradient(90deg, #b8860b, #d4a053); }
.card-Volcanic { --card-gradient: linear-gradient(90deg, #dc2626, #ef4444); }
.card-Prairie { --card-gradient: linear-gradient(90deg, #ca8a04, #facc15); }
.card-Tropical { --card-gradient: linear-gradient(90deg, #059669, #34d399); }
.card-Riverside { --card-gradient: linear-gradient(90deg, #2563eb, #60a5fa); }
.card-Cityscape { --card-gradient: linear-gradient(90deg, #64748b, #cbd5e1); }
[class*="card-Small"] { --card-gradient: linear-gradient(90deg, #ea580c, #fb923c); }

/* Preview Panel */
.preview-panel { position: fixed; inset: 0; z-index: 1000; background: var(--bg); display: flex; flex-direction: column; animation: slideUp 0.4s ease; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.preview-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.preview-info h2 { font-size: 1.25rem; font-weight: 700; }
.preview-meta { display: flex; gap: 8px; color: var(--text2); font-size: 0.85rem; margin-top: 4px; }
.dot { opacity: 0.4; }

.preview-body { display: flex; flex: 1; min-height: 0; }
.preview-left, .preview-right { flex: 1; position: relative; display: flex; flex-direction: column; }
.preview-left { border-right: 1px solid var(--border); }
.panel-label { position: absolute; top: 12px; left: 12px; z-index: 10; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); padding: 4px 12px; border-radius: 8px; font-size: 0.75rem; font-weight: 500; color: var(--text2); }
#map3dContainer, #streetViewContainer { flex: 1; min-height: 0; }
#map3dContainer gmp-map-3d { width: 100%; height: 100%; }

.fly-controls, .sv-controls { padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--border); display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.speed-btns { display: flex; gap: 4px; }
.speed-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.progress-wrap { flex: 1; height: 4px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: var(--accent); border-radius: 4px; transition: width 0.3s; }

.preview-highlights { padding: 12px 24px; background: var(--surface); border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.highlight-tag { padding: 6px 14px; background: var(--surface2); border-radius: 100px; font-size: 0.8rem; color: var(--text2); }

/* Elevation Profile */
.elevation-section { padding: 12px 24px 16px; background: var(--surface); border-top: 1px solid var(--border); flex-shrink: 0; }
.elevation-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.elevation-title { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.elevation-stats { font-size: 0.75rem; color: var(--text2); }
#elevationCanvas { width: 100%; height: 120px; border-radius: 8px; background: var(--surface2); display: block; }

/* Pit Stops */
.pit-stops-section { padding: 16px 24px; background: var(--surface); border-top: 1px solid var(--border); flex-shrink: 0; max-height: 220px; overflow: hidden; }
.pit-stops-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.pit-stops-header h3 { font-size: 1rem; font-weight: 600; }
.pit-stops-sub { font-size: 0.8rem; color: var(--text2); }
.pit-stops-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: var(--surface2) transparent; }
.pit-stops-scroll::-webkit-scrollbar { height: 6px; }
.pit-stops-scroll::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }
.pit-stop-card { flex: 0 0 220px; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; transition: border-color 0.2s; }
.pit-stop-card:hover { border-color: var(--accent); }
.pit-stop-type { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.pit-stop-name { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pit-stop-rating { font-size: 0.8rem; color: var(--orange); }
.pit-stop-link { font-size: 0.75rem; color: var(--accent2); text-decoration: none; margin-top: auto; }
.pit-stop-link:hover { text-decoration: underline; }

/* Footer */
footer { padding: 40px; text-align: center; color: var(--text2); font-size: 0.8rem; border-top: 1px solid var(--border); }

/* Responsive */
@media (max-width: 768px) {
  .search-row { flex-direction: column; }
  .routes-grid { grid-template-columns: 1fr; }
  .preview-body { flex-direction: column; }
  .preview-left { border-right: none; border-bottom: 1px solid var(--border); min-height: 35vh; }
  .preview-right { min-height: 35vh; }
  .search-section { padding: 48px 0; }
  .search-card { padding: 20px; }
  .container { padding: 0 16px; }
  .hero { min-height: 80vh; }
  .hero-title { font-size: clamp(2.2rem, 10vw, 3.5rem); }
  .section-title { font-size: 1.4rem; margin-bottom: 20px; }

  /* Touch-friendly tap targets */
  .chip { padding: 10px 16px; font-size: 0.88rem; min-height: 44px; }
  .btn-primary { padding: 16px; font-size: 1rem; min-height: 48px; }
  .btn-sm { padding: 10px 14px; min-height: 44px; font-size: 0.82rem; }
  .btn-surprise-hero { padding: 14px 28px; min-height: 48px; }
  .btn-surprise-search { padding: 14px; min-height: 44px; }
  select { padding: 14px 12px; font-size: 0.95rem; min-height: 48px; width: 100%; }
  .input-group input { padding: 14px 14px 14px 44px; font-size: 1rem; min-height: 48px; }

  /* Preview panel mobile */
  .preview-panel { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .preview-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .preview-info h2 { font-size: 1.05rem; }
  .preview-meta { font-size: 0.78rem; flex-wrap: wrap; }
  .preview-actions { gap: 6px; }
  .btn-save, .btn-share { padding: 8px 12px; font-size: 0.8rem; }
  .btn-close { padding: 8px; min-width: 40px; min-height: 40px; display: flex; align-items: center; justify-content: center; }
  .fly-controls, .sv-controls { padding: 8px 12px; flex-wrap: wrap; gap: 8px; }
  .preview-highlights { padding: 10px 16px; }
  .elevation-section { padding: 10px 16px 14px; }
  #elevationCanvas { height: 80px; }
  .pit-stops-section { padding: 12px 16px; }
  .pit-stop-card { flex: 0 0 180px; padding: 12px; }

  /* Toggle row stacking */
  .toggles-row { gap: 12px; }
  .toggle-label { font-size: 0.85rem; }

  /* Seasonal badge */
  .seasonal-badge { font-size: 0.8rem; padding: 6px 12px; }

  /* Route cards */
  .route-card { padding: 16px; }
  .route-card h3 { font-size: 1.05rem; }
  .route-card-photo, .route-card-photo-placeholder { height: 120px; margin: -16px -16px 12px -16px; width: calc(100% + 32px); }
  .route-card-photo { border-radius: 16px 16px 0 0; }
  .route-card-photo-placeholder { border-radius: 16px 16px 0 0; }

  /* Footer */
  footer { padding: 24px 16px; }

  /* Modal */
  .modal-content { width: 95%; max-height: 80vh; }
}

/* Small phones */
@media (max-width: 375px) {
  .hero-title { font-size: 2rem; }
  .hero-sub { font-size: 0.9rem; margin-bottom: 32px; }
  .chips { gap: 6px; }
  .chip { padding: 8px 12px; font-size: 0.82rem; }
  .search-card { padding: 16px; }
}

/* Save & Share buttons */
.preview-actions { display: flex; align-items: center; gap: 8px; }
.btn-save, .btn-share { padding: 8px 16px; border-radius: 10px; font-size: 0.85rem; font-weight: 600; font-family: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s; border: 1px solid var(--border); }
.btn-save { background: rgba(239,68,68,0.1); color: #f87171; border-color: rgba(239,68,68,0.3); }
.btn-save:hover { background: rgba(239,68,68,0.2); }
.btn-save.saved { background: rgba(239,68,68,0.25); color: #ef4444; }
.btn-share { background: rgba(99,102,241,0.1); color: var(--accent2); border-color: rgba(99,102,241,0.3); }
.btn-share:hover { background: rgba(99,102,241,0.2); }

/* Saved routes link */
.saved-routes-link { text-align: center; margin-bottom: 16px; }
.saved-routes-link a { color: var(--accent2); font-size: 0.9rem; cursor: pointer; text-decoration: none; }
.saved-routes-link a:hover { text-decoration: underline; }

/* Saved Routes Modal */
.modal-overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; animation: fadeIn 0.2s ease; }
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); width: 90%; max-width: 520px; max-height: 70vh; display: flex; flex-direction: column; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.saved-route-item { display: flex; align-items: center; justify-content: space-between; padding: 12px; background: var(--surface2); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: all 0.2s; }
.saved-route-item:hover { border-color: var(--accent); box-shadow: 0 2px 12px rgba(0,0,0,0.2); }
.saved-route-item .route-name { font-weight: 600; font-size: 0.95rem; }
.saved-route-item .route-detail { font-size: 0.8rem; color: var(--text2); margin-top: 2px; }
.saved-route-delete { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #f87171; border-radius: 8px; padding: 6px 10px; font-size: 0.75rem; cursor: pointer; font-family: inherit; transition: all 0.2s; flex-shrink: 0; }
.saved-route-delete:hover { background: rgba(239,68,68,0.25); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 12px 24px; border-radius: 12px; font-size: 0.9rem; font-weight: 500; z-index: 3000; animation: toastIn 0.3s ease; pointer-events: none; max-width: 90vw; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.toast-error { background: #dc2626; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* Loading dots animation */
.loader-wrap p { font-size: 1rem; }
.loader-dots::after { content: ''; animation: dots 1.5s steps(4, end) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* Disabled button state */
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* Smooth section transitions */
.results-section, .loading-section { transition: opacity 0.3s ease; }

/* Fade-in animation */
/* Route card photo thumbnail */
.route-card-photo { width: 100%; height: 140px; object-fit: cover; border-radius: 12px 12px 0 0; margin: -24px -24px 16px -24px; width: calc(100% + 48px); display: block; background: var(--surface2); }
.route-card-photo-placeholder { width: calc(100% + 48px); height: 140px; margin: -24px -24px 16px -24px; background: var(--surface2); border-radius: 12px 12px 0 0; display: flex; align-items: center; justify-content: center; color: var(--text2); font-size: 2rem; }
.route-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.spotify-link { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; color: #1db954; text-decoration: none; font-weight: 500; transition: opacity 0.2s; }
.spotify-link:hover { opacity: 0.8; text-decoration: underline; }

/* Preview header photo */
.preview-hero-photo { width: 100%; height: 200px; object-fit: cover; display: block; flex-shrink: 0; }
.preview-hero-photo-wrap { position: relative; flex-shrink: 0; background: var(--surface2); }
.preview-hero-photo-wrap .preview-photo-overlay { position: absolute; bottom: 0; left: 0; right: 0; height: 60px; background: linear-gradient(transparent, var(--bg)); }

.fade-in { animation: fadeIn 0.5s ease forwards; opacity: 0; }
@keyframes fadeIn { to { opacity: 1; } }
.route-card:nth-child(1) { animation-delay: 0s; }
.route-card:nth-child(2) { animation-delay: 0.1s; }
.route-card:nth-child(3) { animation-delay: 0.2s; }
.route-card:nth-child(4) { animation-delay: 0.3s; }
.route-card:nth-child(5) { animation-delay: 0.4s; }

/* Route Pins Modal */
.pins-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(4px); }
.pins-modal-content { background: var(--surface); border-radius: var(--radius); max-width: 480px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); }
.pins-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.pins-modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.pins-subtitle { padding: 8px 20px; font-size: 0.8rem; color: var(--text2); }
.pins-list { flex: 1; overflow-y: auto; padding: 8px 20px; -webkit-overflow-scrolling: touch; }
.pin-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); gap: 8px; }
.pin-item:last-child { border-bottom: none; }
.pin-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.pin-num { background: var(--accent); color: #fff; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; }
.pin-details { display: flex; flex-direction: column; min-width: 0; }
.pin-label { font-weight: 600; font-size: 0.85rem; }
.pin-coords { font-size: 0.75rem; color: var(--text2); font-family: monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin-actions-row { display: flex; gap: 6px; flex-shrink: 0; }
.btn-xs { padding: 4px 10px; font-size: 0.75rem; border-radius: 6px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); cursor: pointer; font-weight: 600; white-space: nowrap; min-height: 32px; }
.btn-xs:active { transform: scale(0.95); }
.btn-pin-map { text-decoration: none; display: flex; align-items: center; color: var(--accent); border-color: var(--accent); }
.btn-pin-copy { background: var(--accent); color: #fff; border-color: var(--accent); }
.pins-actions { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }
.pins-actions .btn-sm { flex: 1; min-width: 140px; justify-content: center; }
.btn-accent { background: var(--accent); color: #fff; border: none; }
.btn-pins { border-color: var(--accent); color: var(--accent); }
.btn-pins:hover { background: var(--accent); color: #fff; }

@media (max-width: 768px) {
  .pins-modal-content { max-height: 90vh; border-radius: 16px 16px 0 0; align-self: flex-end; }
  .pins-modal { align-items: flex-end; padding: 0; }
  .pin-coords { font-size: 0.7rem; }
  .fly-controls { flex-wrap: wrap; gap: 6px; }
  .fly-controls .btn-sm { font-size: 0.75rem; padding: 8px 10px; flex: 1; min-width: 0; justify-content: center; }
}
