/* CSS Variables & Design System */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #121824;
  --bg-card: rgba(22, 30, 46, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-orange: #f97316;
  --accent-orange-glow: rgba(249, 115, 22, 0.25);
  --accent-green: #10b981;
  --accent-blue: #3b82f6;
  --accent-red: #ef4444;
  --accent-gold: #eab308;
  
  --font-heading: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Typography & Utilities */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.text-gradient {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 50%, #f43f5e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-orange { color: var(--accent-orange); }
.text-green { color: var(--accent-green); }
.text-blue { color: var(--accent-blue); }

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: var(--accent-orange);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.badge-pill.red {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
}

/* Glassmorphism Card Utility */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
}

.nav-container {
  max-width: 1300px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.logo i {
  color: var(--accent-orange);
  width: 26px;
  height: 26px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a i {
  width: 16px;
  height: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent-orange);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-orange-glow);
}

.btn-primary:hover {
  background: #ea580c;
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.btn-gradient {
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.btn-gradient:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-dark {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-gold {
  background: #eab308;
  color: #0f172a;
  font-weight: 700;
}

.btn-gold:hover {
  background: #facc15;
  transform: translateY(-2px);
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  background: url('assets/hero_bg.jpg') center/cover no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 23, 0.65) 0%, rgba(10, 14, 23, 0.95) 85%, var(--bg-primary) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1050px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero h1 .arrow {
  color: var(--accent-orange);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 auto 36px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.metric-card {
  background: rgba(18, 24, 36, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-orange);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.metric-icon.orange {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.metric-icon.red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.metric-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.metric-value small {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-label {
  font-size: 0.82rem;
  color: var(--text-secondary);

}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

/* Main Content Layout */
.main-content {
  max-width: 1300px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.section-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.section-header.center {
  text-align: center;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.section-header h2 {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* Map Styling */
.map-controls-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.map-layer-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
}

.map-layer-selector select {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
}

.map-wrapper {
  position: relative;
  height: 520px;
  width: 100%;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
}

.map-legend {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 500;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(8px);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.color-climb { background: #3b82f6; }
.color-downhill { background: #ef4444; }
.color-highlight { background: #f59e0b; }

/* Elevation Chart Styling */
.profile-stats {
  display: flex;
  gap: 16px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.profile-stats span {
  display: flex;
  align-items: center;
  gap: 6px;

}

.chart-wrapper {
  padding: 24px;
  height: 320px;
  position: relative;
}

/* Downhill Trails Grid */
.trails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.trail-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition);
}

.trail-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

.trail-card.featured {
  border-color: rgba(239, 68, 68, 0.4);
}

.trail-card.ultimate-card {
  border-color: rgba(234, 179, 8, 0.5);
  background: linear-gradient(145deg, rgba(22, 30, 46, 0.85) 0%, rgba(35, 28, 12, 0.6) 100%);
  grid-column: span 1;
}

@media (min-width: 1100px) {
  .trail-card.ultimate-card {
    grid-column: span 2;
  }
}

.trail-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.trail-number {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.trail-number.gold {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
  border-color: rgba(234, 179, 8, 0.4);
}

.trail-title-meta {
  flex: 1;
}

.trail-title-meta h3 {
  font-size: 1.2rem;
  line-height: 1.25;
}

.trail-sub {
  font-size: 0.8rem;
  color: var(--text-muted);

}

.difficulty-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.difficulty-badge.s1 {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.difficulty-badge.s2 {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.difficulty-badge.s3 {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.trail-stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.t-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trail-description {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.trail-media-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trail-photo {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #000;
  border: 1px solid var(--border-color);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.trail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

/* Host Guide Section */
.host-guide-card {
  padding: 36px;
}

.host-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.host-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.host-icon i {
  width: 28px;
  height: 28px;
}

.host-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.host-option {
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.host-option h4 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.host-option pre {
  background: #05080f;
  padding: 10px 14px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.85rem;
  color: #38bdf8;
  margin: 10px 0;
  overflow-x: auto;
}

.host-option small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 30px 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Responsive Rules */
@media (max-width: 768px) {
  .nav-links a:not(.btn-sm) {
    display: none;
  }
  
  .map-wrapper {
    height: 380px;
  }
  
  .hero {
    padding-top: 100px;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
}
