:root {
  --purple: rgb(121, 78, 125);
  --purple-gradient: linear-gradient(135deg, rgb(121, 78, 125) 0%, rgb(90, 50, 95) 100%);
  --purple-hover: linear-gradient(135deg, rgb(140, 90, 145) 0%, rgb(110, 60, 115) 100%);
  --glass: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-high: rgba(255, 255, 255, 0.2);
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  /* overflow: hidden; REMOVED so other pages can scroll */
  color: white;
  background-color: #1a1a1a;
  /* Fallback */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Background slideshow (JS handled) */
#bg-slider-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  /* Behind everything */
}

.bg-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.bg-slide.active {
  opacity: 1;
}

.bg-overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.35);
  /* Dark overlay */
  z-index: 1;
  /* On top of images */
  pointer-events: none;
}

/* Header */
.top-bar {
  position: absolute;
  top: 20px;
  left: 30px;
  z-index: 10;
}

.logo {
  height: 56px;
}

/* Auth Card */
.auth-card {
  width: 440px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  position: absolute;
  right: 80px;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
}

.subtitle {
  color: #e0e0e0;
  margin-bottom: 28px;
  font-size: 14px;
}

.auth-card input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: white;
  outline: none;
  transition: all 0.3s ease;
}

.auth-card input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(121, 78, 125, 0.5);
  box-shadow: 0 0 0 3px rgba(121, 78, 125, 0.2);
}

/* Buttons */
.primary-btn {
  width: 100%;
  padding: 12px;
  background: var(--purple-gradient);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(121, 78, 125, 0.4);
  filter: brightness(1.1);
}

.primary-btn:active {
  transform: translateY(0);
}

.google-btn {
  width: 100%;
  padding: 10px;
  background: white;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

.google-btn img {
  width: 18px;
}

.divider {
  text-align: center;
  margin: 15px 0;
  color: #ccc;
}

.small-text {
  margin-top: 18px;
  font-size: 14px;
  color: #ddd;
}

.small-text a {
  color: var(--purple);
  text-decoration: none;
}

/* Booking Page */
.booking-container {
  display: flex;
  gap: 40px;
  padding: 120px 60px 30px;
  /* Default: allow scroll */
}

/* FIXED Layout (Only for Search Page) */
.booking-container.fixed-layout {
  height: 100vh;
  overflow: hidden;
}

.booking-panel {
  width: 340px;
  min-width: 340px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  padding: 28px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  max-height: calc(100vh - 150px);
}

.booking-panel h3 {
  margin-top: 0;
}

.booking-panel label {
  font-size: 13px;
  opacity: 0.85;
}

.booking-panel input,
.booking-panel select {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 8px;
  border: none;
}

.star-rating {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
  font-size: 13px;
}

.star-rating .rating-row {
  display: flex;
  gap: 12px;
}

.star-rating label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 12px;
}

.star-rating input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.booking-placeholder {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #eee;
  font-size: 18px;
  text-align: center;
  padding: 20px;
}

/* Form Row */
.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 13px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.forgot-link {
  color: var(--purple);
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

/* User Header */
/* User Nav */
.user-nav {
  position: absolute;
  top: 24px;
  right: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 100;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  padding: 5px 16px 5px 5px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.user-pill:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.3);
}

.avatar-circle {
  width: 34px;
  height: 34px;
  background: var(--purple-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: white;
  padding-right: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 18px;
  border-radius: 30px;
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  height: 46px;
  /* Match pill height roughly */
  box-sizing: border-box;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.3);
}

.nav-btn.logout:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Hotel Results */
.results-area {
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  padding-right: 10px;
}

.hotel-card {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  margin-bottom: 20px;
  overflow: hidden;
  display: flex;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hotel-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.6);
}

.hotel-card img {
  width: 180px;
  height: 140px;
  object-fit: cover;
}

.hotel-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hotel-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.hotel-rating {
  font-size: 13px;
  color: #f59e0b;
}

.hotel-address {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 4px;
}

.room-list {
  margin-top: 10px;
}

.room-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
  border-radius: 12px;
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s;
}

.room-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.room-type {
  font-size: 14px;
  font-weight: 500;
}

.room-meta {
  font-size: 12px;
  opacity: 0.8;
}

