/* ========================================
   GreenTrails — Design System & Styles
   V2 — With sidebar, hotspots, length filters
   ======================================== */

:root {
  /* Colors */
  --bg-primary: #0a0f0d;
  --bg-secondary: #111916;
  --bg-tertiary: #1a2520;
  --bg-glass: rgba(17, 25, 22, 0.85);
  --bg-glass-light: rgba(26, 37, 32, 0.9);
  --surface: #1e2e28;
  --surface-hover: #253830;
  --border: rgba(72, 187, 120, 0.15);
  --border-strong: rgba(72, 187, 120, 0.3);

  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;

  --accent: #4ade80;
  --accent-glow: rgba(74, 222, 128, 0.25);
  --accent-soft: rgba(74, 222, 128, 0.1);
  --accent-secondary: #2dd4bf;
  --accent-warm: #fbbf24;

  --text-primary: #f0fdf4;
  --text-secondary: #a7c4b8;
  --text-muted: #6b8f7e;
  --text-accent: #4ade80;

  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  /* Sizing */
  --header-height: 64px;
  --info-bar-height: 44px;
  --panel-width: 360px;
  --sidebar-width: 380px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-normal: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);
}

/* ========== Reset & Base ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

input, button, select {
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
  color: inherit;
}

button {
  cursor: pointer;
}

/* ========== Loading Overlay ========== */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  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); }
}

.loading-title {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.loading-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ========== App Container ========== */
.app {
  position: relative;
  height: 100%;
  width: 100%;
}

/* ========== Top Bar ========== */
.top-bar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  transition: var(--transition-normal);
}

.top-bar-left {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-toggle {
  display: flex;
}

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

.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.top-bar-center {
  flex: 1;
  max-width: 520px;
  margin: 0 auto;
  position: relative;
}

.search-container {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 42px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  transition: var(--transition-fast);
}

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

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-sm);
  background: var(--surface);
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.search-clear:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.search-clear svg {
  width: 16px;
  height: 16px;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-glass-light);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-hover) transparent;
}

.search-results.hidden {
  display: none;
}

.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition-fast);
  border-bottom: 1px solid var(--border);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--accent-soft);
}

.search-result-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.search-result-icon svg {
  width: 18px;
  height: 18px;
}

.search-result-text h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.search-result-text p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.search-loading {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Top Bar Right */
.top-bar-right {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.toolbar-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  position: relative;
}

.toolbar-btn svg {
  width: 20px;
  height: 20px;
}

.toolbar-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.toolbar-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}


/* =============================================
   FLOATING SIDEBAR FAB
   ============================================= */
.sidebar-fab {
  position: absolute;
  top: calc(var(--header-height) + 48px);
  left: 16px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  cursor: pointer;
  transition: left var(--transition-normal), background var(--transition-fast), transform var(--transition-fast);
}

.sidebar-fab svg {
  width: 20px;
  height: 20px;
  position: absolute;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

/* When sidebar is open, move FAB to edge of sidebar */
.sidebar-fab.sidebar-open {
  left: calc(var(--sidebar-width) + 20px);
}

.sidebar-fab.sidebar-open .fab-icon-open {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.sidebar-fab.sidebar-open .fab-icon-close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.sidebar-fab:not(.sidebar-open) .fab-icon-open {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.sidebar-fab:not(.sidebar-open) .fab-icon-close {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.sidebar-fab:hover {
  background: var(--surface-hover);
  transform: scale(1.08);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.sidebar-fab:active {
  transform: scale(0.95);
}


/* =============================================
   LEFT SIDEBAR — Byway Results List
   ============================================= */
.left-sidebar {
  position: absolute;
  top: calc(var(--header-height) + 40px);
  left: 16px;
  bottom: calc(var(--info-bar-height) + 24px);
  width: var(--sidebar-width);
  z-index: 999;
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition-normal), opacity var(--transition-normal), width var(--transition-normal);
}

.left-sidebar.collapsed {
  transform: translateX(calc(-1 * var(--sidebar-width) - 20px));
  opacity: 0;
  pointer-events: none;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sidebar-title-row h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-title-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-close-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.sidebar-close-btn svg {
  width: 16px;
  height: 16px;
}

.sidebar-close-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.sidebar-count {
  background: var(--accent);
  color: var(--bg-primary);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  min-width: 28px;
  text-align: center;
}

.sidebar-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sort-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sort-icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.sort-select {
  width: 100%;
  padding: 8px 12px 8px 32px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.sort-select:focus {
  border-color: var(--accent);
}

/* Length filter pills */
.length-filter-pills {
  display: flex;
  gap: 6px;
}

.pill {
  flex: 1;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  transition: var(--transition-fast);
  cursor: pointer;
  line-height: 1.3;
}

.pill small {
  display: block;
  font-weight: 400;
  font-size: 10px;
  opacity: 0.7;
}

.pill:hover {
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Sidebar results list */
.sidebar-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-hover) transparent;
}

.sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  gap: 10px;
  color: var(--text-muted);
}

.sidebar-empty h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.sidebar-empty p {
  font-size: 13px;
  line-height: 1.5;
}

/* Individual byway card in sidebar */
.byway-card {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.byway-card:hover {
  background: var(--accent-soft);
}

.byway-card.active {
  background: rgba(74, 222, 128, 0.08);
  border-left: 3px solid var(--accent);
}

.byway-card-warning {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--accent-warm);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
}

/* Detail panel warning banner */
.detail-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--accent-warm);
  font-size: 13px;
  line-height: 1.4;
}

.detail-warning svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.detail-warning strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 700;
}

.detail-warning p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.byway-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.byway-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  line-height: 1.3;
}

