/* ========================================
   ROUTES STYLES
   Glassmorphism design matching main theme
   Bay of Quinte color scheme
   ======================================== */

:root {
  /* Bay of Quinte Official Color Palette */
  --bg-color: #576C5C;
  --bg-secondary: #4a5d4f;
  --text-color: rgba(247, 249, 249, 0.9);
  --text-muted: rgba(228, 235, 242, 0.7);
  
  /* Primary Greens */
  --green-dark: #576C5C;
  --green-mid: #84937B;
  --green-light: #A4AF9D;
  
  /* Primary Corals */
  --coral: #EF7B6D;
  --coral-light: #F4A79E;
  --coral-pale: #FCE4DF;
  
  /* Secondary (for maps, charts) */
  --yellow: #E69800;
  --yellow-light: #FFC051;
  
  /* Accent mappings */
  --accent-color: #EF7B6D;
  --accent-hover: #E69800;
  --accent-muted: rgba(239, 123, 109, 0.2);
  --yellow-muted: rgba(230, 152, 0, 0.2);
  
  /* Sage/Green accent */
  --sage-color: #A4AF9D;
  --sage-muted: rgba(164, 175, 157, 0.2);
}

/* ── Layout ────────────────────────────── */

.route-page {
  min-height: 100vh;
  background: var(--green-light);
}

/* Route header - hidden (title now in navbar) */
.route-header {
  display: none;
}

/* Header top bar */
.route-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--accent-color);
  text-decoration: none;
  padding: 0.375rem 0.75rem;
  margin-left: -0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.back-link:hover {
  background: var(--accent-muted);
}

.route-header-actions {
  display: flex;
  gap: 0.5rem;
}

.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.header-action-btn:hover {
  background: var(--yellow-muted);
  border-color: var(--yellow);
  color: var(--yellow);
}

.header-action-btn i {
  font-size: 0.875rem;
  opacity: 0.8;
}

.header-action-btn:hover i {
  opacity: 1;
}

/* Header main content */
.route-header-main {
  max-width: 800px;
}

.route-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.route-description {
  font-size: 0.9375rem;
  line-height: 1.5;
  opacity: 0.8;
  margin-bottom: 0.75rem;
}

@media (min-width: 1024px) {
  .route-header-main {
    max-width: 100%;
    text-align: center;
  }
  
  .route-title {
    font-size: 2rem;
  }
  
  .route-description {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
  }
}

.route-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Hide on desktop */
.mobile-only {
  display: flex;
}

@media (min-width: 768px) {
  .route-title {
    font-size: 1.875rem;
  }
  
  .header-action-btn span {
    display: inline;
  }
}

@media (min-width: 1024px) {
  .mobile-only {
    display: none;
  }
}

@media (max-width: 480px) {
  .header-action-btn span {
    display: none;
  }
  
  .header-action-btn {
    padding: 0.5rem 0.625rem;
  }
}

/* ── Routes Header Card ───────────────── */

.routes-header-card {
  background: rgba(132, 147, 123, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
}

.routes-header-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .routes-header-layout {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
  }
}

.routes-header-left {
  flex: 1;
}

.routes-header-left h1 {
  margin-bottom: 0.5rem;
}

.routes-header-left p {
  margin-bottom: 1rem;
}

/* Difficulty pills in header */
.routes-header-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.routes-header-pills .difficulty-pill {
  flex: 0 0 auto;
}

/* Filters in header */
.routes-header-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.routes-header-filters .filter-group {
  flex: 1;
  min-width: 120px;
}

.routes-header-filters .filter-search {
  flex: 2;
  min-width: 160px;
  max-width: 280px;
}

.routes-header-filters .filter-input,
.routes-header-filters .filter-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: inherit;
  font-size: 0.8125rem;
}

.routes-header-filters .filter-input:focus,
.routes-header-filters .filter-select:focus {
  outline: none;
  border-color: rgba(239, 123, 109, 0.5);
  background: rgba(255, 255, 255, 0.15);
}

.routes-header-filters .filter-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.routes-header-filters .filter-select option {
  background: var(--bg-secondary);
  color: white;
}

/* Stats on right side */
.routes-header-right {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
  .routes-header-right {
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0;
    padding-left: 1.5rem;
    border-top: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 120px;
  }
}

.route-header-stat {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  flex: 1;
}

