/* CDA Metro Live - Google Stitch Minimal Transit Design System */

@layer utilities {
  .pt-safe {
    padding-top: max(env(safe-area-inset-top, 0px), 10px);
  }
  .pb-safe {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.5rem);
  }
}

/* Scrollbars */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Material Symbols Outlined */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

/* Leaflet Container */
.leaflet-container {
  background: #EBF0F3 !important;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif !important;
  width: 100% !important;
  height: 100% !important;
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(8px);
  color: #64748B !important;
  font-size: 9px !important;
  border-top-left-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 3px 8px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.leaflet-control-attribution a {
  color: #0061A5 !important;
  text-decoration: none !important;
  font-weight: 600;
}

/* Stitch Vector Bus Marker Container */
.stitch-bus-wrap {
  background: transparent !important;
  border: none !important;
}

.stitch-bus-marker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
  z-index: 1000;
  will-change: transform;
}

/* Floating Status Pill Above Bus */
.bus-floating-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 7px;
  border-radius: 9999px;
  background-color: #030813;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  border: 1.5px solid #FFFFFF;
  white-space: nowrap;
  font-family: "Inter", sans-serif;
  margin-bottom: 3px;
  transform: translateY(0);
  transition: transform 0.15s ease;
}

.stitch-bus-marker:hover .bus-floating-pill {
  transform: translateY(-2px) scale(1.05);
}

.bus-pill-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10B981;
  box-shadow: 0 0 6px #10B981;
  animation: busPillGlow 1.8s infinite;
}

.bus-pill-pulse.pulse-amber {
  background-color: #F59E0B;
  box-shadow: 0 0 6px #F59E0B;
}

.bus-pill-pulse.pulse-emerald {
  background-color: #10B981;
  box-shadow: 0 0 6px #10B981;
}

/* Hub Filter Pills */
.hub-filter-pill.active {
  background-color: #0061A5 !important;
  color: #FFFFFF !important;
  border-color: #0061A5 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.hub-filter-pill:not(.active) {
  background-color: #FFFFFF !important;
  color: #0F172A !important;
  border-color: #E9ECEF !important;
}

@keyframes busPillGlow {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.bus-pill-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.bus-pill-capacity {
  font-size: 9px;
  font-weight: 600;
  color: #91F8B8;
}

/* Circular Bus Pod */
.bus-circular-pod {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #0284C7;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  border: 2px solid #FFFFFF;
  transition: transform 0.15s ease;
}

.stitch-bus-marker:hover .bus-circular-pod {
  transform: scale(1.15);
}

/* Direction Heading Pointer */
.bus-heading-arrow {
  position: absolute;
  top: -4px;
  left: 10px;
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-bottom: 5px solid #030813;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5));
  transform-origin: 3px 17px;
}

/* Snapped Station Pin Marker */
.station-pin-wrap {
  background: transparent !important;
  border: none !important;
}

.station-pin {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2.5px solid #0061A5;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
  cursor: pointer;
}

.station-pin:hover {
  transform: scale(1.6);
  border-color: #030813;
}

/* Terminal & Platform Visual Signaling Beacons on Map (Clean Light Mode) */
.terminal-beacon-wrap, .platform-beacon-wrap {
  background: transparent !important;
  border: none !important;
}

.terminal-beacon-bubble {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  color: #0F172A;
  border-radius: 10px;
  padding: 3.5px 8px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12), 0 1px 3px rgba(15, 23, 42, 0.08);
  border: 1.5px solid #0061A5;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  white-space: nowrap;
  pointer-events: auto;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
}

.terminal-beacon-bubble:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
}

.terminal-beacon-bubble.minimal {
  padding: 2.5px 7px;
  border-color: #CBD5E1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.terminal-beacon-header {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: #0F172A;
  letter-spacing: -0.01em;
}

.terminal-beacon-counts {
  display: flex;
  align-items: center;
  gap: 3.5px;
  margin-top: 2px;
}

.beacon-chip {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  line-height: 1.3;
}

.beacon-chip.in {
  background-color: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}

.beacon-chip.out {
  background-color: #FFEDD5;
  color: #C2410C;
  border: 1px solid #FED7AA;
}

.terminal-beacon-bubble::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #0061A5;
}

.terminal-beacon-bubble.minimal::after {
  border-top-color: #CBD5E1;
}

/* Intermediate Platform Live Beacon (Clean Light Mode) */
.platform-beacon-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  color: #065F46;
  padding: 2.5px 7.5px;
  border-radius: 9999px;
  font-size: 9.5px;
  font-weight: 700;
  border: 1.5px solid #10B981;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.2);
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  animation: platformBeaconPulse 2s infinite ease-in-out;
}

@keyframes platformBeaconPulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 3px 10px rgba(16, 185, 129, 0.2); }
  50% { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(16, 185, 129, 0.35); }
}

/* User Location GPS Marker */
.user-location-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0061A5;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 0 12px rgba(0, 97, 165, 0.8);
}

.user-location-pulse {
  position: absolute;
  width: 34px;
  height: 34px;
  top: -10px;
  left: -10px;
  border-radius: 50%;
  background: rgba(0, 97, 165, 0.2);
  animation: userPulse 2s ease-out infinite;
}

