/* -------------------------------------------------------
   STYLES — Cirrus Trip Planner (v2 — visual refresh)
   ------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ---- Custom Properties ---- */

:root {
  --color-primary: #5bb8f5;
  --color-green: #3dba78;
  --color-red: #e74c3c;
  --color-orange: #e67e22;
  --color-text: #e2e8f0;
  --color-secondary: #5a7a94;
  --color-tertiary: #8ba3b8;
  --color-muted: #3d5468;
  --color-surface: #111b27;
  --color-bg: #0b1117;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.08);
  --gradient-primary: linear-gradient(135deg, #2d8bcf 0%, #5bb8f5 100%);
  --transition-interactive: background 0.15s, border-color 0.15s, color 0.15s;
}

/* ---- Reset & Base ---- */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3d6080; }

/* ---- Header ---- */

header {
  background: linear-gradient(135deg, #0f1a24 0%, #162436 100%);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(79, 163, 224, 0.15);
  flex-shrink: 0;
}

header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.3px;
}

header h1 .accent { color: var(--color-primary); }

.header-subtitle {
  font-size: 12px;
  color: var(--color-secondary);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.header-btn {
  margin-left: auto;
  padding: 7px 14px;
  background: rgba(91, 184, 245, 0.08);
  border: 1px solid rgba(91, 184, 245, 0.25);
  border-radius: 8px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}

.header-btn:hover {
  background: rgba(91, 184, 245, 0.15);
  border-color: rgba(91, 184, 245, 0.4);
  transform: translateY(-1px);
}

/* ---- Layout ---- */

.app { display: flex; flex: 1; overflow: hidden; }

/* ---- Sidebar ---- */

.sidebar {
  width: 360px;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(79, 163, 224, 0.1);
  overflow-y: auto;
  flex-shrink: 0;
  touch-action: manipulation;
}

/* ---- Search Panel ---- */

.search-panel {
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

#addRestaurantArea {
  padding: 0 20px;
}

.search-panel h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-secondary);
  margin-bottom: 18px;
  font-weight: 600;
}

label {
  display: block;
  font-size: 11px;
  color: var(--color-secondary);
  margin-bottom: 6px;
  margin-top: 16px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

input, select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  color: var(--color-text);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition-interactive);
}

input::placeholder { color: var(--color-muted); }

input:focus, select:focus {
  outline: none;
  border-color: rgba(91, 184, 245, 0.5);
  background: rgba(91, 184, 245, 0.05);
  box-shadow: 0 0 0 3px rgba(91, 184, 245, 0.08);
}

.search-btn {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  background: var(--gradient-primary);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 12px rgba(91, 184, 245, 0.2);
}

.search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(91, 184, 245, 0.3);
}

.search-btn:active { transform: translateY(0); }

/* ---- Filter Pills ---- */

.filter-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  color: #6b8ba3;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-interactive);
  white-space: nowrap;
  font-family: inherit;
}

.filter-pill:hover {
  border-color: rgba(91, 184, 245, 0.3);
  color: #c0d8ec;
  background: rgba(91, 184, 245, 0.06);
}

.filter-pill.active {
  background: rgba(91, 184, 245, 0.12);
  border-color: rgba(91, 184, 245, 0.4);
  color: var(--color-primary);
  font-weight: 600;
}

/* ---- Results Panel ---- */

.results-panel {
  padding: 20px;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}

.results-panel h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-secondary);
  margin-bottom: 14px;
  font-weight: 600;
}

.results-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-secondary);
  margin-bottom: 10px;
  font-weight: 600;
}

/* ---- Result Cards ---- */

.result-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s, background 0.15s;
  overflow: hidden;
  contain: layout style paint;
}

.result-card:hover {
  border-color: rgba(91, 184, 245, 0.3);
  background: rgba(91, 184, 245, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.result-card.highlighted {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
}

.result-card.nps-border { border-left: 3px solid var(--color-green); }

.card-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  content-visibility: auto;
}

.card-body { padding: 14px 16px; }

.result-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}