.byway-card-type {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.byway-card-type.boat {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green-400);
}

.byway-card-type.ucr {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
}

.byway-card-type.greenLane {
  background: rgba(45, 212, 191, 0.15);
  color: var(--accent-secondary);
}

.byway-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.byway-card-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.byway-card-meta-item svg {
  width: 13px;
  height: 13px;
}

.byway-card-difficulty {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 2px;
}

.byway-card-difficulty.easy { background: var(--green-400); }
.byway-card-difficulty.moderate { background: var(--accent-warm); }
.byway-card-difficulty.challenging { background: var(--danger); }

.byway-card-surface {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.byway-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.byway-card-btn {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.byway-card-btn svg {
  width: 12px;
  height: 12px;
}

.byway-card-btn.nav-btn {
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: white;
}

.byway-card-btn.nav-btn:hover {
  opacity: 0.9;
}

.byway-card-btn.sv-btn {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.byway-card-btn.sv-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.byway-card-btn.share-btn {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.byway-card-btn.share-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ========== Side Panels ========== */
.side-panel {
  position: absolute;
  top: calc(var(--header-height) + 40px);
  right: 16px;
  width: var(--panel-width);
  max-height: calc(100vh - var(--header-height) - var(--info-bar-height) - 80px);
  z-index: 999;
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-hover) transparent;
  transform: translateX(0);
  opacity: 1;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.side-panel.hidden {
  transform: translateX(20px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  z-index: 1;
}

.panel-header h3 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.panel-close svg {
  width: 18px;
  height: 18px;
}

.panel-close:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

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

.panel-section:last-child {
  border-bottom: none;
}

.panel-section h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ========== Layer Picker ========== */
.layer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 16px 20px;
}

.layer-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  transition: var(--transition-fast);
  cursor: pointer;
}

.layer-option:hover {
  background: var(--surface-hover);
}

.layer-option.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.layer-option span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.layer-option.active span {
  color: var(--accent);
}

.layer-preview {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.layer-preview-standard {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 50%, #a5d6a7 100%);
}

.layer-preview-satellite {
  background: linear-gradient(135deg, #1a3a1a 0%, #2d5a2d 50%, #1e4d2b 100%);
}

.layer-preview-terrain {
  background: linear-gradient(135deg, #d7ccc8 0%, #a1887f 30%, #6d4c41 60%, #4e342e 100%);
}

.layer-preview-dark {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* ========== Toggle Switches ========== */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}

.toggle-row input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--surface);
  border-radius: 12px;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition-fast);
}

.toggle-row input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-row input:checked + .toggle-slider::after {
  transform: translateX(20px);
  background: white;
}

/* ========== Checkboxes & Radios ========== */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}

.checkbox-row input[type="checkbox"],
.checkbox-row input[type="radio"] {
  display: none;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-radius: 5px;
  flex-shrink: 0;
  position: relative;
  transition: var(--transition-fast);
}

.checkbox-row input:checked + .custom-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-row input:checked + .custom-checkbox::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 6px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: var(--transition-fast);
}

.checkbox-row input:checked + .custom-radio {
  border-color: var(--accent);
}

.checkbox-row input:checked + .custom-radio::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

/* Difficulty Badges */
.difficulty-badge {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.difficulty-badge.easy {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green-400);
}

.difficulty-badge.moderate {
  background: rgba(251, 191, 36, 0.15);
  color: var(--accent-warm);
}

.difficulty-badge.challenging {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Range Slider */
.range-container {
  padding: 4px 0;
}

.range-container input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--surface);
  border-radius: 3px;
  outline: none;
}

.range-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-glow);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.range-value {
  color: var(--accent);
  font-weight: 600;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  margin: 16px 20px;
  width: calc(100% - 40px);
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: white;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(22, 163, 74, 0.4);
}

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

/* ========== Hotspots Panel ========== */
.hotspots-list {
  padding: 8px 0;
}

.hotspot-card {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition-fast);
}

.hotspot-card:last-child {
  border-bottom: none;
}

.hotspot-card:hover {
  background: var(--accent-soft);
}