.room-price {
  font-weight: 600;
  color: var(--purple);
}

.btn-book {
  background: var(--purple-gradient);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
}

.btn-book:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(121, 78, 125, 0.3);
  filter: brightness(1.1);
}

.btn-policy {
  background: transparent;
  color: #60a5fa;
  border: 1px solid #60a5fa;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.2s;
}

.btn-policy:hover {
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
}

.btn-details {
  background: rgba(167, 139, 250, 0.05);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.5);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s;
}

.btn-details:hover {
  background: rgba(167, 139, 250, 0.15);
  color: #ddd6fe;
  border-color: #c4b5fd;
  transform: translateY(-1px);
}

.btn-details:hover {
  background: rgba(167, 139, 250, 0.15);
  color: #c4b5fd;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: #ccc;
}

.spinner {
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid #d8b4fe;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
  box-shadow: 0 0 15px rgba(121, 78, 125, 0.3);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Children inputs */
.children-ages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

/* Room config cards for multi-room */
.room-config-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.room-config-card label {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 4px;
}

.room-config-card input {
  padding: 6px 8px;
  font-size: 0.9rem;
}

.room-config-title {
  font-weight: 600;
  color: #a5b4fc;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.children-ages input {
  width: 60px;
  text-align: center;
}

/* City Selector */
.city-selector {
  display: flex;
  flex-direction: column;
}

.load-more-btn {
  margin-top: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  color: white;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.load-more-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.city-info {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 768px) {

  /* Header Stacking */
  .top-bar {
    position: relative;
    top: 0;
    left: 0;
    text-align: center;
    padding: 20px 0 10px;
  }

  .user-nav {
    position: relative;
    top: 0;
    right: 0;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
  }

  /* Adjust Page Containers */
  .booking-container {
    padding: 20px 20px;
    flex-direction: column;
    height: auto !important;
    /* Disable fixed height on mobile */
    overflow: visible !important;
  }

  .booking-panel {
    width: 100%;
    min-width: 0;
    max-height: none;
    margin-bottom: 20px;
  }

  .results-area {
    max-height: none;
    padding-right: 0;
  }

  .history-container,
  .details-container,
  .prebook-container,
  .success-container {
    margin-top: 20px;
  }

  .auth-card {
    position: relative;
    top: 0;
    right: 0;
    transform: none;
    margin: 40px auto;
    width: 90%;
  }
}

/* Custom Select Styles */
.custom-select {
  position: relative;
  width: 100%;
  margin-bottom: 15px;
  user-select: none;
}

.select-trigger {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  /* Slightly clearer */
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.6);
  /* Placeholder color */
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.select-trigger.selected {
  color: white;
  /* Selected text color */
}

.select-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.select-trigger:after {
  content: '▼';
  font-size: 10px;
  color: #a5b4fc;
  transition: transform 0.3s ease;
}

.custom-select.open .select-trigger {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(121, 78, 125, 0.3);
  background: rgba(4, 4, 20, 0.9);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.custom-select.open .select-trigger:after {
  transform: rotate(180deg);
}

.select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(15, 15, 30, 0.95);
  /* Dark background for readability */
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-top: none;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  z-index: 50;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  /* Prevent clicks when closed */
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.custom-select.open .select-options {
  max-height: 250px;
  /* Limit height */
  opacity: 1;
  pointer-events: auto;
  overflow-y: auto;
  /* Enable scroll */
  padding: 5px 0;
}

.option {
  padding: 10px 16px;
  color: #cbd5e1;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.option:hover {
  background: rgba(121, 78, 125, 0.3);
  color: white;
  padding-left: 20px;
  /* Slight movement effect */
}

.option.selected {
  background: rgba(121, 78, 125, 0.6);
  color: white;
  font-weight: 500;
}

.no-options {
  padding: 15px;
  text-align: center;
  color: #64748b;
  font-style: italic;
  font-size: 13px;
}

/* Scrollbar for options */
.select-options::-webkit-scrollbar {
  width: 6px;
}

.select-options::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.select-options::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.select-options::-webkit-scrollbar-thumb:hover {
  background: var(--purple);
}

/* Disabled state */
.custom-select.disabled .select-trigger {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.02);
}