.icao { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.icao.nps-text { color: var(--color-green); }

.meta {
  font-size: 12px;
  color: var(--color-secondary);
  margin-top: 6px;
  line-height: 1.5;
}

.airport-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.airport-badge {
  background: rgba(61, 186, 120, 0.12);
  color: var(--color-green);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.activities-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }

/* ---- Tags ---- */

.tag {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}

.tag-green { background: rgba(61, 186, 120, 0.1); color: var(--color-green); }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Empty State ---- */

.empty-state {
  text-align: center;
  color: var(--color-muted);
  font-size: 13px;
  padding: 40px 20px;
  line-height: 1.6;
}

/* ---- Loading Spinner ---- */

.loading-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(91, 184, 245, 0.15);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Map Area ---- */

.map-area { flex: 1; display: flex; flex-direction: column; position: relative; }
#map {
  flex: 1;
  background: var(--color-bg);
  touch-action: manipulation;
}

/* GPU-accelerate Leaflet's tile and overlay panes for smoother pan/zoom */
.leaflet-tile-pane,
.leaflet-overlay-pane,
.leaflet-marker-pane {
  will-change: transform;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* ---- Detail Panel ---- */

#detailPanel {
  position: absolute;
  top: 0; right: 0;
  width: 400px;
  height: 100%;
  background: var(--color-surface);
  border-left: 1px solid var(--border-subtle);
  overflow-y: auto;
  z-index: 1000;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.4);
  transform: translateX(100%);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#detailPanel.open {
  transform: translateX(0);
}

/* Hero image */

.detail-hero {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  content-visibility: auto;
}

.detail-hero-placeholder {
  width: 100%;
  height: 120px;
  background: linear-gradient(135deg, #162436 0%, #1a3048 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.detail-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: rgba(17, 27, 39, 0.98);
  z-index: 10;
}

.detail-header span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-secondary);
  font-weight: 600;
}

.detail-close {
  background: var(--border-subtle);
  border: none;
  color: var(--color-tertiary);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 8px;
  transition: var(--transition-interactive);
}

.detail-close:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.1);
}

/* Detail panel content body */

.detail-content-body {
  padding: 20px 20px 28px;
}

.detail-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-secondary);
}

.detail-loading div { font-size: 13px; margin-top: 16px; }

.detail-park-header { margin-bottom: 20px; }

.detail-designation {
  font-size: 10px;
  color: var(--color-green);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.detail-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.detail-location { font-size: 13px; color: var(--color-secondary); }

/* Detail cards (dark background sections) */

.detail-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.detail-section { margin-bottom: 18px; }

.detail-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-secondary);
  margin-bottom: 10px;
  font-weight: 600;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.detail-row-label { font-size: 13px; color: var(--color-tertiary); }
.detail-row-value { font-size: 13px; color: var(--color-text); font-weight: 600; }

.detail-body-text {
  font-size: 13px;
  color: var(--color-tertiary);
  line-height: 1.75;
}

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

/* Nearest airport section */

