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

:root {
  --bg-dark: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-light: #252542;
  --accent: #ff6b6b;
  --accent-soft: rgba(255, 107, 107, 0.15);
  --blue: #4ecdc4;
  --blue-soft: rgba(78, 205, 196, 0.15);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.6);
  --text-soft: rgba(255, 255, 255, 0.4);
  --border: rgba(255, 255, 255, 0.08);
  --radius: 16px;
  --radius-sm: 8px;
}

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

/* ===== HERO ===== */
.hero {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  background:
    linear-gradient(180deg, transparent 0%, var(--bg-dark) 100%),
    linear-gradient(135deg, rgba(255,107,107,0.1) 0%, rgba(78,205,196,0.1) 100%),
    url('https://images.unsplash.com/photo-1503614472-8c93d56e92ce?w=1600') center/cover;
}

.hero-content {
  max-width: 600px;
}

.hero-tag {
  display: inline-block;
  background: var(--accent);
  color: var(--bg-dark);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
}

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

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

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

/* ===== CONTAINER ===== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ===== SECTION TITLES ===== */
section > h2,
.section-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
}

section > h2 i,
.section-header h2 i {
  color: var(--accent);
  font-size: 1.2rem;
}

/* ===== SECTION HEADER WITH BADGE ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.section-header h2 {
  margin-bottom: 0;
}

.section-intro {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 30px;
}

/* ===== FAMILY BADGES ===== */
.family-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.family-badge i {
  font-size: 0.9rem;
}

.family-badge.family-1 {
  background: var(--accent-soft);
  color: var(--accent);
}

.family-badge.family-both {
  background: var(--blue-soft);
  color: var(--blue);
}

/* ===== MAP ===== */
.map-section {
  margin-bottom: 60px;
}

#map {
  height: 400px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.map-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.map-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  background: var(--bg-light);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.map-btn:hover {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--accent);
}

.map-btn-primary {
  background: var(--accent);
  color: var(--bg-dark);
  border-color: var(--accent);
}

.map-btn-primary:hover {
  background: #ff8e8e;
  color: var(--bg-dark);
}

/* ===== ITINERARY ===== */
.itinerary {
  margin-bottom: 60px;
}

/* ===== STOP ===== */
.stop {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 30px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.stop-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
}

.stop-marker {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), #ff8e8e);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  flex-shrink: 0;
}

.stop.final .stop-marker {
  background: linear-gradient(135deg, var(--blue), #6ee7de);
}

.stop-info h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.stop-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.stop-meta i {
  margin-right: 6px;
  opacity: 0.6;
}

.drive-time {
  color: var(--blue);
}

.stop-intro {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 1rem;
}

/* ===== DAYS GRID ===== */
.days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.days-grid.single {
  grid-template-columns: 1fr;
}

/* ===== DAY CARD ===== */
.day-card {
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  padding: 20px;
  position: relative;
}

.day-label {
  position: absolute;
  top: -10px;
  left: 16px;
  background: var(--accent);
  color: var(--bg-dark);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.day-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  margin-top: 6px;
  color: var(--text);
}

.day-card ul {
  list-style: none;
}

.day-card li {
  padding: 4px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
}

.day-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 4px;
  height: 4px;
  background: var(--blue);
  border-radius: 50%;
}

.day-card li strong {
  color: var(--text);
  font-weight: 500;
}

/* ===== DAY COLUMNS (for large cards) ===== */
.day-card.large {
  padding: 24px;
}

.day-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 8px;
}

.time-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* ===== ALTERNATIVES ===== */
.alternatives {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.alt-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 4px;
}

.alt-label i {
  color: #ffd166;
  margin-right: 6px;
}

.alt-tag {
  background: var(--bg-light);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: all 0.2s;
}

.alt-tag:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

/* ===== INFO BOX ===== */
.info-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--blue-soft);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--blue);
  margin-top: 16px;
}

.info-box.warning {
  background: var(--accent-soft);
  color: var(--accent);
}

.info-box i {
  font-size: 1rem;
}

/* ===== SUMMARY ===== */
.summary {
  background: linear-gradient(135deg, var(--accent-soft), var(--blue-soft));
  border-radius: var(--radius);
  padding: 40px;
  border: 1px solid var(--border);
}

.summary h2 {
  margin-bottom: 30px;
}

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

.summary-card {
  text-align: center;
}

.summary-card i {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 10px;
  display: block;
}

.summary-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
}

.summary-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

/* ===== LEAFLET CUSTOMIZATION ===== */
.leaflet-popup-content-wrapper {
  background: var(--bg-card);
  color: var(--text);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

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

.leaflet-popup-content {
  margin: 12px 16px;
}

.popup-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.popup-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.popup-nights {
  display: inline-block;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  margin-top: 6px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero-stats {
    gap: 24px;
  }

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

  .stop {
    padding: 24px 20px;
  }

  .stop-header {
    flex-direction: column;
    gap: 12px;
  }

  .stop-marker {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    border-radius: 10px;
  }

  .day-columns {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  #map {
    height: 300px;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: 40vh;
    padding: 40px 16px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .container {
    padding: 24px 16px;
  }

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

  .stop-meta {
    flex-direction: column;
    gap: 8px;
  }

  .alternatives {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary {
    padding: 24px;
  }
}

/* ===== TOP NAVIGATION ===== */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.nav-back:hover {
  opacity: 0.8;
}

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

/* ===== ITINERARY TABLE ===== */
.itinerary-overview {
  margin-bottom: 60px;
}

.table-section {
  margin-bottom: 40px;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.table-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.itinerary-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  min-width: 600px;
}

.itinerary-table thead {
  background: var(--bg-light);
}

.itinerary-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.itinerary-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-muted);
}

.itinerary-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.itinerary-table tbody tr:last-child td {
  border-bottom: none;
}

.col-day {
  width: 70px;
}

.col-night {
  width: 160px;
}

.col-drive {
  width: 100px;
  text-align: center;
}

.day-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--bg-dark);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
}

.day-final {
  background: var(--blue);
}

.night-cell {
  font-weight: 500;
  color: var(--text);
}

.drive-cell {
  text-align: center;
  color: var(--blue);
  font-size: 0.85rem;
}

.drive-cell i {
  margin-right: 4px;
}

.row-transition {
  background: var(--accent-soft);
}

.row-transition td {
  border-bottom-color: var(--accent);
}

.row-final {
  background: var(--blue-soft);
}

.row-final td {
  border-bottom: none;
}

/* ===== CTA DETAIL BUTTON ===== */
.cta-detail {
  text-align: center;
  margin-top: 30px;
}

.btn-detail {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--accent), #ff8e8e);
  color: var(--bg-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  border-radius: 30px;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(255, 107, 107, 0.3);
}

.btn-detail:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(255, 107, 107, 0.4);
}

/* ===== BACK HOME BUTTON ===== */
.back-home {
  text-align: center;
  margin: 40px 0;
}

/* ===== RESPONSIVE TABLE ===== */
@media (max-width: 768px) {
  .top-nav {
    padding: 12px 16px;
  }

  .nav-title {
    display: none;
  }

  .table-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .itinerary-table th,
  .itinerary-table td {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .col-night {
    width: 120px;
  }

  .btn-detail {
    padding: 14px 24px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .itinerary-table {
    min-width: 500px;
  }

  .col-drive {
    width: 80px;
  }
}
