/* SrijanDev Train Finder - Custom Tech Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg-primary: #080D1A;
  --bg-secondary: #0F172A;
  --bg-card: rgba(15, 23, 42, 0.75);
  --border-glow: rgba(6, 182, 212, 0.25);
  --cyan-glow: #00F0FF;
  --cyan-accent: #06B6D4;
  --text-primary: #F8FAFC;
  --text-muted: #94A3B8;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html {
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
}

h1, h2, h3, h4, .brand-font {
  font-family: var(--font-heading);
}

.mono-font {
  font-family: var(--font-mono);
}

/* Custom glowing effects */
.glow-cyan {
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.35);
}

.glow-cyan-subtle {
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.15);
}

.glow-green {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.text-glow-cyan {
  text-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
}

.text-glow-green {
  text-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
}

/* Glassmorphism cards */
.glass-panel {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(51, 65, 85, 0.5);
}

.glass-panel:hover {
  border-color: rgba(6, 182, 212, 0.4);
}

.glass-card-highlight {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 27, 75, 0.65) 100%);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.glass-input {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.8);
  transition: all 0.2s ease-in-out;
}

.glass-input:focus {
  background: rgba(30, 41, 59, 0.9);
  border-color: #06B6D4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
  outline: none;
}

/* Background Cyber Grid */
.cyber-grid {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* Custom animations */
@keyframes radarSweep {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.animate-radar {
  animation: radarSweep 4s linear infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.65;
    transform: scale(1.05);
  }
}

.animate-pulse-glow {
  animation: pulseGlow 2.5s ease-in-out infinite;
}

@keyframes scanline {
  0% {
    top: -100%;
  }
  100% {
    top: 100%;
  }
}

.scanline-effect {
  position: relative;
}

.scanline-effect::after {
  content: " ";
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 240, 255, 0.04) 50%);
  background-size: 100% 4px;
  z-index: 2;
  pointer-events: none;
}

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

::-webkit-scrollbar-track {
  background: #080D1A;
}

::-webkit-scrollbar-thumb {
  background: #1E293B;
  border-radius: 4px;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

::-webkit-scrollbar-thumb:hover {
  background: #06B6D4;
}

/* Status badges */
.badge-available {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-rac {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-wl {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Boarding Pass print styling */
@media print {
  body * {
    visibility: hidden;
  }
  #boardingPassModal, #boardingPassModal * {
    visibility: visible;
  }
  #boardingPassModal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white !important;
    color: black !important;
  }
}

/* Mobile Safe Area Insets & Strict PWA Styles */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

.pb-safe {
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

/* Prevent auto-zoom on iOS Safari when tapping inputs */
@media screen and (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
  
  /* Touch target standard 44px min for mobile accessibility */
  button, a {
    min-height: 40px;
  }
}

/* Native Mobile Tap highlight removal & smooth touches */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Mobile Bottom Navigation dock styling */
.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  transition: all 0.2s ease;
  padding: 4px 8px;
  border-radius: 12px;
}

.mobile-nav-btn:hover,
.mobile-nav-btn.active {
  color: #22D3EE;
  background: rgba(6, 182, 212, 0.12);
}

.mobile-nav-btn.active i {
  color: #22D3EE;
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.7));
}

/* Standalone PWA adjustments when installed to Home Screen */
@media all and (display-mode: standalone) {
  header {
    padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
  }
  
  /* Hide the install prompt in standalone mode */
  #installPwaBtn, #mobileInstallBanner {
    display: none !important;
  }
}

/* Multi-tab Switcher Pills */
.app-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #94A3B8;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.6);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  cursor: pointer;
}

.app-nav-tab:hover {
  color: #F8FAFC;
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(6, 182, 212, 0.4);
}

.app-nav-tab.active {
  color: #080D1A;
  background: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
  border-color: #22D3EE;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
  font-weight: 700;
}

.app-nav-tab.active i {
  color: #080D1A;
}

/* Live Departure Station Board Styling (Railway Station Vibe) */
.station-board-table th {
  background: rgba(15, 23, 42, 0.95);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94A3B8;
  padding: 0.75rem 1rem;
}

.station-board-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(30, 41, 59, 0.6);
  font-size: 0.8125rem;
}

.station-board-row:hover {
  background: rgba(6, 182, 212, 0.06);
}

/* Live GPS Timeline Node */
.timeline-track-node {
  position: relative;
  padding-left: 1.75rem;
}

.timeline-track-node::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: -16px;
  width: 2px;
  background: rgba(51, 65, 85, 0.8);
}

.timeline-track-node:last-child::before {
  display: none;
}

.timeline-track-dot {
  position: absolute;
  left: 0;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  background: #0F172A;
  border: 2px solid #06B6D4;
}

.timeline-track-node.passed .timeline-track-dot {
  background: #10B981;
  border-color: #10B981;
}

.timeline-track-node.current .timeline-track-dot {
  background: #22D3EE;
  border-color: #FFFFFF;
  box-shadow: 0 0 12px #22D3EE;
  animation: pulseGlow 1.5s infinite;
}

/* ================================================= */
/* Desktop Top Module Navigation Pills               */
/* ================================================= */
.app-nav-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #94A3B8;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.7);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.app-nav-tab:hover {
  color: #F8FAFC;
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}

.app-nav-tab.active {
  color: #020617;
  background: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35);
}

.app-nav-tab.active i,
.app-nav-tab.active svg {
  color: #020617;
}

/* ================================================= */
/* Mobile Bottom Navigation Dock (PWA Optimized)     */
/* ================================================= */
#mobileBottomNav {
  height: 64px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.75), 0 -1px 0 rgba(255, 255, 255, 0.08);
  touch-action: manipulation;
}

.mobile-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 14px;
  color: #94A3B8;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  min-width: 54px;
  position: relative;
}

.mobile-nav-btn i,
.mobile-nav-btn svg {
  transition: transform 0.2s ease, color 0.2s ease;
}

.mobile-nav-btn:hover {
  color: #E2E8F0;
}

.mobile-nav-btn:active {
  transform: scale(0.92);
}

.mobile-nav-btn.active {
  color: #22D3EE;
  background: rgba(6, 182, 212, 0.14);
}

.mobile-nav-btn.active i,
.mobile-nav-btn.active svg {
  transform: translateY(-1px) scale(1.15);
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.7));
  color: #22D3EE;
}

.mobile-nav-btn.active span {
  font-weight: 700;
  color: #F0F9FF;
}

/* Safe Bottom Clearance for Mobile Dock */
@media (max-width: 768px) {
  body {
    padding-bottom: 74px;
  }
}


