/* ==========================================================================
   NexTurner Mobility Design System & Prototype Styles
   Branded with NexTurner Technologies Corporate Identity (Coimbatore, India)
   Navy (#142241) & Imperial Purple (#7A2D75) with Cyan (#22D3EE)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  /* NexTurner Official Brand Colors */
  --nex-navy: #142241;
  --nex-navy-dark: #0d1629;
  --nex-navy-light: #1f335e;
  --nex-purple: #7a2d75;
  --nex-purple-dark: #5c1f58;
  --nex-purple-light: #9c3c95;
  --nex-purple-subtle: #fdf2f8;
  --nex-indigo: #3b2b64;
  --nex-cyan: #22d3ee;
  
  --brand-primary: #7a2d75;
  --brand-secondary: #142241;
  --brand-accent: #22d3ee;
  --brand-emerald: #10b981;
  --brand-danger: #ef4444;
  
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-light: #e2e8f0;
  
  --gradient-nexturner: linear-gradient(135deg, #142241 0%, #3b2b64 50%, #7a2d75 100%);
  --gradient-purple: linear-gradient(135deg, #7a2d75 0%, #a23b9c 100%);
  --gradient-navy: linear-gradient(135deg, #142241 0%, #1e293b 100%);
  
  --shadow-elevated: 0 10px 25px -5px rgba(20, 34, 65, 0.12), 0 8px 10px -6px rgba(122, 45, 117, 0.1);
  --shadow-glow: 0 0 25px -3px rgba(122, 45, 117, 0.35);
}

* {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
}

h1, h2, h3, .font-heading {
  font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif;
}

code, .font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Gradient Utility Classes */
.gradient-nexturner {
  background: linear-gradient(135deg, #142241 0%, #3b2b64 50%, #7a2d75 100%);
}

.gradient-purple {
  background: linear-gradient(135deg, #7a2d75 0%, #a23b9c 100%);
}

.text-gradient-nex {
  background: linear-gradient(135deg, #7a2d75 0%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   RESPONSIVE MOBILE VIEWPORT CONTAINER
   Adjusts dynamically to 100% desktop view without cutting off bottom navigation!
   ========================================================================== */
.device-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 16px;
  flex: 1;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  background: radial-gradient(circle at 50% 20%, #1f293d 0%, #0d1629 100%);
}

/* Phone Frame auto-fits window height */
.device-phone {
  position: relative;
  height: min(780px, calc(100vh - 96px));
  width: min(375px, calc((100vh - 96px) * 0.485));
  max-height: calc(100vh - 96px);
  min-height: 480px;
  background: #ffffff;
  border-radius: 44px;
  box-shadow: 
    0 0 0 10px #142241,
    0 0 0 12px #334155,
    0 25px 50px -12px rgba(0, 0, 0, 0.75),
    inset 0 0 3px 2px rgba(255, 255, 255, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  flex-shrink: 0;
  margin: auto;
}

.device-phone.android-frame {
  border-radius: 36px;
  box-shadow: 
    0 0 0 9px #142241,
    0 0 0 11px #1e293b,
    0 25px 50px -12px rgba(0, 0, 0, 0.75);
}

/* Fluid Fullscreen Mode for Phone (Toggleable) */
.device-phone.fluid-mode {
  width: 100% !important;
  max-width: 440px !important;
  height: 100% !important;
  max-height: calc(100vh - 84px) !important;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Dynamic Island & Notch */
.dynamic-island {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 28px;
  background: #000000;
  border-radius: 18px;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

.dynamic-camera {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #111827;
  border: 1px solid #1f2937;
}

.dynamic-sensor {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #064e3b;
}

/* Status Bar */
.phone-status-bar {
  height: 38px;
  width: 100%;
  padding: 8px 20px 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #0f172a;
  z-index: 990;
  user-select: none;
  background: transparent;
  flex-shrink: 0;
}

/* Mobile Screen Canvas */
.phone-screen-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR
   CRITICAL: Fixed at bottom with z-index 1000 so it is NEVER hidden!
   ========================================================================== */
.mobile-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #ffffff;
  border-top: 1.5px solid #f1f5f9;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: 6px;
  z-index: 1000 !important;
  box-shadow: 0 -4px 18px rgba(20, 34, 65, 0.08);
}

.nav-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 4px 10px;
  border-radius: 10px;
}

.nav-tab-item.active {
  color: #7a2d75;
  transform: translateY(-1.5px);
}

.nav-tab-item.active svg {
  color: #7a2d75;
  stroke-width: 2.5;
}

/* Home Bar / Indicator */
.phone-home-indicator {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 4px;
  background-color: #0f172a;
  border-radius: 10px;
  z-index: 1002;
  opacity: 0.7;
  pointer-events: none;
}

/* Mobile Bottom Sheet - Sits cleanly above the bottom nav */
.mobile-bottom-sheet-container {
  position: absolute;
  bottom: 60px; /* Above the 60px nav bar! */
  left: 0;
  right: 0;
  z-index: 850;
  pointer-events: auto;
}

/* Radar & Search Animations */
@keyframes radar-pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

.radar-ring {
  position: absolute;
  border: 2px solid rgba(122, 45, 117, 0.6);
  background: radial-gradient(circle, rgba(122, 45, 117, 0.2) 0%, rgba(122, 45, 117, 0) 70%);
  border-radius: 50%;
  animation: radar-pulse 2.4s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

.radar-ring:nth-child(2) {
  animation-delay: 0.8s;
}

.radar-ring:nth-child(3) {
  animation-delay: 1.6s;
}

/* Driver Marker Pulse */
@keyframes driver-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.6);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(34, 211, 238, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0);
  }
}

.driver-marker-pulse {
  animation: driver-pulse 2s infinite;
}

/* Leaflet Map Customization */
.leaflet-container {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  background-color: #f8fafc !important;
}

.leaflet-control-attribution {
  display: none !important;
}

.custom-driver-icon {
  background: transparent;
  border: none;
}

/* Admin Dashboard Sidebar Items */
.admin-sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.admin-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.admin-sidebar-item.active {
  background: linear-gradient(135deg, #7a2d75 0%, #9c3c95 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(122, 45, 117, 0.4);
}

.admin-sidebar-item.active svg {
  color: #ffffff;
}

/* Status Badges */
.badge-status {
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-status.badge-available {
  background-color: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.badge-status.badge-busy {
  background-color: #fdf2f8;
  color: #7a2d75;
  border: 1px solid #fbcfe8;
}

.badge-status.badge-ontrip {
  background-color: #f0fdfa;
  color: #0d9488;
  border: 1px solid #99f6e4;
}

.badge-status.badge-offline {
  background-color: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.badge-status.badge-cancelled {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.badge-status.badge-arriving {
  background-color: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

/* Split View Grid */
.split-view-container {
  display: grid;
  grid-template-columns: 1fr 380px 380px;
  gap: 16px;
  height: calc(100vh - 64px);
  padding: 12px 16px;
  background: #0d1629;
  overflow: hidden;
}

@media (max-width: 1440px) {
  .split-view-container {
    grid-template-columns: 1fr 360px;
  }
  .split-view-container .driver-col {
    display: none;
  }
}

/* On actual phones or narrow viewports, display native full-bleed mobile UI */
@media (max-width: 640px) {
  .device-container {
    padding: 0 !important;
    background: #ffffff !important;
  }
  .device-phone {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }
  .dynamic-island {
    display: none !important;
  }
  .phone-status-bar {
    display: none !important;
  }
  .phone-home-indicator {
    display: none !important;
  }
}