@media (min-width: 768px) {
  .route-header-stat {
    flex: none;
    justify-content: flex-start;
  }
}

.route-header-stat i {
  font-size: 0.75rem;
  opacity: 0.7;
  align-self: center;
}

.route-header-stat-value {
  font-size: clamp(1rem, 4vw, 1.5rem);
  font-weight: 700;
  color: var(--yellow);
}

.route-header-stat-label {
  font-size: clamp(0.625rem, 2vw, 0.875rem);
  opacity: 0.7;
}

/* ── Difficulty Navigation (now in header) ── */

.difficulty-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1 1 calc(33.333% - 0.25rem);
  min-width: 0;
  justify-content: center;
  padding: 0.375rem 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  font-size: 0.6875rem;
  white-space: nowrap;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.difficulty-pill i {
  font-size: 0.625rem;
}

.difficulty-pill:hover {
  background: rgba(255, 255, 255, 0.2);
}

.difficulty-pill.active {
  background: var(--accent-muted);
  border: 1px solid rgba(239, 123, 109, 0.5);
}

.difficulty-pill .count {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.0625rem 0.375rem;
  border-radius: 9999px;
  font-size: 0.625rem;
}

/* ── Filters (now in header) ───────────── */

/* ── Routes Grid ───────────────────────── */

.routes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.route-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

.route-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

.route-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.route-card-map {
  height: 160px;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.route-card-map-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.route-card:hover .route-card-map-image {
  transform: scale(1.05);
}

.route-card-map-placeholder {
  font-size: 2rem;
  opacity: 0.3;
}

.route-card-content {
  padding: 1rem;
}

.route-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.route-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.route-card-stats .stat {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  opacity: 0.8;
}

.route-card-stats .stat i {
  opacity: 0.7;
}

.route-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Badges ────────────────────────────── */

.difficulty-badge,
.surface-badge,
.terrain-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
  border: 1px solid transparent;
}

/* Difficulty colors */
.difficulty-badge.difficulty-casual,
.difficulty-casual {
  background: var(--sage-muted);
  color: var(--text-color);
  border-color: rgba(164, 175, 157, 0.4);
}

.difficulty-badge.difficulty-easy,
.difficulty-easy {
  background: rgba(147, 197, 253, 0.2);
  color: var(--text-color);
  border-color: rgba(147, 197, 253, 0.4);
}

.difficulty-badge.difficulty-moderate,
.difficulty-moderate {
  background: var(--accent-muted);
  color: var(--text-color);
  border-color: rgba(239, 123, 109, 0.4);
}

.difficulty-badge.difficulty-hard,
.difficulty-hard {
  background: rgba(239, 68, 68, 0.2);
  color: var(--text-color);
  border-color: rgba(239, 68, 68, 0.4);
}

.difficulty-badge.difficulty-multi_day,
.difficulty-multiday {
  background: rgba(192, 132, 252, 0.2);
  color: var(--text-color);
  border-color: rgba(192, 132, 252, 0.4);
}

/* Surface colors */
.surface-badge {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-color);
  border-color: rgba(255, 255, 255, 0.2);
}

.surface-badge.surface-paved {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-color);
  border-color: rgba(148, 163, 184, 0.4);
}

.surface-badge.surface-mostly_paved {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-color);
  border-color: rgba(148, 163, 184, 0.3);
}

.surface-badge.surface-mixed,
.surface-badge.surface-mixed_surfaces {
  background: var(--sage-muted);
  color: var(--text-color);
  border-color: rgba(164, 175, 157, 0.4);
}

.surface-badge.surface-mostly_unpaved {
  background: rgba(180, 160, 120, 0.2);
  color: var(--text-color);
  border-color: rgba(180, 160, 120, 0.4);
}

/* Terrain colors */
.terrain-badge.terrain-flat {
  background: var(--sage-muted);
  color: var(--text-color);
  border-color: rgba(164, 175, 157, 0.4);
}

.terrain-badge.terrain-rolling {
  background: var(--accent-muted);
  color: var(--text-color);
  border-color: rgba(239, 123, 109, 0.4);
}

.terrain-badge.terrain-climbing {
  background: rgba(239, 68, 68, 0.2);
  color: var(--text-color);
  border-color: rgba(239, 68, 68, 0.4);
}

/* ── No Results ────────────────────────── */

.no-routes {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  opacity: 0.7;
}

.hidden {
  display: none !important;
}