.detail-divider {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.detail-airport-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-airport-icao {
  background: rgba(91, 184, 245, 0.1);
  color: var(--color-primary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.detail-airport-name { font-size: 13px; color: var(--color-text); font-weight: 500; }
.detail-airport-distance { font-size: 12px; color: var(--color-secondary); margin-top: 2px; }
.detail-airport-address { font-size: 11px; color: var(--color-muted); margin-top: 3px; }
.detail-airport-meta { font-size: 12px; color: var(--color-primary); margin-top: 2px; }
.detail-runway-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.detail-runway-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--color-secondary); margin-bottom: 8px; font-weight: 600; }
.detail-runway-row { font-size: 12px; color: var(--color-tertiary); padding: 4px 0; }
.detail-runway-row + .detail-runway-row { border-top: 1px solid rgba(255,255,255,0.03); }

/* Driving stats */

.detail-driving-stats {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  gap: 10px;
}

.detail-driving-stat { flex: 1; text-align: center; min-width: 0; }
.detail-driving-stat-label { font-size: 10px; color: var(--color-secondary); margin-bottom: 4px; font-weight: 500; }
.detail-driving-stat-value { font-size: 13px; font-weight: 700; color: var(--color-text); }
.detail-driving-divider { width: 1px; background: var(--border-subtle); }

/* Fee rows */

.detail-fee-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-fee-row:last-child { border-bottom: none; }

.detail-fee-amount { font-size: 13px; color: var(--color-primary); font-weight: 600; }

/* NPS link button */

.detail-nps-link {
  display: block;
  text-align: center;
  padding: 12px;
  background: rgba(91, 184, 245, 0.08);
  border: 1px solid rgba(91, 184, 245, 0.25);
  border-radius: 10px;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 20px;
  transition: background 0.15s, border-color 0.15s;
}

.detail-nps-link:hover {
  background: rgba(91, 184, 245, 0.15);
  border-color: rgba(91, 184, 245, 0.4);
}

/* ---- Filter panel ---- */

.filter-panel {
  display: none;
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.filter-header span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-secondary);
  font-weight: 600;
}

