/* Black & White Theme for Flights B2C */

/* Light theme (default) */
:root {
  --background: #F5F5F4;
  --foreground: #000000;
  --card: #F5F5F4;
  --card-foreground: #000000;
  --primary: #000000;
  --primary-foreground: #F5F5F4;
  --secondary: #f5f5f5;
  --secondary-foreground: #000000;
  --muted: #f5f5f5;
  --muted-foreground: #666666;
  --accent: #f5f5f5;
  --accent-foreground: #000000;
  --border: #e0e0e0;
  --input: #e0e0e0;
  --ring: #000000;
  --danger: #000000;
  --success: #000000;
  --warning: #000000;
}

/* Dark theme */
[data-theme="dark"] {
  --background: #000000;
  --foreground: #F5F5F4;
  --card: #111111;
  --card-foreground: #F5F5F4;
  --primary: #F5F5F4;
  --primary-foreground: #000000;
  --secondary: #222222;
  --secondary-foreground: #F5F5F4;
  --muted: #222222;
  --muted-foreground: #999999;
  --accent: #222222;
  --accent-foreground: #F5F5F4;
  --border: #333333;
  --input: #333333;
  --ring: #F5F5F4;
  --danger: #F5F5F4;
  --success: #F5F5F4;
  --warning: #F5F5F4;
}

/* Base styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  min-height: 100vh;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
}

header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

header .subtitle {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 400;
  margin-left: 0.5rem;
}

header a {
  color: var(--foreground);
  text-decoration: none;
  display: flex;
  align-items: baseline;
}

/* Main content */
main {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

footer p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Theme toggle button */
.theme-toggle {
  position: absolute;
  left: 1rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--foreground);
  transition: background 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  background: var(--secondary);
  border-color: var(--foreground);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  transition: opacity 0.2s, transform 0.2s;
}

/* Light theme: show moon (click to go dark) */
[data-theme="light"] .theme-toggle .icon-sun {
  opacity: 0;
  transform: scale(0.5);
}

[data-theme="light"] .theme-toggle .icon-moon {
  opacity: 1;
  transform: scale(1);
}

/* Dark theme: show sun (click to go light) */
[data-theme="dark"] .theme-toggle .icon-sun {
  opacity: 1;
  transform: scale(1);
}

[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 0;
  transform: scale(0.5);
}

/* Hero section */
.hero {
  text-align: center;
  margin-bottom: 2rem;
}

.hero h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--muted-foreground);
}

/* Search form - Cleartrip Style */
.search-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
}

#search-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Journey Type Row */
.journey-type-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.journey-type-options {
  display: flex;
  gap: 1.25rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.radio-option input[type="radio"] {
  display: none;
}

.radio-custom {
  width: 20px;
  height: 20px;
  border: 2px solid #808080;
  border-radius: 50%;
  position: relative;
}

.radio-option input[type="radio"]:checked + .radio-custom {
  border-color: var(--foreground);
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--foreground);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.radio-label {
  font-size: 16px;
  font-weight: 500;
  color: #1A1A1A;
}

[data-theme="dark"] .radio-label {
  color: #F5F5F4;
}

.divider-vertical {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 1rem;
}

/* Passenger/Class Selector */
.pax-class-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--secondary);
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
}

.pax-class-selector:hover {
  border-color: var(--foreground);
}

.pax-class-selector span {
  font-size: 16px;
  font-weight: 500;
}

.pax-class-selector .chevron {
  transition: transform 0.3s;
}

/* Route Container */
.route-container {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: visible;
  background: var(--background);
}

.route-field {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 1rem;
  gap: 1rem;
}

.route-field input {
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  color: var(--foreground);
  width: 100%;
  outline: none;
}

.route-field input::placeholder {
  color: #808080;
}

.swap-button {
  position: relative;
  z-index: 10;
  cursor: pointer;
  margin: 0 -16px;
}

.swap-button svg g {
  stroke: var(--foreground);
}

.swap-button:hover svg rect {
  fill: var(--secondary);
}