/* ── Single Route Page ─────────────────── */

/* Map Container */
.route-map-container {
  position: relative;
  width: 100%;
  height: 400px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  overflow: hidden;
  margin: 0 1rem;
  width: calc(100% - 2rem);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.route-map {
  width: 100%;
  height: 100%;
}

/* Overlays - hidden on mobile */
.stats-overlay,
.elevation-overlay,
.cue-sheet-overlay {
  display: none;
}

/* Mobile top content - stats and elevation above map */
.mobile-top-content {
  display: block;
}

.mobile-stats-card {
  background: rgba(87, 108, 92, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1rem;
}

.mobile-route-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.mobile-stats-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-stat {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.mobile-stat i {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-right: 0.125rem;
}

.mobile-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--yellow);
}

.mobile-stat-label {
  font-size: 0.75rem;
  opacity: 0.7;
}

.mobile-actions {
  display: flex;
  gap: 0.5rem;
}

.mobile-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-badges {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
}

.mobile-badges .difficulty-badge,
.mobile-badges .surface-badge,
.mobile-badges .terrain-badge {
  font-size: 0.625rem;
  padding: 0.125rem 0.375rem;
  white-space: nowrap;
}

.mobile-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-color);
  transition: all 0.2s ease;
}

.mobile-action-btn:hover {
  background: var(--yellow-muted);
  color: var(--yellow);
}

/* Mobile action badges - styled like difficulty/surface badges */
.mobile-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.5rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 500;
  text-decoration: none;
  background: rgba(230, 152, 0, 0.2);
  color: var(--text-color);
  border: 1px solid rgba(230, 152, 0, 0.3);
  transition: all 0.2s ease;
}

.mobile-action-badge:hover {
  background: rgba(230, 152, 0, 0.3);
}

.mobile-action-badge i {
  font-size: 0.625rem;
}

.mobile-elevation {
  height: 80px;
  position: relative;
  margin: 0.75rem -0.5rem -0.5rem;
}

.mobile-elevation canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Mobile cue sheet - below map */
.mobile-cue-sheet {
  display: block;
}

/* Mobile description card - below cue sheet */
.mobile-description {
  display: block;
}