.hotspot-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.hotspot-rank {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-warm), #f97316);
  color: var(--bg-primary);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hotspot-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.hotspot-region {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.hotspot-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.hotspot-stats {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.hotspot-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hotspot-stat svg {
  width: 12px;
  height: 12px;
  color: var(--accent);
}

.hotspot-btn {
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.hotspot-btn:hover {
  opacity: 0.9;
}

.hotspot-btn svg {
  width: 13px;
  height: 13px;
}

/* ========== Detail Panel ========== */
.detail-content {
  padding: 16px 20px;
}

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.detail-row-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.detail-row-icon svg {
  width: 18px;
  height: 18px;
}

.detail-row-content {
  flex: 1;
}

.detail-row-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.detail-row-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.detail-tag {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border);
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.detail-action-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.detail-action-btn svg {
  width: 16px;
  height: 16px;
}

.detail-action-btn.primary {
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: white;
}

.detail-action-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.detail-action-btn.secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.detail-action-btn.secondary:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ========== Street View Panel ========== */
.streetview-panel {
  position: absolute;
  bottom: calc(var(--info-bar-height) + 24px);
  left: calc(var(--sidebar-width) + 32px);
  right: 16px;
  height: 320px;
  z-index: 998;
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.streetview-panel.hidden {
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.streetview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.streetview-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.streetview-header h3 svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.streetview-container {
  flex: 1;
  position: relative;
}

.streetview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.streetview-hint {
  font-size: 11px;
  opacity: 0.5;
}

.streetview-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.streetview-iframe.hidden {
  display: none;
}

/* ========== Map Container ========== */
.map-container {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Leaflet overrides */
.leaflet-control-zoom,
.leaflet-control-attribution {
  display: none !important;
}

.leaflet-popup-content-wrapper {
  background: var(--bg-glass-light) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  color: var(--text-primary) !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

.leaflet-popup-tip {
  background: var(--bg-glass-light) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.leaflet-popup-close-button {
  color: var(--text-muted) !important;
  font-size: 20px !important;
  padding: 4px 8px !important;
}

.leaflet-popup-close-button:hover {
  color: var(--text-primary) !important;
}

/* Custom popup styles */
.popup-content {
  padding: 14px 16px;
}

.popup-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.popup-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.popup-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.popup-tag {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.popup-tag.boat {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green-400);
}

.popup-tag.ucr {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
}

.popup-tag.green-lane {
  background: rgba(45, 212, 191, 0.15);
  color: var(--accent-secondary);
}

.popup-btn {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: white;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.popup-btn:hover {
  opacity: 0.9;
}

/* User location marker pulse */
.user-location-pulse {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid white;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4);
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
  70% { box-shadow: 0 0 0 20px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* ========== Info Bar ========== */
.info-bar {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  height: var(--info-bar-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
}

.info-bar-left,
.info-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.info-badge svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.info-coords {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  font-weight: 400;
}

.zoom-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.zoom-btn svg {
  width: 16px;
  height: 16px;
}

.zoom-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ========== Toast Notifications ========== */
.toast-container {
  position: absolute;
  top: calc(var(--header-height) + 40px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 400px;
  padding: 12px 20px;
  background: var(--bg-glass-light);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  pointer-events: auto;
  animation: toastIn 0.3s var(--ease-spring);
}

.toast.toast-exit {
  animation: toastOut 0.25s var(--ease-out) forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
  }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--accent); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--info); }
.toast.warning .toast-icon { color: var(--warning); }

/* ========== Responsive ========== */
@media (max-width: 900px) {
  .left-sidebar {
    width: 320px;
    --sidebar-width: 320px;
  }
}

@media (max-width: 768px) {
  .top-bar {
    top: 8px;
    left: 8px;
    right: 8px;
    padding: 0 10px;
    height: 56px;
    gap: 8px;
  }

  .logo-text {
    display: none;
  }

  .search-input {
    height: 36px;
    font-size: 13px;
  }

  .toolbar-btn {
    width: 36px;
    height: 36px;
  }

  .left-sidebar {
    left: 8px;
    right: 8px;
    width: auto;
    top: 72px;
    bottom: 60px;
    z-index: 1001;
  }

  .left-sidebar.collapsed {
    transform: translateX(-110%);
  }

  .sidebar-fab {
    top: 80px;
    left: 8px;
    width: 40px;
    height: 40px;
  }

  .sidebar-fab.sidebar-open {
    left: 8px;
    top: calc(100vh - 120px);
  }

  .side-panel {
    right: 8px;
    left: 8px;
    width: auto;
    top: 72px;
  }

  .info-bar {
    bottom: 8px;
    left: 8px;
    right: 8px;
  }

  .info-coords {
    display: none;
  }

  .streetview-panel {
    left: 8px;
    right: 8px;
    bottom: 60px;
    height: 240px;
  }
}

/* ========== Custom Scrollbar ========== */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--surface-hover);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ========== Animations ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fadeIn {
  animation: fadeIn 0.3s var(--ease-out);
}

.animate-slideUp {
  animation: slideUp 0.3s var(--ease-out);
}

/* Sidebar loading state */
.sidebar-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  gap: 12px;
}

.sidebar-loading .loading-spinner {
  width: 32px;
  height: 32px;
}

.sidebar-loading p {
  font-size: 13px;
  color: var(--text-muted);
}
