/* ========================================
   EVENTS 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 accents) */
  --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);
}

/* ── Events Header Card ───────────────── */

.events-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;
}

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

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

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

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

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

.events-header-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.events-header-controls .filter-group {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
}

.events-header-controls .filter-input {
  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.875rem;
}

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

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

.events-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) {
  .events-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;
  }
}

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

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

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

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

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

/* ── Events Controls (legacy, now in header) ── */

/* ── Events Layout (Side-by-side on desktop) ── */

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

@media (min-width: 1024px) {
  .events-layout {
    flex-direction: row;
    align-items: flex-start;
    max-height: calc(100vh - 200px);
  }
  
  .events-layout .calendar-container {
    flex: 0 0 380px;
    position: sticky;
    top: 1rem;
  }
  
  .events-layout .events-list-container {
    flex: 1;
    min-width: 0;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 0.5rem;
  }
  
  /* Custom scrollbar for events list */
  .events-layout .events-list-container::-webkit-scrollbar {
    width: 6px;
  }
  
  .events-layout .events-list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
  }
  
  .events-layout .events-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
  }
  
  .events-layout .events-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
  }
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-btn:hover {
  color: var(--text-color);
}

.view-btn.active {
  background: var(--accent-muted);
  color: var(--accent-color);
}

/* Filter styles moved to .events-header-controls */

.past-events-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--text-muted);
  white-space: nowrap;
}

.past-events-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--coral);
}

/* ── Calendar View ───────────────────── */

.calendar-container {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
}

.calendar-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

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

.calendar-nav-btn:hover {
  background: var(--yellow-muted);
  color: var(--yellow);
}

.calendar-month-title {
  flex: 1;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
}

.calendar-today-btn {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: var(--text-color);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-today-btn:hover {
  background: var(--yellow-muted);
  color: var(--yellow);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 0.5rem;
}

.calendar-weekdays > div {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.6;
  padding: 0.5rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  min-height: 50px;
}

.calendar-day:hover {
  background: rgba(255, 255, 255, 0.1);
}

.calendar-day.other-month {
  opacity: 0.3;
}

.calendar-day.today {
  background: var(--accent-muted);
  border: 2px solid var(--accent-color);
}

.calendar-day.selected {
  background: var(--accent-color);
  color: white;
}

.calendar-day.has-events::after {
  content: '';
  position: absolute;
  bottom: 6px;
  width: 6px;
  height: 6px;
  background: var(--coral);
  border-radius: 50%;
}

.calendar-day.has-events.selected::after {
  background: white;
}

.calendar-day-number {
  font-weight: 500;
}

/* Calendar day events panel */
.calendar-day-events {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.day-events-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--yellow);
}

.day-events-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.day-event-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.day-event-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.day-event-time {
  font-size: 0.75rem;
  opacity: 0.7;
  min-width: 60px;
}

.day-event-name {
  flex: 1;
  font-weight: 500;
}

.day-event-arrow {
  opacity: 0.5;
}

.no-events-message {
  text-align: center;
  opacity: 0.5;
  padding: 1rem;
}

/* ── List View ──────────────────────── */

.events-list-container {
  /* Container styles */
}

.events-list-header {
  font-size: 0.875rem;
  opacity: 0.7;
  margin-bottom: 1rem;
}

.events-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) and (max-width: 1023px) {
  .events-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

.event-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;
}

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

.event-card.past {
  opacity: 0.7;
}

.event-card.highlight {
  animation: card-highlight 1.5s ease;
}

@keyframes card-highlight {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 123, 109, 0);
  }
  20%, 80% {
    box-shadow: 0 0 0 3px rgba(239, 123, 109, 0.6);
  }
}

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

.event-card-visual {
  height: 140px;
  background: rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

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

.event-card:hover .event-card-banner,
.event-card:hover .event-card-map {
  transform: scale(1.05);
}

.event-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  opacity: 0.3;
  background: linear-gradient(135deg, var(--green-mid) 0%, var(--green-dark) 100%);
}

.event-date-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--coral);
  color: white;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.event-date-badge .date-month {
  display: block;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.event-date-badge .date-day {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

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

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

.event-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8125rem;
  opacity: 0.8;
}

.event-card-meta .event-time,
.event-card-meta .event-location {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.event-card-meta i {
  opacity: 0.7;
  font-size: 0.75rem;
}

.event-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.event-routes-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  background: rgba(230, 152, 0, 0.2);
  color: var(--text-color);
  border: 1px solid rgba(230, 152, 0, 0.3);
  border-radius: 6px;
  font-size: 0.75rem;
}

.event-past-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 0.75rem;
  opacity: 0.7;
}

/* ── Single Event Page ─────────────── */

.event-page {
  min-height: 100vh;
}

.event-banner {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.event-banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, var(--bg-color) 100%);
}

@media (min-width: 768px) {
  .event-banner {
    height: 300px;
  }
}

.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);
}

.event-detail-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;
}

/* Event Header Grid: Date spans 3 rows left, details stack right */
.event-header-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  gap: 0.5rem 1rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.event-detail-date {
  grid-row: span 3;
  background: var(--coral);
  color: white;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  text-align: center;
  min-width: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.125rem;
}

