:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --secondary: #EC4899;
  --bg-color: #F8FAFC;
  --surface: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 30px rgba(79, 70, 229, 0.3);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 0;
  transition: var(--transition);
}

.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4);
}

.btn-outline {
  border: 2px solid var(--border);
  color: var(--text-main);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-block {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 80px;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(236, 72, 153, 0.1), transparent 40%), radial-gradient(circle at bottom left, rgba(79, 70, 229, 0.15), transparent 40%);
  z-index: -1;
}

.hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
}

/* Form Component */
.glass-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.route-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  align-items: end;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-group select,
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-color);
  font-size: 1rem;
  color: var(--text-main);
  transition: var(--transition);
  appearance: none;
  cursor: pointer;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.main-btn-container {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
  width: 100%;
}

.btn-cta {
  padding: 1.1rem 3rem;
  font-size: 1.25rem;
  min-width: 320px;
  background: var(--gradient);
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 700;
  box-shadow: 0 10px 40px rgba(79, 70, 229, 0.4);
  transition: var(--transition);
}

.btn-cta:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 15px 50px rgba(79, 70, 229, 0.5);
  background: linear-gradient(135deg, var(--primary-hover), #db2777);
}

.btn-cta:active {
  transform: translateY(-1px) scale(0.98);
}

/* Loader */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}

.loader-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-content {
  text-align: center;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Results Page Specifics */
.results-header {
  margin-top: 100px;
  text-align: center;
  margin-bottom: 3rem;
}

.layout-wrapper {
  display: flex;
  gap: 2rem;
  height: calc(100vh - 200px);
  margin-bottom: 2rem;
}

.sidebar {
  flex: 0 0 450px;
  overflow-y: auto;
  padding-right: 1rem;
}

.map-container {
  flex: 1;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

/* Cards */
.day-header {
  background: var(--gradient);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  margin: 2rem 0 1rem;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.location-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--border);
  cursor: pointer;
}

.location-card:hover {
  transform: translateX(5px);
  border-color: var(--primary);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.location-img {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  object-fit: cover;
}

.location-info {
  flex: 1;
}

.location-info h4 {
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}

.location-info p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Swap Button */
.btn-swap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.45rem 1rem;
  border: 1px solid var(--primary);
  border-radius: 8px;
  background: rgba(79, 70, 229, 0.05);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 10px;
}

.btn-swap:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-swap:active {
  transform: scale(0.97);
}

.btn-swap.swapping {
  opacity: 0.6;
  pointer-events: none;
}

/* Hotel Cards */
.hotels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.hotel-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.hotel-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--primary);
}

.hotel-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.hotel-info {
  padding: 1rem 1.2rem 1.2rem;
}

.hotel-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.hotel-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.8rem;
}

.hotel-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.hotel-price {
  font-size: 0.9rem;
}

.btn-hotel-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.35rem 0.9rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #6366F1);
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn-hotel-link:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
  color: white;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Hamburger Menu Button */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
  z-index: 1100;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--text-main);
  border-radius: 3px;
  transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

@media (max-width: 900px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    padding: 80px 2rem 2rem;
    gap: 1rem;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    overflow-y: auto;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 1.1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .layout-wrapper {
    flex-direction: column;
    height: auto;
  }

  .sidebar {
    flex: none;
    max-height: none;
    padding-right: 0;
  }

  .map-container {
    min-height: 300px;
  }

  .route-form {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .glass-card {
    padding: 1.5rem;
    overflow: hidden;
  }

  .container {
    padding: 0 1rem;
  }

  .location-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .location-img {
    width: 100%;
    height: 180px;
  }

  /* Review card overflow fix */
  #globalReviewsSection .glass-card,
  #globalReviewsSection {
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  #globalReviewsList>div {
    flex-direction: column !important;
    overflow: hidden;
  }

  #globalReviewsList>div>div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 5px;
  }

  #globalReviewsList>div>div:first-child span {
    font-size: 1rem !important;
    word-break: break-all;
  }
}

/* Transportation Summary Card */
#transportInfo {
  border-left: 5px solid var(--primary);
  background: rgba(79, 70, 229, 0.03);
}

#transportInfo h3 {
  color: var(--primary);
  font-size: 1.2rem;
}

#transportInfo strong {
  color: var(--text-main);
}

/* Hide Leaflet Routing Machine default pane */
.leaflet-routing-container {
  display: none !important;
}