.filter-clear-btn {
  font-size: 11px;
  color: var(--color-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-weight: 500;
  font-family: inherit;
  transition: color 0.2s;
}

.filter-clear-btn:hover { color: #82ccff; }

.filter-group-label {
  font-size: 10px;
  color: #4d6a80;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.filter-group:last-child { margin-bottom: 0; }

.runway-length-input {
  width: 160px;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

#filterCount {
  font-size: 12px;
  color: var(--color-secondary);
  margin-top: 14px;
  font-weight: 500;
}

/* ---- Airport status ---- */

.airport-status {
  font-size: 11px;
  color: #8aafc8;
  margin-top: 6px;
  line-height: 1.6;
}

.airport-status-detail {
  font-size: 10px;
}

.airport-status-fresh {
  color: #8aafc8;
}

.airport-status-stale {
  color: #c0813a;
}

/* ---- Range Slider ---- */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  outline: none;
  margin: 10px 0 6px;
  border: none;
  padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--gradient-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(91, 184, 245, 0.3);
  transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--gradient-primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(91, 184, 245, 0.3);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--color-muted);
  font-weight: 500;
}

/* ---- Map Style Toolbar ---- */

.map-toolbar {
  position: absolute;
  bottom: 24px;
  right: 16px;
  display: flex;
  gap: 4px;
  background: rgba(17, 27, 39, 0.95);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 4px;
  z-index: 800;
}

.map-style-btn {
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-style-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.map-style-btn.active {
  background: rgba(91, 184, 245, 0.15);
  border-color: rgba(91, 184, 245, 0.3);
}

/* ---- Auth Area ---- */

.auth-area {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.signup-btn {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-name {
  font-size: 12px;
  color: var(--color-tertiary);
  font-weight: 500;
}

/* ---- Auth Modal ---- */

.auth-modal-overlay {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.auth-modal-overlay.open {
  display: flex;
}

.auth-modal {
  background: var(--color-surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 32px;
  width: 380px;
  max-width: 90vw;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.auth-modal h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--border-subtle);
  border: none;
  color: var(--color-tertiary);
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: var(--transition-interactive);
}

.auth-modal-close:hover {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.1);
}

/* .auth-label and .auth-input removed — identical to base label and input styles */

.auth-error {
  color: #ef4444;
  font-size: 12px;
  margin-top: 12px;
  min-height: 18px;
}

.auth-submit-btn {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: var(--gradient-primary);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-interactive);
  font-family: inherit;
  box-shadow: 0 4px 15px rgba(91, 184, 245, 0.2);
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(91, 184, 245, 0.3);
}

.auth-toggle {
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
  color: var(--color-secondary);
}

.auth-toggle a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-toggle a:hover { text-decoration: underline; }

/* ---- Destination Type Toggle ---- */

.dest-type-toggle {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.dest-type-btn {
  flex: 1;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  color: var(--color-tertiary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: var(--transition-interactive);
  font-family: inherit;
}

.dest-type-btn:hover {
  border-color: rgba(91, 184, 245, 0.3);
  color: #c0d8ec;
}

.dest-type-btn.active {
  background: rgba(91, 184, 245, 0.1);
  border-color: rgba(91, 184, 245, 0.3);
  color: var(--color-primary);
  font-weight: 600;
}

/* ---- Theme Park Card Styles ---- */

.result-card.themepark-border { border-left: 3px solid var(--color-orange); }
.icao.themepark-text { color: var(--color-orange); }

.airport-badge.themepark-badge {
  background: rgba(230, 126, 34, 0.12);
  color: var(--color-orange);
}

.themepark-hero {
  background: linear-gradient(135deg, #2d1810 0%, #3d2415 100%);
}

.detail-designation.themepark-designation { color: var(--color-orange); }

/* ---- Restaurant Styles ---- */
.result-card.restaurant-border { border-left: 3px solid var(--color-red); }
.icao.restaurant-text { color: var(--color-red); }
.airport-badge.restaurant-badge { background: rgba(231, 76, 60, 0.12); color: var(--color-red); }
.restaurant-hero { background: linear-gradient(135deg, #2d1015 0%, #3d1520 100%); }
.detail-designation.restaurant-designation { color: var(--color-red); }
.restaurant-vicinity { color: var(--color-tertiary); font-style: italic; font-size: 12px; }

.restaurant-rating-large {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; margin-bottom: 12px;
  background: rgba(231, 76, 60, 0.06);
  border-radius: 10px; border: 1px solid rgba(231, 76, 60, 0.12);
}
.restaurant-stars { font-size: 18px; font-weight: 600; color: #f1c40f; }
.restaurant-review-count { font-size: 12px; color: var(--color-tertiary); }

.restaurant-submit-btn-large {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-interactive);
  font-family: inherit;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.2);
}
.restaurant-submit-btn-large:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
}
.restaurant-submit-btn-large:active {
  transform: translateY(0);
}

.submit-rest-desc { color: var(--color-tertiary); font-size: 13px; margin-bottom: 16px; line-height: 1.5; }
.submit-rest-success { color: var(--color-green); font-size: 13px; margin: 8px 0; font-weight: 600; }
.submit-rest-modal { max-width: 480px; max-height: 85vh; overflow-y: auto; }

.submit-rest-results-label {
  font-size: 12px; font-weight: 600; color: var(--color-tertiary);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 16px 0 8px;
}
.submit-rest-no-results {
  color: var(--color-tertiary); font-size: 13px; margin: 16px 0; text-align: center;
  padding: 16px; background: rgba(255,255,255,0.03); border-radius: 8px;
}
.submit-rest-candidate {
  padding: 12px 14px; margin: 6px 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  border-radius: 10px; cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.submit-rest-candidate:hover {
  background: rgba(231, 76, 60, 0.08);
  border-color: rgba(231, 76, 60, 0.3);
}
.submit-rest-candidate.selected {
  background: rgba(231, 76, 60, 0.12);
  border-color: rgba(231, 76, 60, 0.5);
}
.submit-rest-candidate-name {
  font-weight: 600; font-size: 14px; color: #e0e8f0;
}
.submit-rest-candidate-addr {
  font-size: 12px; color: var(--color-tertiary); margin-top: 2px;
}
.submit-rest-candidate-meta {
  font-size: 12px; color: #f1c40f; margin-top: 4px;
}

/* ---- Map Reset Button ---- */
.leaflet-reset-btn {
  background: rgba(20, 25, 35, 0.92);
  color: #e0e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: background 0.2s, transform 0.1s;
}
.leaflet-reset-btn:hover {
  background: rgba(30, 38, 52, 0.95);
  transform: scale(1.03);
}
.leaflet-reset-btn:active {
  transform: scale(0.97);
}

/* ---- Weather Summary ---- */

.weather-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.weather-icon { font-size: 36px; }
.weather-temp { font-size: 22px; font-weight: 700; color: var(--color-text); }
.weather-desc { font-size: 13px; color: var(--color-tertiary); }

/* ---- METAR / Flight Category Badges ---- */
.metar-flight-cat { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 6px; letter-spacing: 0.5px; }
.metar-vfr { background: rgba(61,186,120,0.12); color: var(--color-green); }
.metar-mvfr { background: rgba(91,184,245,0.12); color: var(--color-primary); }
.metar-ifr { background: rgba(239,68,68,0.12); color: #ef4444; }
.metar-lifr { background: rgba(168,85,247,0.12); color: #a855f7; }
.facility-use-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 5px; vertical-align: middle; margin-left: 6px; letter-spacing: 0.3px; }
.facility-use-private { background: rgba(239,68,68,0.12); color: #ef4444; }
.facility-use-restricted { background: rgba(168,85,247,0.12); color: #a855f7; }
.metar-raw { font-size: 10px; color: var(--color-muted); font-family: monospace; margin-top: 8px; word-break: break-all; }
.metar-obs-time { font-size: 10px; color: var(--color-muted); margin-top: 4px; }

/* ---- Autocomplete Dropdown ---- */

.autocomplete-wrapper { position: relative; }

.suggestions-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1a2636;
  border: 1px solid rgba(91, 184, 245, 0.25);
  border-top: none;
  border-radius: 0 0 10px 10px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.suggestion-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s;
}

.suggestion-item:hover { background: rgba(91, 184, 245, 0.1); }

.suggestion-icao {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.5px;
  min-width: 45px;
}

.suggestion-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.suggestion-name {
  font-size: 12px;
  color: var(--color-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-location {
  font-size: 10px;
  color: #4d6a80;
  margin-top: 1px;
}

/* ---- Settings Panel ---- */
.settings-panel { padding: 20px; }
.settings-section { margin-bottom: 20px; }
.settings-section h4 { font-size: 13px; font-weight: 600; color: #e0e8f0; margin-bottom: 6px; }
.settings-desc { font-size: 12px; color: var(--color-tertiary); margin-bottom: 10px; line-height: 1.5; }
.settings-current { font-size: 12px; color: var(--color-primary); margin-top: 6px; }

.settings-select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #e0e8f0;
  font-size: 14px;
  outline: none;
  cursor: pointer;
}
.settings-select:focus { border-color: var(--color-primary); }
.settings-select option { background: #1a2636; color: #e0e8f0; }

.settings-toggle-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.settings-toggle {
  padding: 8px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--color-tertiary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-interactive);
}
.settings-toggle:hover {
  background: rgba(91,184,245,0.1);
  border-color: rgba(91,184,245,0.3);
}
.settings-toggle.active {
  background: rgba(91,184,245,0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ---- Suggestion keyboard highlight ---- */
.suggestion-item.suggestion-active {
  background: rgba(91, 184, 245, 0.15);
}

/* ---- Mobile sidebar toggle button (hidden on desktop) ---- */

.sidebar-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  flex-shrink: 0;
}

/* ---- Sidebar overlay backdrop (hidden by default) ---- */

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 899;
}

.sidebar-overlay.open {
  display: block;
}

/* ---- Mobile layout (<=767px) ---- */

@media (max-width: 767px) {

  html {
    overflow: hidden;
    width: 100%;
    height: 100vh;
    height: 100dvh;
  }

  body {
    overflow: hidden;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    position: relative;
  }

  .app {
    overflow: hidden;
    width: 100%;
  }

  .map-area {
    min-width: 0;
    overflow: hidden;
    flex: 1;
  }

  #map {
    min-width: 0;
  }

  /* Sidebar: hidden by default, slides in as fixed drawer */
  .sidebar {
    display: none;
    position: fixed;
    left: 0;
    top: 50px;
    height: calc(100% - 50px);
    width: min(290px, 88vw);
    z-index: 900;
    overflow-x: hidden;
  }

  .sidebar.open {
    display: flex;
    flex-direction: column;
  }

  /* Panel: bottom sheet, clips scroll overflow */
  #detailPanel {
    position: absolute;
    width: 100%;
    max-width: 100vw;
    height: 70vh;
    top: unset;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-left: none;
    border-top: none;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.6);
    z-index: 1000;
  }

  /* Scroll happens on the inner content div */
  #detailContent {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
    min-height: 0;
  }

  /* Remove sticky from header since panel no longer scrolls */
  .detail-header {
    position: relative;
    flex-shrink: 0;
    padding: 8px 14px;
  }

  .detail-content-body {
    width: 100%;
    padding: 14px;
  }

  .settings-panel {
    padding: 14px;
  }

  /* ---- Header ---- */
  header {
    padding: 8px 12px;
    gap: 8px;
    max-width: 100vw;
    flex-wrap: wrap;
  }

  header h1 {
    font-size: 14px;
  }

  .header-subtitle {
    display: none;
  }

  .auth-area {
    gap: 6px;
  }

  .header-btn {
    padding: 8px 14px;
    font-size: 13px;
    margin-left: 0;
  }

  .sidebar-toggle-btn {
    display: block;
    font-size: 20px;
    padding: 10px 12px;
  }

  /* ---- Search panel ---- */
  .search-panel {
    padding: 14px;
  }

  .search-panel h2 {
    font-size: 13px;
    margin-bottom: 12px;
  }

  label {
    font-size: 12px;
    margin-top: 12px;
    margin-bottom: 4px;
  }

  input, select {
    padding: 12px 14px;
    font-size: 14px;
    border-radius: 8px;
  }

  /* Dest type buttons: stack vertically */
  .dest-type-toggle {
    flex-direction: column;
    gap: 5px;
  }

  .dest-type-btn {
    font-size: 13px;
    padding: 12px;
    text-align: left;
    border-radius: 8px;
  }

  .search-btn {
    padding: 14px;
    font-size: 14px;
    margin-top: 14px;
    border-radius: 8px;
  }

  /* Airport status */
  .airport-status {
    font-size: 11px;
  }

  .airport-status-detail {
    font-size: 10px;
  }

  /* Range slider */
  .range-labels {
    font-size: 10px;
  }

  input[type="range"]::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }

  input[type="range"]::-moz-range-thumb {
    width: 28px;
    height: 28px;
  }

  /* ---- Filter panel ---- */
  .filter-panel {
    padding: 14px;
  }

  .filter-header span {
    font-size: 12px;
  }

  .filter-clear-btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .filter-group-label {
    font-size: 11px;
  }

  .filter-pill {
    padding: 8px 14px;
    font-size: 12px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }

  .runway-length-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
  }

  /* ---- Results panel ---- */
  .results-panel {
    padding: 14px;
  }

  .results-panel h2 {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .result-card {
    margin-bottom: 8px;
    border-radius: 10px;
  }

  .card-image {
    height: 90px;
  }

  .card-body {
    padding: 10px 12px;
  }

  .result-card h3 {
    font-size: 14px;
  }

  .meta {
    font-size: 11px;
  }

  .icao {
    font-size: 11px;
  }

  .tag {
    font-size: 10px;
    padding: 4px 8px;
  }

  /* ---- Detail backdrop (mobile only) ---- */
  .detail-backdrop {
    display: none;
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }

  .detail-backdrop.open {
    display: block;
  }

  #detailPanel.open {
    transform: translateY(0);
  }

  #detailPanel::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 2px;
    margin: 10px auto 0;
  }

  /* ---- Detail panel content ---- */

  .detail-header span {
    font-size: 12px;
  }

  .detail-close {
    padding: 10px 14px;
    font-size: 18px;
  }

  .detail-hero {
    height: 140px;
  }

  .detail-hero-placeholder {
    height: 80px;
    font-size: 28px;
  }

  .detail-park-header {
    margin-bottom: 12px;
  }

  .detail-title {
    font-size: 15px;
    line-height: 1.3;
    word-break: break-word;
  }

  .detail-designation {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .detail-location {
    font-size: 11px;
    word-break: break-word;
  }

  .detail-section-label {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .detail-section {
    margin-bottom: 14px;
  }

  .detail-card {
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 10px;
  }

  /* Stack label above value for readability on small screens */
  .detail-row {
    flex-direction: column;
    gap: 1px;
    margin-bottom: 8px;
  }

  .detail-row-label {
    font-size: 11px;
    color: var(--color-secondary);
  }

  .detail-row-value {
    font-size: 13px;
    word-break: break-word;
  }

  .detail-body-text {
    font-size: 12px;
    line-height: 1.6;
  }

  .detail-muted {
    font-size: 11px;
  }

  .detail-divider {
    margin-top: 10px;
    padding-top: 10px;
  }

  .detail-driving-stats {
    padding: 8px;
    gap: 4px;
  }

  .detail-driving-stat-label {
    font-size: 9px;
    margin-bottom: 3px;
  }

  .detail-driving-stat-value {
    font-size: 12px;
  }

  .detail-airport-row {
    gap: 8px;
    margin-bottom: 8px;
    overflow: hidden;
  }

  /* Constrain the text column so it doesn't overflow flex */
  .detail-airport-row > div {
    min-width: 0;
    overflow: hidden;
  }

  .detail-airport-icao {
    font-size: 11px;
    padding: 4px 8px;
    flex-shrink: 0;
  }

  .detail-airport-name {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .detail-airport-distance,
  .detail-airport-address {
    font-size: 11px;
    word-break: break-word;
  }

  .detail-airport-meta { font-size: 11px; }
  .detail-runway-section { margin-top: 8px; padding-top: 8px; }
  .detail-runway-label { font-size: 9px; margin-bottom: 6px; }
  .detail-runway-row { font-size: 11px; padding: 3px 0; }

  .detail-fee-row {
    padding: 7px 0;
  }

  .detail-fee-amount {
    font-size: 12px;
  }

  .detail-nps-link {
    padding: 12px;
    font-size: 13px;
    margin-bottom: 12px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .weather-summary {
    gap: 10px;
    margin-bottom: 8px;
  }

  .weather-icon {
    font-size: 26px;
  }

  .weather-temp {
    font-size: 17px;
  }

  .weather-desc {
    font-size: 11px;
  }

  .metar-flight-cat { font-size: 10px; padding: 2px 8px; }
  .metar-raw { font-size: 9px; }
  .metar-obs-time { font-size: 9px; }

  .restaurant-rating-large {
    padding: 8px 10px;
    margin-bottom: 8px;
    gap: 6px;
  }

  .restaurant-stars {
    font-size: 15px;
  }

  .restaurant-review-count {
    font-size: 11px;
  }

  /* ---- Map toolbar ---- */
  .map-toolbar {
    bottom: 28px;
    right: 12px;
  }

  .map-style-btn {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  /* ---- Auth modals ---- */
  .auth-modal {
    width: calc(100% - 32px);
    padding: 20px 16px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .auth-modal-close {
    padding: 10px 14px;
    font-size: 20px;
  }

  .auth-modal h2 {
    font-size: 17px;
    margin-bottom: 16px;
  }

  .auth-toggle {
    font-size: 13px;
  }

  .auth-toggle a {
    padding: 8px 0;
    display: inline-block;
  }

  .submit-rest-modal {
    width: calc(100% - 32px);
    max-height: 88vh;
  }

  .suggestion-item {
    padding: 12px 14px;
    min-height: 44px;
  }

}

@media (prefers-reduced-motion: reduce), (any-pointer: coarse) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