.event-detail-date.past {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.event-detail-date.upcoming {
  background: var(--coral);
}

.detail-date-month {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-date-day {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.detail-date-year {
  display: block;
  font-size: 0.6875rem;
  opacity: 0.8;
}

.detail-date-status {
  display: block;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
  padding-top: 0.375rem;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.event-detail-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 0.875rem;
}

.event-detail-item i {
  font-size: 0.875rem;
  opacity: 0.7;
  color: var(--yellow);
  width: 1rem;
  text-align: center;
}

.event-detail-item span {
  opacity: 0.9;
  line-height: 1.3;
}

/* Organizers in grid item */
.event-organizers-item {
  flex-wrap: wrap;
}

.event-organizers-item .organizers-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.event-organizers-item .organizer-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  background: rgba(239, 123, 109, 0.15);
  border: 1px solid rgba(239, 123, 109, 0.25);
  border-radius: 12px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--coral-light);
}

/* RWGPS Link Row */
.event-rwgps-row {
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.rwgps-link:hover {
  background: rgba(230, 152, 0, 0.3);
}

.rwgps-link i {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Title */
.event-detail-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .event-detail-title {
    font-size: 1.75rem;
  }
}



/* Mobile: Maintain 2-column layout */
@media (max-width: 480px) {
  .event-header-grid {
    gap: 0.375rem 0.75rem;
  }
  
  .event-detail-date {
    padding: 0.75rem 1rem;
    min-width: 70px;
  }
  
  .detail-date-day {
    font-size: 1.75rem;
  }
  
  .event-detail-item {
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
  }
}

/* Event Sections */
.event-section-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--yellow);
}

.section-title i {
  opacity: 0.8;
}

.event-description {
  line-height: 1.7;
  opacity: 0.9;
}

.event-description p {
  margin-bottom: 1rem;
}

.event-description p:last-child {
  margin-bottom: 0;
}

/* Organizers */
.organizers-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.organizer-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.organizer-avatar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-muted);
  color: var(--accent-color);
  border-radius: 50%;
}

.organizer-name {
  font-weight: 500;
}

/* Routes Section */
.event-routes-map-container {
  height: 250px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.event-routes-map {
  width: 100%;
  height: 100%;
}

.event-routes-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.event-route-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.event-route-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.route-item-info {
  flex: 1;
}

.route-item-name {
  display: block;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.route-item-stats {
  font-size: 0.8125rem;
  opacity: 0.7;
}

.route-item-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: capitalize;
  background: rgba(255, 255, 255, 0.1);
}

.route-item-badge.casual { background: rgba(164, 175, 157, 0.3); }
.route-item-badge.easy { background: rgba(147, 197, 253, 0.3); }
.route-item-badge.moderate { background: rgba(239, 123, 109, 0.3); }
.route-item-badge.hard { background: rgba(239, 68, 68, 0.3); }

.route-item-arrow {
  opacity: 0.5;
}

/* Route start marker */
.route-start-marker {
  width: 28px;
  height: 28px;
  background: var(--coral);
  border: 2px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.route-start-marker span {
  color: white;
  font-size: 12px;
  font-weight: 700;
}

/* Photos Grid */
.event-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.event-photo {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
}

.event-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.event-photo:hover img {
  transform: scale(1.05);
}

/* ── No Events ────────────────────────── */

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

.hidden {
  display: none !important;
}

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

@media (max-width: 640px) {
  .events-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .view-toggle {
    justify-content: center;
  }
  
  .events-filters {
    flex-direction: column;
  }
  
  .events-filters .filter-group {
    max-width: none;
  }
  
  .events-grid {
    grid-template-columns: 1fr;
  }
  
  .calendar-day {
    min-height: 40px;
    font-size: 0.75rem;
  }
  
  .calendar-weekdays > div {
    font-size: 0.625rem;
  }
}

/* ── Route Preview Card ──────────────── */

.route-preview-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;
  margin-bottom: 1rem;
}

.route-preview-card:last-child {
  margin-bottom: 0;
}

.route-preview-map-container {
  position: relative;
  height: 180px;
}

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

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

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

.route-preview-title .route-number {
  color: var(--coral);
  margin-right: 0.375rem;
}

/* Stats row - matches routes single page mobile-stats-row */
.route-preview-stats-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
}

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

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

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

/* Meta row - matches routes single page mobile-meta-row */
.route-preview-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.route-preview-badges {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.375rem;
}

/* Route Badge Styles (for route preview cards) */
.route-preview-badges .difficulty-badge,
.route-preview-badges .surface-badge,
.route-preview-badges .terrain-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  border-radius: 5px;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: capitalize;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* Mobile: Smaller badges to fit on one row */
@media (max-width: 480px) {
  .route-preview-badges {
    gap: 0.25rem;
  }
  
  .route-preview-badges .difficulty-badge,
  .route-preview-badges .surface-badge,
  .route-preview-badges .terrain-badge {
    padding: 0.125rem 0.375rem;
    font-size: 0.625rem;
    border-radius: 4px;
  }
}

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

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

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

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

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

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

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

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

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

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

/* Terrain colors */
.terrain-badge {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.terrain-badge.terrain-flat {
  background: var(--sage-muted, rgba(164, 175, 157, 0.2));
  border-color: rgba(164, 175, 157, 0.4);
}

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

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

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

.route-preview-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

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

.route-preview-action-btn i {
  font-size: 0.6875rem;
  opacity: 0.8;
}

/* ── Mapbox Popup Styles ──────────────── */

.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;
}
