/* Custom styles for Flight Booking System */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  padding: 0;
}

/* Ensure full viewport height */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body > div {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main content should grow to fill space */
#mainContent {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

#bookingPage {
  display: none;
}

#bookingPage:not(.hidden) {
  display: block !important;
}

/* Smooth transitions */
* {
  transition: all 0.2s ease-in-out;
}

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

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Date input styling */
input[type="date"] {
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
}

input[type="date"]:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
}

/* Airline logo styling */
.airline-logo-container {
  width: 80px;
  height: 40px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
}

.airline-logo-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Animation for search results */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#searchResults {
  animation: fadeIn 0.5s ease-in-out;
}

/* Flight card hover effect */
.hover\:shadow-xl:hover {
  transform: translateY(-2px);
}

/* Loading state */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .airline-logo-container {
    width: 60px;
    height: 30px;
  }
}

/* Print styles */
@media print {
  header, footer, #searchFilters {
    display: none;
  }
}

/* Modal animations */
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#seatClassModal:not(.hidden) {
  animation: modalFadeIn 0.3s ease-out;
}

#seatClassModal:not(.hidden) > div > div {
  animation: modalSlideIn 0.3s ease-out;
}

/* Seat class option styling */
.seat-class-option {
  position: relative;
  overflow: hidden;
}

.seat-class-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
  transition: left 0.5s ease;
}

.seat-class-option:hover::before {
  left: 100%;
}

/* Focus styles for accessibility */
.seat-class-option:focus {
  outline: 3px solid #3B82F6;
  outline-offset: 2px;
}

/* Disabled button styling */
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modal responsive adjustments */
@media (max-width: 768px) {
  #seatClassModal > div {
    padding: 1rem;
  }
  
  #seatClassModal .max-w-4xl {
    max-width: 100%;
  }
  
  .seat-class-option {
    flex-direction: column;
  }
  
  .seat-class-option > div > div:last-child {
    margin-left: 0;
    margin-top: 1rem;
    text-align: left;
  }
}

/* ========================================
   Seat Map Styling
   ======================================== */

/* Aircraft map container */
.aircraftmap_container {
  max-width: 100%;
  overflow-x: auto;
}

.od-aircraftmap-map-wrapper {
  min-width: 600px;
}

.od-aircraftmap-cabins {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border: 2px solid #e2e8f0;
  border-radius: 1rem;
}

.od-aircraftmap-cabin {
  width: 100%;
  max-width: 800px;
}

/* Seat row styling */
.seat-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.row-number {
  width: 2rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
}

.seats {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Individual seat styling */
.seat {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.seat:hover:not(.cursor-not-allowed) {
  transform: scale(1.1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.seat[data-status="available"] {
  background-color: #10b981;
  color: white;
}

.seat[data-status="available"]:hover {
  background-color: #059669;
}

.seat[data-status="selected"] {
  background-color: #3b82f6;
  color: white;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.seat[data-status="unavailable"] {
  background-color: #9ca3af;
  color: white;
  cursor: not-allowed;
  opacity: 0.6;
}

.seat[data-price]:not([data-price="0"]) {
  background-color: #eab308;
  color: white;
}

.seat[data-price]:not([data-price="0"]):hover {
  background-color: #ca8a04;
}

/* Aisle spacing */
.aisle {
  width: 2rem;
}

/* Seat map legend */
.seat-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-seat {
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ========================================
   Booking Page Styling
   ======================================== */

#bookingPage {
  animation: fadeIn 0.5s ease-in-out;
}

/* Flight summary cards */
.flight-summary-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  background: white;
  transition: all 0.2s ease;
}

.flight-summary-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Customer form styling */
#customerInfoForm input,
#customerInfoForm select {
  transition: all 0.2s ease;
}

#customerInfoForm input:focus,
#customerInfoForm select:focus {
  outline: none;
  ring: 2px;
  ring-color: #3b82f6;
  border-color: transparent;
}

#customerInfoForm input[required]:invalid {
  border-color: #ef4444;
}

#customerInfoForm input[required]:valid {
  border-color: #10b981;
}

/* Sticky payment summary */
.sticky {
  position: sticky;
  bottom: 1rem;
  z-index: 40;
}

/* Selected seats summary */
#selectedSeatsSummary {
  min-height: 3rem;
}

/* ========================================
   Responsive Design for Seat Map
   ======================================== */

@media (max-width: 1024px) {
  .od-aircraftmap-map-wrapper {
    min-width: 500px;
  }
  
  .seat {
    width: 2rem;
    height: 2rem;
    font-size: 0.625rem;
  }
  
  .row-number {
    width: 1.5rem;
    font-size: 0.75rem;
  }
  
  .aisle {
    width: 1.5rem;
  }
}

@media (max-width: 768px) {
  .aircraftmap_container {
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
  }
  
  .od-aircraftmap-cabins {
    padding: 1rem;
  }
  
  .od-aircraftmap-map-wrapper {
    min-width: 400px;
  }
  
  .seat {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.5rem;
  }
  
  .row-number {
    width: 1.25rem;
    font-size: 0.625rem;
  }
  
  .aisle {
    width: 1rem;
  }
  
  /* Form adjustments */
  #customerInfoForm .grid {
    grid-template-columns: 1fr;
  }
  
  /* Sticky button adjustments */
  .sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    margin: 0;
  }
}

/* ========================================
   Accessibility Enhancements
   ======================================== */

/* Focus visible for keyboard navigation */
.seat:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .seat {
    border: 2px solid currentColor;
  }
  
  .seat[data-status="available"] {
    border-color: #059669;
  }
  
  .seat[data-status="selected"] {
    border-color: #2563eb;
  }
  
  .seat[data-status="unavailable"] {
    border-color: #6b7280;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   Print Styles for Booking
   ======================================== */

@media print {
  #bookingPage .sticky {
    position: static;
  }
  
  .aircraftmap_container {
    overflow: visible;
  }
  
  .seat:not([data-status="selected"]) {
    opacity: 0.3;
  }
  
  button {
    display: none;
  }
}


/* Autocomplete suggestions styling */
.suggestion-item.selected {
  background-color: #DBEAFE !important;
}

/* Smooth scrolling for suggestions */
[id$="-suggestions"] {
  scrollbar-width: thin;
  scrollbar-color: #CBD5E0 #F7FAFC;
}

[id$="-suggestions"]::-webkit-scrollbar {
  width: 6px;
}

[id$="-suggestions"]::-webkit-scrollbar-track {
  background: #F7FAFC;
}

[id$="-suggestions"]::-webkit-scrollbar-thumb {
  background-color: #CBD5E0;
  border-radius: 3px;
}

[id$="-suggestions"]::-webkit-scrollbar-thumb:hover {
  background-color: #A0AEC0;
}

/* ============================================
   My Page Styles
   ============================================ */

/* Tab Navigation */
.mypage-tab {
  color: #6B7280;
  border-bottom: 3px solid transparent;
}

.mypage-tab.active {
  color: #2563EB;
  border-bottom-color: #2563EB;
  background-color: #EFF6FF;
}

.mypage-tab:hover {
  background-color: #F3F4F6;
}

/* Booking Card */
.booking-card {
  border: 1px solid #E5E7EB;
  transition: all 0.2s;
}

.booking-card:hover {
  border-color: #3B82F6;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Booking Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.status-confirmed {
  background-color: #D1FAE5;
  color: #065F46;
}

.status-cancelled {
  background-color: #FEE2E2;
  color: #991B1B;
}

.status-completed {
  background-color: #E0E7FF;
  color: #3730A3;
}