.destination-field {
  padding-left: 2rem;
  border-left: 1px solid var(--border);
}

/* Route field needs relative positioning for dropdown */
.route-field {
  position: relative;
}

/* Airport Autocomplete Dropdown */
.airport-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 100;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.airport-option {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.25rem;
}

.airport-option:last-child {
  border-bottom: none;
}

.airport-option:hover,
.airport-option.selected {
  background: var(--secondary);
}

.airport-city {
  font-weight: 600;
  font-size: 1rem;
  color: var(--foreground);
}

.airport-code {
  font-weight: 700;
  font-size: 1rem;
  color: var(--foreground);
  text-align: right;
}

.airport-name {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Date Container */
.date-container {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--background);
}

.date-field {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 1rem;
  gap: 0.5rem;
}

.date-field input[type="date"] {
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  color: var(--foreground);
  cursor: pointer;
  outline: none;
}

.date-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

.return-placeholder {
  color: #808080;
  font-size: 16px;
  font-weight: 500;
}

#return-date-container {
  cursor: pointer;
}

/* Search Bottom Row */
.search-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

/* Non-stop Toggle */
.nonstop-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.nonstop-toggle input {
  display: none;
}

.toggle-switch {
  width: 32px;
  height: 20px;
  background: #808080;
  border-radius: 12px;
  position: relative;
  transition: background 0.3s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #F5F5F4;
  border-radius: 50%;
  top: 1px;
  left: 1px;
  transition: transform 0.3s;
}

.nonstop-toggle input:checked + .toggle-switch {
  background: var(--foreground);
}

