/* ============================================
   RideNG — Premium Design Tokens & Transitions
   Palette: Rich Indigo-Navy / Warm Amber / Off-white / Muted Clay / Emerald Green
   Type: Space Grotesk (display) + Inter (body)
   ============================================ */

:root {
  --rng-navy: #0E2A47;
  --rng-navy-light: #16395E;
  --rng-navy-dark: #071729;
  --rng-amber: #F2A93C;
  --rng-amber-dark: #D88F22;
  --rng-amber-glow: rgba(242, 169, 60, 0.15);
  --rng-cream: #FAF7F2;
  --rng-charcoal: #1A1A1A;
  --rng-clay: #C2562D;
  --rng-green: #1E8E5A;
  --rng-green-light: #EBF7F0;
  --rng-line: #E4DDD0;
  --rng-white-glass: rgba(255, 255, 255, 0.85);
  --rng-shadow-premium: 0 10px 30px -10px rgba(14, 42, 71, 0.08), 0 1px 3px rgba(14, 42, 71, 0.03);
  --rng-shadow-hover: 0 20px 40px -15px rgba(14, 42, 71, 0.15), 0 1px 5px rgba(14, 42, 71, 0.05);
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--rng-cream);
  color: var(--rng-charcoal);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.font-display {
  font-family: 'Space Grotesk', sans-serif;
}

/* Subtle premium grain & mesh background texture */
.rng-texture {
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.07) 1.5px, transparent 0);
  background-size: 24px 24px;
}

/* Mesh gradient hero background */
.hero-mesh {
  background: radial-gradient(circle at 80% 20%, rgba(242, 169, 60, 0.12) 0%, transparent 45%),
              radial-gradient(circle at 10% 80%, rgba(194, 86, 45, 0.08) 0%, transparent 40%),
              var(--rng-navy);
}

/* Glassmorphism navigation bar */
.glass-nav {
  background: rgba(14, 42, 71, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Card layout wrapper */
.premium-card {
  background: #ffffff;
  border: 1px solid var(--rng-line);
  border-radius: 20px;
  box-shadow: var(--rng-shadow-premium);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.3s ease;
}

.premium-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--rng-shadow-hover);
  border-color: rgba(14, 42, 71, 0.2);
}

/* ===== Signature element: the Route Line ===== */
.route-line {
  position: relative;
  height: 2px;
  background-image: repeating-linear-gradient(
    to right,
    var(--rng-navy) 0,
    var(--rng-navy) 6px,
    transparent 6px,
    transparent 12px
  );
}

.route-line.light {
  background-image: repeating-linear-gradient(
    to right,
    rgba(255, 255, 255, 0.4) 0,
    rgba(255, 255, 255, 0.4) 6px,
    transparent 6px,
    transparent 12px
  );
}

.route-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--rng-navy);
  background: var(--rng-cream);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.route-dot.filled {
  background: var(--rng-amber);
  border-color: var(--rng-amber-dark);
  box-shadow: 0 0 10px var(--rng-amber);
}

.route-dot.light {
  border-color: rgba(255, 255, 255, 0.6);
  background: transparent;
}

.route-dot.light.filled {
  background: var(--rng-amber);
  border-color: var(--rng-amber);
  box-shadow: 0 0 10px var(--rng-amber);
}

/* ===== Interactive Seat Map Visual Bus Mockup ===== */
.bus-mockup {
  border: 4px solid var(--rng-line);
  border-radius: 40px 40px 24px 24px;
  background: #ffffff;
  padding: 40px 24px 24px 24px;
  position: relative;
  max-width: 340px;
  margin: 0 auto;
  box-shadow: var(--rng-shadow-premium);
}

.bus-mockup::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 8px;
  background: var(--rng-line);
  border-radius: 4px 4px 0 0;
}