@keyframes userPulse {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* Tab button states - Mobile */
.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748B;
  transition: color 0.15s ease, transform 0.1s ease;
  cursor: pointer;
}

.tab-btn:hover {
  color: #0F172A;
}

.tab-btn:active {
  transform: scale(0.94);
}

.tab-btn.active {
  color: #0061A5 !important;
}

.tab-btn.active span:last-child {
  font-weight: 700 !important;
  color: #0061A5 !important;
}

.tab-btn span:last-child {
  font-weight: 500;
  transition: font-weight 0.15s ease, color 0.15s ease;
}

.tab-btn.active .material-symbols-outlined {
  color: #0061A5 !important;
  font-variation-settings: 'FILL' 1;
}

/* Desktop Header Navigation Tabs */
.desktop-tab-btn {
  padding: 0.375rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  background: transparent;
  border: none;
  user-select: none;
}

.desktop-tab-btn:hover {
  color: #0F172A;
}

.desktop-tab-btn:active {
  transform: scale(0.98);
}

.desktop-tab-btn.active {
  background: #FFFFFF !important;
  color: #0061A5 !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04) !important;
}

.desktop-tab-btn.active .material-symbols-outlined {
  color: #0061A5 !important;
  font-variation-settings: 'FILL' 1;
}

/* Route Drawer Sheet - Solid Clean Light Sheet */
#route-drawer-sheet {
  background-color: #FFFFFF !important;
  border-top: 1px solid #E2E8F0;
  border-top-left-radius: 1.5rem;
  border-top-right-radius: 1.5rem;
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  height: 65vh;
}

#route-drawer-sheet.drawer-peek {
  transform: translateY(calc(100% - 76px)) !important;
}

#route-drawer-sheet.drawer-expanded {
  transform: translateY(0) !important;
}

/* Responsive Desktop Enhancements */
@media (min-width: 768px) {
  #route-drawer-sheet {
    top: 5rem !important;
    left: 1.5rem !important;
    bottom: 1.5rem !important;
    width: 24rem !important;
    max-width: 26rem !important;
    height: auto !important;
    border-radius: 1.25rem !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12) !important;
    transform: none !important;
    z-index: 30 !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  #route-drawer-sheet.desktop-collapsed {
    transform: translateX(calc(-100% - 2.5rem)) !important;
  }
  #route-drawer-sheet.drawer-peek {
    transform: none !important;
  }
  #route-drawer-sheet.desktop-collapsed.drawer-peek {
    transform: translateX(calc(-100% - 2.5rem)) !important;
  }
  #route-drawer-sheet #drawer-expanded-content {
    display: flex !important;
  }
  #drawer-handle {
    display: none !important;
  }
  #drawer-chevron {
    display: none !important;
  }
  #map-live-status-wrap.sidebar-closed {
    left: 1.5rem !important;
  }
}

/* Station Progression Timeline */
.timeline-station-item {
  position: relative;
  padding-left: 24px;
  padding-bottom: 14px;
}

.timeline-station-item::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: -4px;
  width: 2px;
  background: #E2E8F0;
}

.timeline-station-item:last-child::before {
  display: none;
}

.timeline-station-dot {
  position: absolute;
  left: 2px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2.5px solid #0061A5;
}

.timeline-station-item.active-bus .timeline-station-dot {
  background: #059669;
  border-color: #91F8B8;
  box-shadow: 0 0 8px rgba(5, 150, 105, 0.6);
}

/* Modern Stitch Leaflet Popup */
.stitch-leaflet-popup .leaflet-popup-content-wrapper {
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  border: 1px solid #E2E8F0;
  padding: 4px;
}

.stitch-leaflet-popup .leaflet-popup-content {
  margin: 10px 12px;
  line-height: 1.4;
}

.stitch-leaflet-popup .leaflet-popup-tip {
  background: #FFFFFF;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Service Updates & Alerts Modal Enhancements */
#announcements-list-container::-webkit-scrollbar {
  width: 4px;
}

#announcements-list-container::-webkit-scrollbar-track {
  background: transparent;
}

#announcements-list-container::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
}

#announcements-list-container::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

.ann-filter-pill {
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =================================================================
   REDMI 13C & GENERAL ANDROID MOBILE VIEWPORT OPTIMIZATIONS
   - Aspect ratio 20:9 (720x1600, ~360-392px logical width)
   - 90Hz fluid scrolling & touch responsiveness
   - Safe insets for waterdrop notch & gesture navigation bar
   ================================================================= */

:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

.pt-safe {
  padding-top: max(var(--sat), 0px);
}

.pb-safe {
  padding-bottom: max(var(--sab), 0.5rem);
}

/* Touch responsiveness & prevention of unwanted double-tap zooms */
html, body {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
}

/* Ensure smooth 90Hz inertia scrolling on mobile lists */
#view-hub, #stations-list-container, #hub-feeders-list, #route-stations-timeline, #modal-station-selector-sheet {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Redmi 13C / 360px viewport typography and padding fine-tuning */
@media (max-width: 375px) {
  #station-eta-card {
    padding: 0.75rem !important;
  }
}