.nonstop-toggle input:checked + .toggle-switch::after {
  transform: translateX(12px);
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

/* Search Button */
.search-btn {
  height: 56px;
  min-width: 200px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.search-btn:hover {
  opacity: 0.9;
}

/* Passenger Dropdown */
.pax-dropdown {
  position: absolute;
  top: 60px;
  right: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 100;
  min-width: 320px;
  max-height: 80vh;
  overflow-y: auto;
}

.pax-section {
  display: block !important;
  margin-bottom: 1.5rem;
  overflow: visible !important;
  height: auto !important;
  min-height: auto !important;
}

.pax-row {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  visibility: visible !important;
  opacity: 1 !important;
}

.pax-row:last-child {
  border-bottom: none;
}

.pax-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pax-label {
  font-weight: 500;
}

.pax-age {
  font-size: 12px;
  color: var(--muted-foreground);
}

.pax-counter {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pax-dropdown .counter-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border: 1px solid var(--border) !important;
  border-radius: 50% !important;
  background: var(--background) !important;
  color: var(--foreground) !important;
  font-size: 18px !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
}

.pax-dropdown .counter-btn:hover {
  border-color: var(--foreground) !important;
  color: var(--foreground) !important;
  background: var(--secondary) !important;
}

#adults-count,
#children-count,
#infants-count {
  font-size: 16px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.class-section {
  margin-bottom: 1.5rem;
}

.class-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.class-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.class-option {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.class-option input {
  display: none;
}

.class-option.selected,
.class-option:has(input:checked) {
  border-color: var(--foreground);
  background: var(--secondary);
}

.class-option span {
  font-size: 14px;
}

.pax-done-btn {
  width: 100%;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.pax-done-btn:hover {
  opacity: 0.9;
}

/* Legacy form styles for booking page */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  border-radius: 4px;
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

.form-row .form-group.small {
  flex: 0 0 100px;
}

/* Buttons */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: var(--primary);
  color: var(--primary-foreground);
  transition: opacity 0.2s;
}

button:hover {
  opacity: 0.9;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border: 1px solid var(--border);
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

/* Offer cards */
.offer-card {
  display: grid;
  gap: 1rem;
}

.offer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.offer-header .airline {
  font-weight: 700;
  font-size: 1.25rem;
}

.offer-header .flight-no {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.offer-route {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.offer-route .departure,
.offer-route .arrival {
  flex: 1;
}

.offer-route .time {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}

.offer-route .airport {
  color: var(--muted-foreground);
}

.offer-route .route-line {
  flex: 1;
  text-align: center;
  border-top: 1px solid var(--border);
  position: relative;
  padding-top: 0.5rem;
}

.offer-route .stops {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.offer-route .arrival {
  text-align: right;
}

.offer-details {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.offer-details .refundable {
  color: var(--foreground);
  font-weight: 500;
}

.offer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.offer-footer .price {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Results page */
.results-header {
  margin-bottom: 2rem;
}

.results-header h2 {
  margin-bottom: 0.25rem;
}

.results-header p {
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}

.no-results {
  text-align: center;
  padding: 3rem;
  color: var(--muted-foreground);
}

/* Book page */
.book-header {
  margin-bottom: 2rem;
}

.book-content {
  display: grid;
  gap: 2rem;
  overflow: visible;
}

@media (min-width: 768px) {
  .book-content {
    grid-template-columns: 1fr 1fr;
  }
}

/* Passenger forms */
.passenger-form {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  overflow: visible;
  position: relative;
}

.passenger-form h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
}

.passenger-form .form-row {
  position: relative;
  z-index: 1;
}

.passenger-form .form-group {
  position: relative;
}

.contact-form {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.passengers-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.flight-summary .summary-content {
  display: grid;
  gap: 0.5rem;
}

.flight-summary .airline {
  font-weight: 700;
  font-size: 1.25rem;
}

.flight-summary .price {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 1rem;
}

/* Confirmation / Ticket */
.confirmation-header {
  text-align: center;
  margin-bottom: 2rem;
}

.ticket {
  background: var(--card);
  border: 2px solid var(--foreground);
  border-radius: 8px;
  overflow: hidden;
  max-width: 600px;
  margin: 0 auto;
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 2px dashed var(--border);
}

.pnr-section .pnr-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
}

.pnr-section .pnr {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.ticket-header .airline {
  font-size: 1.5rem;
  font-weight: 700;
}

.ticket-body {
  padding: 1.5rem;
}

.ticket-body h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin: 1.5rem 0 0.75rem;
}

.ticket-body h4:first-child {
  margin-top: 0;
}

.segment {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.segment:last-child {
  border-bottom: none;
}

.segment-header .flight-no {
  font-weight: 600;
}

.segment-route {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.segment-route .departure,
.segment-route .arrival {
  flex: 1;
}

.segment-route .time {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
}

.segment-route .airport {
  font-weight: 500;
}

.segment-route .terminal {
  display: block;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.segment-route .arrow {
  color: var(--muted-foreground);
}

.segment-route .arrival {
  text-align: right;
}

.segment-date {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.passenger {
  padding: 0.5rem 0;
}

.passenger .name {
  display: block;
  font-weight: 500;
}

.passenger .contact {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.baggage-info p,
.fare-rules p {
  margin: 0.25rem 0;
  font-size: 0.875rem;
}

/* Payment breakdown on ticket */
.payment-breakdown {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.payment-breakdown h4 {
  margin-bottom: 0.75rem;
}

.payment-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.9375rem;
}

.payment-row:last-child {
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-weight: 600;
}

.ticket-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-top: 2px dashed var(--border);
  background: var(--secondary);
}

.ticket-footer .amount {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Ticket Logo */
.ticket-logo {
  text-align: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.ticket-logo img {
  max-height: 40px;
  width: auto;
}

/* Passenger display on ticket */
.passenger {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.passenger:last-child {
  border-bottom: none;
}

.passenger .name {
  display: block;
  font-weight: 600;
  font-size: 1rem;
}

.passenger .ticket-number {
  display: block;
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.passenger .contact {
  display: block;
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.passenger .pax-type {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  background: var(--secondary);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  margin-top: 0.25rem;
}

.actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

/* Loading */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-init {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* Button with spinner */
.btn-loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading .spinner {
  margin-right: 0.5rem;
}

/* Alert */
.alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-danger {
  background: var(--secondary);
  border: 1px solid var(--foreground);
}

.alert button {
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--foreground);
}

/* Print styles */
@media print {
  header, footer, .actions, button {
    display: none !important;
  }

  .ticket {
    border: 2px solid #000;
  }

  body {
    background: #F5F5F4;
    color: #000;
  }
}

/* Responsive */
@media (max-width: 640px) {
  main {
    padding: 1rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-row .form-group.small {
    flex: 1;
  }

  .offer-route {
    flex-direction: column;
    text-align: center;
  }

  .offer-route .departure,
  .offer-route .arrival {
    text-align: center;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
  }
}

/* ============================================
   Auth Styles
   ============================================ */

/* Login button in header */
.btn-login {
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--foreground);
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-login:hover {
  background: var(--foreground);
  color: var(--background);
}

/* User menu in header */
.user-menu {
  display: flex;
  align-items: center;
  position: relative;
}

.user-trigger {
  position: relative;
  cursor: pointer;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  padding: 0.5rem 0;
  border-bottom: 2px solid var(--foreground);
  transition: opacity 0.2s ease;
}

.user-trigger:hover .user-name {
  opacity: 0.7;
}

/* User dropdown */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 100;
  margin-top: 0.5rem;
}

.user-trigger:hover .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--foreground);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: var(--secondary);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.25rem 0;
}

/* Auth container */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 60vh;
  padding: 2rem;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.auth-card h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
}

.auth-card .form-group {
  margin-bottom: 1rem;
}

.auth-card label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.auth-card input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
  color: var(--foreground);
}

.auth-card input:focus {
  outline: none;
  border-color: var(--foreground);
}

.auth-card .btn-submit {
  width: 100%;
  padding: 0.875rem;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.auth-error {
  color: #dc3545;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  min-height: 1.25rem;
}

[data-theme="dark"] .auth-error {
  color: #ff6b6b;
}

[data-theme="dark"] .user-dropdown {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.auth-switch a {
  color: var(--foreground);
  font-weight: 500;
  text-decoration: underline;
}

.auth-switch a:hover {
  text-decoration: none;
}

/* Auth nav in header */
#auth-nav {
  display: flex;
  align-items: center;
}

/* ============================================
   Admin Dashboard Styles
   ============================================ */

/* Admin layout - full width, attached to edges */
.admin-layout {
  display: flex;
  min-height: calc(100vh - 120px);
  margin: -2rem;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
}

/* Admin sidebar */
.admin-sidebar {
  width: 200px;
  min-width: 200px;
  background: var(--background);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, min-width 0.2s ease;
}

.admin-sidebar.collapsed {
  width: 56px;
  min-width: 56px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
  height: 56px;
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted-foreground);
}

.sidebar-toggle:hover {
  border-color: var(--foreground);
  color: var(--foreground);
}

.sidebar-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.sidebar-nav {
  padding: 0.5rem 0;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  color: var(--foreground);
  background: var(--secondary);
}

.sidebar-link.active {
  color: var(--foreground);
  background: var(--secondary);
  border-left-color: var(--foreground);
}

.sidebar-icon {
  color: inherit;
  flex-shrink: 0;
}

.admin-sidebar.collapsed .sidebar-link {
  justify-content: center;
  padding: 0.75rem;
}

.admin-sidebar.collapsed .sidebar-link {
  border-left: none;
  border-bottom: 3px solid transparent;
}

.admin-sidebar.collapsed .sidebar-link.active {
  border-bottom-color: var(--foreground);
}

/* Admin main content */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--background);
  overflow: hidden;
}

.admin-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.admin-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.admin-subtitle {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 400;
  margin-left: 0.5rem;
}

.admin-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

.admin-content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.admin-content-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

/* Search box */
.search-box {
  width: 300px;
}

.search-box input {
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
  color: var(--foreground);
}

.search-box input:focus {
  outline: none;
  border-color: var(--foreground);
}

/* Admin table */
.admin-table-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  background: var(--secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
}

.admin-table td {
  font-size: 0.875rem;
}

.admin-table tbody tr:hover {
  background: var(--secondary);
}

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

.no-data {
  text-align: center;
  color: var(--muted-foreground);
  padding: 2rem !important;
}

/* User type dropdown in table */
.user-type-select {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
  color: var(--foreground);
  cursor: pointer;
}

.user-type-select:focus {
  outline: none;
  border-color: var(--foreground);
}

/* Agency approval status dropdown */
.approval-status-select {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--background);
  color: var(--foreground);
  cursor: pointer;
}

.approval-status-select:focus {
  outline: none;
  border-color: var(--foreground);
}

/* Delete button in table */
.actions-cell {
  width: 50px;
  text-align: center;
}

.delete-agency-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.375rem;
  border-radius: 4px;
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.delete-agency-btn:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}

.delete-agency-btn svg {
  width: 16px;
  height: 16px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
}

.pagination-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  background: var(--secondary);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--foreground);
  color: var(--background);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Admin loading */
.admin-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
}

/* Responsive admin */
@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .admin-sidebar.collapsed {
    width: 100%;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding: 0;
  }

  .sidebar-link {
    white-space: nowrap;
  }

  .admin-content-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .search-box {
    width: 100%;
  }

  .admin-table-container {
    overflow-x: auto;
  }
}

/* ============================================
   Nationality & Passport Fields
   ============================================ */

/* Country autocomplete field */
.country-autocomplete-field {
  position: relative;
}

.country-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  border-radius: 4px;
  font-size: 1rem;
}

.country-input:focus {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Country dropdown */
.country-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  margin-top: 2px;
}

.country-option {
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.country-option:last-child {
  border-bottom: none;
}

.country-option:hover,
.country-option.selected {
  background: var(--secondary);
}

.country-name {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--foreground);
}

.country-code {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

/* Passport fields container */
.passport-fields {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.passport-fields .form-row {
  margin-bottom: 0;
}

/* ============================================
   Payment Page Styles
   ============================================ */

.payment-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

.payment-header {
  text-align: center;
  margin-bottom: 2rem;
}

.payment-header h2 {
  margin-bottom: 0.5rem;
}

.payment-header p {
  color: var(--muted-foreground);
}

.payment-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Fare breakdown card */
.fare-breakdown {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}

.fare-breakdown h3 {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.fare-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.fare-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.fare-item.total {
  border-top: 2px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 1rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.fare-label {
  color: var(--foreground);
}

.fare-value {
  font-weight: 600;
  font-family: monospace;
}

/* Payment actions */
.payment-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.pay-now-btn {
  display: block;
  width: 100%;
  padding: 1rem 2rem;
  background: var(--primary);
  color: var(--primary-foreground);
  text-align: center;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 6px;
  transition: opacity 0.2s;
}

.pay-now-btn:hover {
  opacity: 0.9;
}

/* Payment success page */
.payment-loading {
  text-align: center;
  padding: 3rem;
}

.payment-loading p {
  margin-top: 1rem;
  color: var(--muted-foreground);
}

.ticket-payment {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border);
}

.ticket-payment h4 {
  margin-bottom: 1rem;
}

.payment-summary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.payment-item {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
}

.payment-item.total {
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  font-weight: 700;
}

/* Payment error/cancelled pages */
.payment-error-page,
.payment-cancelled-page {
  max-width: 500px;
  margin: 0 auto;
  padding: 3rem 1rem;
  text-align: center;
}

.error-icon,
.cancelled-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.error-icon {
  color: #c00;
}

.cancelled-icon {
  color: var(--muted-foreground);
}

.error-message {
  color: var(--muted-foreground);
  margin: 1rem 0;
  word-break: break-word;
}

.payment-note {
  background: var(--muted);
  padding: 1rem;
  border-radius: 6px;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.error-actions,
.cancelled-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.error-actions button,
.cancelled-actions button {
  padding: 0.75rem 1.5rem;
}