/* Steering wheel cabin area */
.bus-cabin {
  border-bottom: 2px dashed var(--rng-line);
  margin-bottom: 24px;
  padding-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.steering-wheel {
  animation: wheel-wobble 4s ease-in-out infinite alternate;
}

.bus-aisle {
  grid-column: 2 / span 2;
  background: rgba(228, 221, 208, 0.25);
  border-radius: 8px;
  margin: 0 4px;
}

/* Enhanced Seat Styles */
.seat {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1.5px solid transparent;
}

.seat:hover:not(.taken) {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 16px rgba(14, 42, 71, 0.1);
}

.seat.available {
  background: #ffffff;
  border-color: var(--rng-line);
  color: var(--rng-navy);
}

.seat.available:hover {
  border-color: var(--rng-navy);
}

.seat.selected {
  background: var(--rng-amber);
  border-color: var(--rng-amber-dark);
  color: var(--rng-navy);
  box-shadow: 0 6px 15px rgba(242, 169, 60, 0.4);
  animation: seat-pulse 1.5s infinite alternate;
}

.seat.taken {
  background: #EDEAE3;
  border-color: #EDEAE3;
  color: #B5AFA2;
  cursor: not-allowed;
}

/* ===== Boarding Pass Ticket layout ===== */
.ticket-card {
  position: relative;
  overflow: visible;
  background: var(--rng-navy);
  color: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(14, 42, 71, 0.15);
}

/* Punch notches on left/right edges */
.ticket-card::before,
.ticket-card::after {
  content: '';
  position: absolute;
  top: 65%;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--rng-cream);
  z-index: 10;
  box-shadow: inset 2px 0 3px rgba(0, 0, 0, 0.05);
}

.ticket-card::before {
  left: -12px;
}

.ticket-card::after {
  right: -12px;
  box-shadow: inset -2px 0 3px rgba(0, 0, 0, 0.05);
}

/* Dotted ticket tear-off line */
.ticket-divider {
  border-top: 2px dashed rgba(255, 255, 255, 0.15);
  margin: 24px 0;
  position: relative;
}

/* Mock Barcode graphics */
.barcode {
  height: 48px;
  background-image: repeating-linear-gradient(
    to right,
    #ffffff 0px,
    #ffffff 2px,
    transparent 2px,
    transparent 5px,
    #ffffff 5px,
    #ffffff 8px,
    transparent 8px,
    transparent 10px
  );
  opacity: 0.85;
}

/* Page entrance animations */
.animate-fade-in {
  animation: fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-slide-up {
  animation: slide-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* Keyframes */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes seat-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

@keyframes wheel-wobble {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(5deg); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-spin-fast {
  animation: spin 0.8s linear infinite;
}

/* City Swap Rotating Icon */
.swap-btn {
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.swap-btn:hover {
  transform: rotate(180deg);
}

/* Scrollbar tidy-up for route cards row */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--rng-amber);
  outline-offset: 3px;
}

/* Skip-link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--rng-navy);
  color: #fff;
  padding: 10px 20px;
  z-index: 100;
  font-weight: 600;
  border-radius: 0 0 8px 8px;
}
.skip-link:focus {
  left: 12px;
  top: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===== High-Fidelity Printable PDF Styles ===== */
@media print {
  body {
    background: #ffffff !important;
    color: var(--rng-navy) !important;
  }
  
  /* Hide distraction elements */
  header, footer, button, .grid, a, #verifying-state, #error-state, .max-w-md > div:first-child {
    display: none !important;
  }
  
  main {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  /* Boarding pass container overrides */
  .ticket-card {
    box-shadow: none !important;
    border: 2px solid var(--rng-navy) !important;
    background: #ffffff !important;
    color: var(--rng-navy) !important;
    width: 100% !important;
    max-width: 480px !important;
    margin: 40px auto !important;
    border-radius: 16px !important;
    padding: 24px !important;
    page-break-inside: avoid;
  }

  /* Disable circles side punches as they render poorly on print canvas */
  .ticket-card::before,
  .ticket-card::after {
    display: none !important;
  }

  /* Force high contrast dark texts for all ticket content */
  .ticket-card * {
    color: var(--rng-navy) !important;
    border-color: rgba(14, 42, 71, 0.2) !important;
  }

  /* Route indicators print colors */
  .route-line.light {
    background-image: repeating-linear-gradient(
      to right,
      var(--rng-navy) 0,
      var(--rng-navy) 6px,
      transparent 6px,
      transparent 12px
    ) !important;
  }

  .route-dot.light {
    border-color: var(--rng-navy) !important;
  }
  
  .route-dot.light.filled {
    background: var(--rng-navy) !important;
    border-color: var(--rng-navy) !important;
  }

  .ticket-divider {
    border-top: 2px dashed rgba(14, 42, 71, 0.3) !important;
  }

  .barcode {
    background-image: repeating-linear-gradient(
      to right,
      #0E2A47 0px,
      #0E2A47 2px,
      transparent 2px,
      transparent 5px,
      #0E2A47 5px,
      #0E2A47 8px,
      transparent 8px,
      transparent 10px
    ) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  #qrcode-container {
    box-shadow: none !important;
    border: 1.5px solid var(--rng-line) !important;
  }
}
