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

:root {
  --bg: #0F1117;
  --bg-card: #1A1D27;
  --bg-card-hover: #222636;
  --surface: #252A37;
  --border: #2E3446;
  --text: #E8E9ED;
  --text-dim: #8B8F9E;
  --text-muted: #5C6070;
  --accent: #FF6B35;
  --accent-glow: rgba(255, 107, 53, 0.15);
  --day1: #3B82F6;
  --day2: #8B5CF6;
  --day3: #EC4899;
  --day4: #F59E0B;
  --day5: #10B981;
  --day6: #EF4444;
  --day7: #6366F1;
  --radius: 12px;
  --radius-lg: 20px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ========== HERO ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0F1117 0%, #1a1030 30%, #0F1117 70%, #0a1520 100%);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255, 107, 53, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 40px 24px;
  max-width: 800px;
}

.hero-tag {
  display: inline-block;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 8px 20px;
  border-radius: 100px;
  border: 1px solid rgba(255, 107, 53, 0.2);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}

.hero-accent {
  background: linear-gradient(135deg, var(--accent), #FF9F6B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

.hero-route {
  font-size: 0.95rem;
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.8;
}

.hero-cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 36px;
  border-radius: 100px;
  text-decoration: none;
  transition: all 0.3s;
  box-shadow: 0 4px 24px rgba(255, 107, 53, 0.3);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 107, 53, 0.4);
}

/* ========== SECTIONS ========== */
.section-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 0 24px;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.section-header p {
  color: var(--text-dim);
}

/* ========== MAP ========== */
.map-section {
  padding: 80px 0 40px;
}

#trip-map {
  height: 500px;
  margin: 0 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.map-legend {
  display: flex;
  gap: 8px;
  padding: 20px 24px;
  overflow-x: auto;
  justify-content: center;
  flex-wrap: wrap;
}

.legend-btn {
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

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

.legend-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.legend-btn[data-day]:not([data-day="all"]).active {
  background: var(--day-color);
  border-color: var(--day-color);
}

/* ========== TIMELINE ========== */
.timeline-section {
  padding: 60px 24px 80px;
  max-width: 800px;
  margin: 0 auto;
}

.day-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.day-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.day-nav-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.day-nav-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ========== DAY CARDS ========== */
.day-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  transition: all 0.3s;
}

.day-card.featured {
  border-color: var(--day5);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.1);
}

.day-card[data-day="1"] .day-number { background: var(--day1); }
.day-card[data-day="2"] .day-number { background: var(--day2); }
.day-card[data-day="3"] .day-number { background: var(--day3); }
.day-card[data-day="4"] .day-number { background: var(--day4); }
.day-card[data-day="5"] .day-number { background: var(--day5); }
.day-card[data-day="6"] .day-number { background: var(--day6); }
.day-card[data-day="7"] .day-number { background: var(--day7); }

.day-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  user-select: none;
}

.day-number {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  flex-shrink: 0;
}

.day-info {
  flex: 1;
  min-width: 0;
}

.day-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.featured-label {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: var(--day5);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 100px;
  vertical-align: middle;
  margin-left: 8px;
  letter-spacing: 0.5px;
}

.day-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.meta-item svg {
  opacity: 0.5;
}

.flags {
  font-weight: 600;
  color: var(--text-muted);
}

.day-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 8px;
  transition: transform 0.3s;
  flex-shrink: 0;
}

.day-card.open .day-toggle {
  transform: rotate(180deg);
}

/* ========== DAY CONTENT ========== */
.day-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.day-card.open .day-content {
  max-height: 2000px;
}

.stop {
  display: flex;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  transition: background 0.2s;
}

.stop:hover {
  background: var(--bg-card-hover);
}

.stop.highlight {
  background: rgba(255, 255, 255, 0.02);
}

.stop.star::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.stop.star {
  position: relative;
  border-left: 3px solid var(--accent);
}

.stop-time {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 50px;
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}

.stop-details {
  flex: 1;
}

.stop-details h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.stop-details p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 100px;
  margin-top: 8px;
}

.badge-time {
  background: rgba(99, 102, 241, 0.15);
  color: #818CF8;
}

.badge-optional {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-weight: 500;
}

/* ========== BUDGET ========== */
.budget-section {
  padding: 80px 24px;
  max-width: 700px;
  margin: 0 auto;
}

.budget-toggle {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 32px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: 100px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.budget-btn {
  flex: 1;
  padding: 12px 24px;
  border: none;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  background: transparent;
  color: var(--text-dim);
}

.budget-btn.active {
  background: var(--accent);
  color: #fff;
}

.budget-content.hidden {
  display: none;
}

.budget-verdict {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.budget-verdict.negative {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.budget-verdict.positive {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.verdict-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.budget-verdict.negative .verdict-icon {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
}

.budget-verdict.positive .verdict-icon {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
}

.budget-verdict strong {
  display: block;
  margin-bottom: 4px;
}

.budget-verdict p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.budget-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.budget-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.budget-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.budget-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.budget-per {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.budget-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: var(--surface);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1.1rem;
}

.total-amount {
  color: var(--accent);
  font-size: 1.3rem;
}

.total-amount small {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ========== TIPS ========== */
.tips-section {
  padding: 60px 24px 80px;
  max-width: 900px;
  margin: 0 auto;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s;
}

.tip-card:hover {
  border-color: var(--accent);
}

.tip-icon {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.tip-card h4 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.tip-card p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
}

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

/* ========== LEAFLET OVERRIDES ========== */
.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border-radius: var(--radius) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
}

.leaflet-popup-tip {
  background: var(--bg-card) !important;
}

.leaflet-popup-content {
  font-family: 'Inter', sans-serif !important;
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
}

.leaflet-popup-content strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}

.leaflet-popup-content .popup-day {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  margin-bottom: 8px;
  color: #fff;
}

.popup-desc {
  color: var(--text-dim);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-stats {
    gap: 16px;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  #trip-map {
    height: 350px;
    margin: 0 12px;
  }

  .timeline-section {
    padding: 40px 12px 60px;
  }

  .day-header {
    padding: 16px;
  }

  .stop {
    padding: 12px 16px;
  }

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

  .tips-grid {
    grid-template-columns: 1fr;
  }

  .map-legend {
    justify-content: flex-start;
  }
}
