/* === FLEXIBLE DATES WIDGET === */
:root {
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-blur: blur(10px);
  --glass-border: rgba(255, 255, 255, 0.3);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
  --shadow-hover: 0 8px 24px rgba(102, 126, 234, 0.2);
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --card-gradient: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  --price-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-color: #667eea;
  --success-color: #00b894;
  --danger-color: #d63031;
  --warning-color: #fdcb6e;
}

.flexible-dates-widget {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
}

.flexible-dates-widget h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
}

.flexible-dates-widget h3 i {
  color: var(--accent-color);
}

.dates-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.date-option {
  background: #ffffff;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.date-option:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.date-option.selected {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
}

.date-option.cheapest {
  position: relative;
  border-color: var(--success-color);
}

.date-option.cheapest::after {
  content: "💎";
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 1.2rem;
}

.date-label {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 4px;
}

.date-price {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
}

.date-option.selected .date-price,
.date-option.selected .date-label {
  color: white;
}

/* === ENHANCED FARE COMPARISON TABLE === */
.fare-comparison-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: none;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.fare-comparison-modal.show {
  display: flex;
}

.fare-comparison-content {
  background: #ffffff;
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
}

.fare-comparison-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
}

.fare-comparison-table {
  display: grid;
  grid-template-columns: 150px repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.fare-column {
  background: var(--card-gradient);
  border-radius: 12px;
  padding: 1.5rem;
  border: 2px solid #e8e8e8;
  transition: all 0.3s ease;
}

.fare-column:hover {
  border-color: #667eea;
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.fare-column.recommended {
  border-color: #667eea;
  position: relative;
}

.fare-column.recommended::before {
  content: "BEST VALUE";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-gradient);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
}

.fare-header {
  text-align: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e8e8e8;
}

.fare-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.5rem;
}

.fare-price {
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--price-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fare-price-per {
  font-size: 0.8rem;
  color: #666;
}

.fare-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 0.9rem;
}

.fare-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.fare-icon.included {
  background: var(--success-color);
  color: white;
}

.fare-icon.excluded {
  background: var(--danger-color);
  color: white;
}

.fare-icon.paid {
  background: var(--warning-color);
  color: white;
}

.fare-select-btn {
  width: 100%;
  padding: 12px;
  margin-top: 1rem;
  border-radius: 8px;
  border: 2px solid #667eea;
  background: #ffffff;
  color: #667eea;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.fare-select-btn:hover {
  background: var(--primary-gradient);
  color: white;
}

/* === PREMIUM FLIGHT CARD === */
.flight-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid #e8e8e8;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.flight-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: #667eea;
}

.flight-card-header {
  background: var(--card-gradient);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.airline-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.airline-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.airline-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #333;
}

.fare-type-badge {
  background: var(--primary-gradient);
  color: white;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.flight-card-body {
  padding: 1rem;
}

.flight-route {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.route-point {
  text-align: center;
}

.time {
  font-size: 1.4rem;
  font-weight: 700;
  color: #333;
}

.airport-code {
  font-size: 0.85rem;
  color: #666;
  margin-top: 2px;
}

.route-info {
  text-align: center;
  padding: 0 0.75rem;
}

.duration {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 6px;
}

.route-line {
  height: 2px;
  background: linear-gradient(90deg, #e8e8e8 0%, #667eea 50%, #e8e8e8 100%);
  position: relative;
  margin: 6px 0;
}

.route-line::after {
  content: "✈️";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  padding: 0 6px;
  font-size: 0.85rem;
}

.stops-info {
  font-size: 0.8rem;
  color: #667eea;
  font-weight: 600;
}

.amenities-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0.75rem 0 0 0;
  padding: 0.75rem 0 0 0;
  border-top: 1px solid #f0f0f0;
}

.amenity-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: #f8f9ff;
  border-radius: 16px;
  font-size: 0.75rem;
  color: #667eea;
}

.amenity-badge i {
  font-size: 0.85rem;
}

.flight-card-footer {
  padding: 0.75rem 1rem;
  background: #f8f9ff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* === COMPACT SEARCH MODIFY FORM === */
.compact-search-modify {
  background: #ffffff;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e8e8e8;
}

.modify-search-form {
  width: 100%;
}

.search-inputs-row {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: nowrap;
}

.input-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 120px;
}

.input-group label {
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group label i {
  color: #667eea;
  margin-right: 6px;
}

.input-group input {
  padding: 10px 14px;
  border: 2px solid #e8e8e8;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: #fafafa;
}

.input-group input:focus {
  outline: none;
  border-color: #667eea;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-update-search {
  padding: 12px 28px;
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-update-search:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.price-section {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price-amount {
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--price-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.price-per-person {
  font-size: 0.8rem;
  color: #666;
}

.action-buttons {
  display: flex;
  gap: 10px;
}

.btn-view-fares {
  padding: 8px 16px;
  border-radius: 6px;
  border: 2px solid #667eea;
  background: #ffffff;
  color: #667eea;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-view-fares:hover {
  background: #667eea;
  color: white;
}

.btn-select-flight {
  padding: 8px 20px;
  border-radius: 6px;
  border: none;
  background: var(--primary-gradient);
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.btn-select-flight:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* === 3-COLUMN LAYOUT AND STICKY SIDEBARS === */

/* Add grid to search container */
.search-container {
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  gap: 2rem;
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem;
  align-items: start;
}

/* Sticky Filters Sidebar */
.filters-sidebar {
  position: sticky;
  top: 110px; /* Below the sticky header */
  height: calc(100vh - 130px);
  overflow-y: auto;
  z-index: 90;
  /* Styles copied from existing */
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Results Main Area */
.results-main {
  min-width: 0; /* Prevents grid blowout */
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 1200px) {
  .search-container {
    grid-template-columns: 250px 1fr; /* Hide itinerary on smaller desktops */
  }

  .itinerary-sidebar {
    display: none !important; /* Itinerary becomes togglable/modal via JS on mobile */
  }
}

@media (max-width: 900px) {
  .search-container {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .filters-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    height: 100vh;
    width: 80%;
    max-width: 300px;
    z-index: 999;
    transition: left 0.3s ease;
  }

  .filters-sidebar.open {
    left: 0;
  }

  .dates-calendar {
    grid-template-columns: repeat(4, 1fr);
  }

  .fare-comparison-table {
    grid-template-columns: 1fr;
  }

  .flight-route {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .route-line {
    display: none;
  }

  .flight-card-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .action-buttons {
    flex-direction: column;
  }

  .btn-view-fares,
  .btn-select-flight {
    width: 100%;
  }
}

/* === ANIMATIONS === */
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flight-card {
  animation: slideIn 0.4s ease-out;
}

/* Add delay for staggered animation */
.flight-card:nth-child(1) {
  animation-delay: 0s;
}
.flight-card:nth-child(2) {
  animation-delay: 0.1s;
}
.flight-card:nth-child(3) {
  animation-delay: 0.2s;
}
.flight-card:nth-child(4) {
  animation-delay: 0.3s;
}
.flight-card:nth-child(5) {
  animation-delay: 0.4s;
}