.mobile-description .route-section-card {
  background: rgba(87, 108, 92, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1rem;
}

.route-description-text {
  font-size: 0.9375rem;
  line-height: 1.6;
  opacity: 0.9;
}

/* Desktop description card - above footer */
.desktop-description {
  display: none;
}

@media (min-width: 1024px) {
  .desktop-description {
    display: block;
    margin: 0 1rem 0;
  }
  
  .desktop-description .route-section-card {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(87, 108, 92, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
  }
}

@media (min-width: 1024px) {
  /* Hide mobile content on desktop */
  .mobile-top-content,
  .mobile-cue-sheet,
  .mobile-description {
    display: none;
  }

  /* Add padding to route-page for spacing below navbar */
  .route-page {
    padding-top: 0.5rem;
  }

  /* Taller map on desktop */
  .route-map-container {
    height: calc(100vh - 180px);
    min-height: 600px;
    max-height: 900px;
    margin: 0 1rem 1rem;
    width: calc(100% - 2rem);
  }

  /* Stats Overlay - left side, extends down to elevation profile */
  .stats-overlay {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 1rem;
    left: 1rem;
    bottom: calc(1rem + 120px + 0.5rem); /* bottom margin + elevation height + gap */
    background: rgba(87, 108, 92, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10;
    padding: 1rem;
  }

  .stats-overlay-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .stats-overlay-item {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
  }

  .stats-overlay-icon {
    font-size: 0.6875rem;
    opacity: 0.5;
  }

  .stats-overlay-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--yellow);
    line-height: 1;
  }

  .stats-overlay-label {
    font-size: 0.6875rem;
    opacity: 0.7;
  }

  .stats-overlay-badges {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .stats-overlay-badges .difficulty-badge,
  .stats-overlay-badges .surface-badge,
  .stats-overlay-badges .terrain-badge {
    justify-content: center;
    font-size: 0.6875rem;
  }

  .stats-overlay-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .stats-overlay-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-color);
    background: rgba(230, 152, 0, 0.2);
    border: 1px solid rgba(230, 152, 0, 0.3);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
  }

  .stats-overlay-btn:hover {
    background: rgba(230, 152, 0, 0.3);
    border-color: var(--yellow);
    color: var(--text-color);
  }

  .stats-overlay-btn i {
    font-size: 0.75rem;
  }

  /* Elevation Overlay - bottom */
  .elevation-overlay {
    display: block;
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: calc(320px + 1rem + 0.5rem); /* cue sheet width + margin + gap */
    height: 120px;
    background: rgba(87, 108, 92, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10;
    padding: 0.75rem;
  }

  .elevation-overlay canvas {
    width: 100% !important;
    height: 100% !important;
  }

  /* Cue Sheet Overlay - right side */
  .cue-sheet-overlay {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: 320px;
    background: rgba(87, 108, 92, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10;
    overflow: hidden;
  }

  .cue-sheet-overlay-header {
    padding: 1rem;
    font-weight: 600;
    font-size: 0.9375rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .cue-sheet-overlay-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
  }

  .cue-sheet-overlay .cue-item {
    padding: 0.625rem 0.75rem 0.625rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .cue-sheet-overlay .cue-item:last-child {
    border-bottom: none;
  }

  .cue-sheet-overlay .cue-item:hover {
    background: rgba(224, 129, 114, 0.15);
  }
}

.map-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  opacity: 0.5;
  font-size: 1.25rem;
}

.map-error i {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Stats Card */
.route-stats-card,
.route-section-card {
  background: rgba(87, 108, 92, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-item {
  text-align: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

.stat-label {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}

/* Action Buttons */
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.action-button.primary {
  background: var(--accent-muted);
  color: var(--accent-color);
  border: 1px solid rgba(224, 129, 114, 0.3);
}

.action-button.primary:hover {
  background: rgba(224, 129, 114, 0.3);
  transform: translateY(-1px);
}

.action-button.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-button.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* Elevation Chart */
.elevation-chart-container {
  height: 200px;
  position: relative;
}

/* Cue Sheet */
.cue-sheet {
  max-height: 400px;
  overflow-y: auto;
}

.cue-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem 0.625rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.2s ease;
}

.cue-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.cue-item.cue-highlight {
  background: rgba(224, 129, 114, 0.3);
  animation: cue-pulse 0.5s ease-out;
}

@keyframes cue-pulse {
  0% {
    background: rgba(224, 129, 114, 0.5);
  }
  100% {
    background: rgba(224, 129, 114, 0.3);
  }
}

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

.cue-icon-distance {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  min-width: 50px;
}

.cue-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  flex-shrink: 0;
}

.cue-icon i {
  font-size: 0.75rem;
}

.cue-distance {
  font-size: 0.625rem;
  opacity: 0.6;
  text-align: center;
  white-space: nowrap;
}

.cue-text {
  flex: 1;
  font-size: 0.8125rem;
  line-height: 1.3;
}

/* Map Markers */
.cue-marker {
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Visible dot inside the hit area */
.cue-marker::after {
  content: '';
  width: 14px;
  height: 14px;
  background: var(--accent-color);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.cue-marker:hover::after {
  width: 28px;
  height: 28px;
}

.cue-marker .cue-number {
  position: absolute;
  font-size: 11px;
  font-weight: bold;
  color: white;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 1;
}

.cue-marker:hover .cue-number {
  opacity: 1;
}

.hover-marker {
  width: 16px;
  height: 16px;
  background: var(--accent-color);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Mapbox Popups */
.mapboxgl-popup-content {
  background: rgba(164, 175, 157, 0.95) !important;
  border-radius: 8px !important;
  padding: 0.75rem 1rem !important;
  color: white !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip {
  border-top-color: rgba(164, 175, 157, 0.95) !important;
}

.cue-popup-distance {
  font-size: 0.75rem;
  opacity: 0.7;
}

.cue-popup-text {
  font-weight: 500;
}

/* ── Responsive ────────────────────────── */

@media (max-width: 640px) {
  .routes-grid {
    grid-template-columns: 1fr;
  }

  .filters-section {
    padding: 0.75rem;
  }

  .filters-section .filter-group {
    flex: 1 1 calc(33.333% - 0.67rem);
    min-width: 0;
  }

  .filters-section .filter-group.flex-grow {
    flex: 1 1 100%;
  }

  .filter-select {
    padding: 0.5rem 0.5rem;
    font-size: 0.75rem;
  }

  .route-map-container {
    height: 300px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .elevation-chart-container {
    height: 160px;
  }
}

/* Desktop map height is now set in .cue-sheet-overlay media query above */

/* ── Scrollbar Styling ─────────────────── */

.cue-sheet::-webkit-scrollbar {
  width: 6px;
}

.cue-sheet::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.cue-sheet::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.cue-sheet::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Scrollbar for overlay */
.cue-sheet-overlay-content::-webkit-scrollbar {
  width: 6px;
}

.cue-sheet-overlay-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.cue-sheet-overlay-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.cue-sheet-overlay-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   HOMEPAGE FEATURED ROUTES CARD
   ======================================== */

.featured-routes-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.featured-routes-header {
  display: block;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
}

.featured-routes-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.featured-routes-grid {
  display: flex;
  flex-direction: column;
}

.featured-route-mini {
  display: block;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.featured-route-mini:last-child {
  border-bottom: none;
}

.featured-route-mini:hover {
  background: rgba(255, 255, 255, 0.05);
  padding-left: 1.5rem;
}

.mini-route-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
}

.difficulty-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.difficulty-dot.difficulty-casual {
  background: #22c55e;
}

.difficulty-dot.difficulty-easy {
  background: #3b82f6;
}

.difficulty-dot.difficulty-moderate {
  background: #fbbf24;
}

.difficulty-dot.difficulty-hard {
  background: #ef4444;
}

.difficulty-dot.difficulty-multi_day {
  background: #a855f7;
}

.mini-route-name {
  font-weight: 500;
  font-size: 0.9375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-route-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  font-size: 0.8125rem;
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.mini-stat {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.mini-stat i {
  font-size: 0.6875rem;
  opacity: 0.8;
}

.mini-route-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terrain-tag {
  font-size: 0.6875rem;
  padding: 0.1875rem 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  text-transform: capitalize;
}

.featured-routes-footer {
  display: block;
  padding: 0.875rem 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent-color);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition: all 0.2s ease;
}

.featured-routes-footer:hover {
  background: var(--yellow-muted);
  color: var(--yellow);
}

/* ========================================
   RIDDEN ROUTES - Badge & Status Styles
   ======================================== */

/* Ridden Badge - positioned absolutely on route cards */
.ridden-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.ridden-badge i {
  font-size: 0.6rem;
}

/* Route card needs position relative for badge positioning */
.route-card {
  position: relative;
}

/* Subtle highlight for ridden route cards */
.route-card.is-ridden {
  border-color: rgba(34, 197, 94, 0.4);
}

.route-card.is-ridden::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.05), transparent);
  pointer-events: none;
  z-index: 1;
}

/* Ridden stat in header */
.ridden-stat {
  color: #22c55e !important;
}

.ridden-stat i {
  color: #22c55e !important;
}

.ridden-stat .route-header-stat-value {
  color: #22c55e;
}

/* Loading state */
.ridden-loading {
  opacity: 0.6;
}

.ridden-loading i {
  color: var(--text-muted);
}

/* Re-auth message */
.ridden-reauth {
  opacity: 0.5;
  font-size: 0.75rem;
}

.ridden-reauth:hover {
  opacity: 0.8;
}

/* Ridden filter dropdown styling */
.filter-ridden .filter-select {
  border-color: rgba(34, 197, 94, 0.3);
}

.filter-ridden .filter-select:focus {
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

/* Mini route card ridden badge (homepage) */
.featured-route-mini {
  position: relative;
}

.featured-route-mini .ridden-badge {
  top: 0.25rem;
  right: 0.25rem;
  padding: 0.15rem 0.4rem;
  font-size: 0.55rem;
}

.featured-route-mini.is-ridden {
  border-color: rgba(34, 197, 94, 0.3);
}

/* ========================================
   ROUTE ACCESS DENIED OVERLAY
   ======================================== */

.route-access-denied {
  position: fixed;
  inset: 0;
  background: rgba(87, 108, 92, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.route-access-denied.hidden {
  display: none;
}

.access-denied-content {
  max-width: 400px;
  text-align: center;
  color: var(--text-color);
}

.access-denied-icon {
  font-size: 4rem;
  color: var(--coral);
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.access-denied-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.access-denied-text {
  font-size: 1rem;
  opacity: 0.8;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.access-denied-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: var(--coral);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-bottom: 1rem;
}

.access-denied-btn:hover {
  background: #e56a5d;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.access-denied-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.access-denied-link:hover {
  color: var(--text-color);
}
