/* ==========================================================================
   SIYADA TRACK - NEXT-GEN ENTERPRISE FLEET DASHBOARD SYSTEM (2026 UI/UX)
   ========================================================================== */

/* --- 1. Global Typography & Core Variables --- */
:root {
  --sy-font-family: 'Cairo', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --sy-primary-gradient: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
  --sy-accent-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --sy-dark-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --sy-glow-cyan: rgba(2, 132, 199, 0.4);
  --sy-glow-emerald: rgba(16, 185, 129, 0.4);
  --sy-bg-light: #f1f5f9;
  --sy-bg-dark: #070a12;
  --sy-card-light: rgba(255, 255, 255, 0.9);
  --sy-card-dark: rgba(15, 23, 42, 0.92);
  --sy-border-light: rgba(226, 232, 240, 0.9);
  --sy-border-dark: rgba(51, 65, 85, 0.7);
  --sy-shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --sy-shadow-lg: 0 20px 30px -8px rgba(0, 0, 0, 0.25);
  --sy-radius-sm: 10px;
  --sy-radius-md: 16px;
  --sy-radius-lg: 22px;
  --sy-radius-xl: 28px;
}

html,
body {
  height: 100%;
  font-family: var(--sy-font-family) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--sy-bg-light);
  color: #0f172a;
  overflow-x: hidden;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--sy-bg-dark);
    color: #f8fafc;
  }
}

* {
  font-family: var(--sy-font-family) !important;
  box-sizing: border-box;
}

/* --- 2. Custom Ultra-Thin Scrollbar --- */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 9999px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(2, 132, 199, 0.6);
}

/* --- 3. Root Application Layout --- */
.root {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--sy-bg-dark);
}

/* --- 4. Next-Gen Enterprise Header Bar --- */
.MuiAppBar-root {
  background: linear-gradient(135deg, rgba(7, 10, 18, 0.97) 0%, rgba(15, 23, 42, 0.97) 100%) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2) !important;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5) !important;
}

.MuiToolbar-root {
  padding-left: 24px !important;
  padding-right: 24px !important;
  min-height: 64px !important;
}

.MuiTypography-h6 {
  font-weight: 800 !important;
  letter-spacing: 0.8px !important;
  background: linear-gradient(135deg, #38bdf8 0%, #34d399 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.35rem !important;
}

/* --- 5. Sidebar & Navigation Drawer --- */
.MuiDrawer-paper {
  background: rgba(11, 15, 25, 0.95) !important;
  backdrop-filter: blur(28px) !important;
  -webkit-backdrop-filter: blur(28px) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: var(--sy-shadow-lg) !important;
  color: #f8fafc !important;
}

/* --- 6. Futuristic Glassmorphic Cards --- */
.MuiPaper-root {
  border-radius: var(--sy-radius-lg) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.MuiPaper-elevation1,
.MuiPaper-elevation2,
.MuiPaper-elevation3,
.MuiPaper-elevation4 {
  box-shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.12), 0 8px 12px -6px rgba(0, 0, 0, 0.06) !important;
  border: 1px solid rgba(226, 232, 240, 0.85) !important;
}

@media (prefers-color-scheme: dark) {

  .MuiPaper-elevation1,
  .MuiPaper-elevation2,
  .MuiPaper-elevation3,
  .MuiPaper-elevation4 {
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(51, 65, 85, 0.65) !important;
    box-shadow: 0 20px 35px -8px rgba(0, 0, 0, 0.55) !important;
  }
}

/* --- 7. Sidebar Device & Menu List Items --- */
.MuiListItemButton-root {
  border-radius: var(--sy-radius-md) !important;
  margin: 5px 10px !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: 1px solid transparent;
}

.MuiListItemButton-root:hover {
  background: rgba(56, 189, 248, 0.14) !important;
  border-color: rgba(56, 189, 248, 0.25) !important;
  transform: translateX(4px);
}

.MuiListItemButton-root.Mui-selected {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.3) 0%, rgba(13, 148, 136, 0.3) 100%) !important;
  border-left: 4px solid #38bdf8 !important;
  font-weight: 800 !important;
  box-shadow: 0 6px 20px -3px rgba(2, 132, 199, 0.35) !important;
}

/* --- 8. Next-Gen Action Buttons --- */
.MuiButton-contained {
  background: var(--sy-primary-gradient) !important;
  border-radius: var(--sy-radius-md) !important;
  font-weight: 700 !important;
  text-transform: none !important;
  padding: 10px 26px !important;
  letter-spacing: 0.4px;
  box-shadow: 0 4px 18px 0 rgba(2, 132, 199, 0.4) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.MuiButton-contained:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px 0 rgba(2, 132, 199, 0.6) !important;
}

.MuiButton-outlined {
  border-radius: var(--sy-radius-md) !important;
  border-width: 1.5px !important;
  font-weight: 700 !important;
  text-transform: none !important;
  transition: all 0.2s ease-in-out !important;
}

.MuiButton-outlined:hover {
  border-width: 1.5px !important;
  background: rgba(2, 132, 199, 0.1) !important;
  transform: translateY(-1px);
}

.MuiIconButton-root {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border-radius: var(--sy-radius-sm) !important;
}

.MuiIconButton-root:hover {
  background: rgba(56, 189, 248, 0.15) !important;
  transform: scale(1.1);
}

/* --- 9. Futuristic Pill Tabs --- */
.MuiTabs-root {
  min-height: 48px !important;
  padding: 4px !important;
  background: rgba(15, 23, 42, 0.5) !important;
  border-radius: var(--sy-radius-md) !important;
}

.MuiTab-root {
  font-weight: 700 !important;
  border-radius: var(--sy-radius-md) !important;
  padding: 8px 22px !important;
  text-transform: none !important;
  transition: all 0.25s ease !important;
  min-height: 44px !important;
  color: #94a3b8 !important;
}

.MuiTab-root.Mui-selected {
  color: #ffffff !important;
  background: var(--sy-primary-gradient) !important;
  box-shadow: 0 4px 14px 0 rgba(2, 132, 199, 0.35) !important;
}

.MuiTabs-indicator {
  display: none !important;
}

/* --- 10. Modern Inputs & Controls --- */
.MuiOutlinedInput-root {
  border-radius: var(--sy-radius-md) !important;
  transition: all 0.2s ease-in-out !important;
  background: rgba(15, 23, 42, 0.4) !important;
}

.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: #0284c7 !important;
  border-width: 2px !important;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.22);
}

/* --- 11. Custom Telemetry Badges & Chips --- */
.MuiChip-root {
  border-radius: 12px !important;
  font-weight: 700 !important;
  font-size: 0.82rem !important;
  transition: all 0.2s ease !important;
  box-shadow: var(--sy-shadow-sm) !important;
}

.MuiChip-root:hover {
  transform: scale(1.04);
}

/* --- 12. Dialog Modals & Glass Overlays --- */
.MuiDialog-paper {
  border-radius: var(--sy-radius-xl) !important;
  backdrop-filter: blur(30px) !important;
  -webkit-backdrop-filter: blur(30px) !important;
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.5) !important;
  padding: 12px !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
}

.MuiDialogTitle-root {
  font-weight: 800 !important;
  font-size: 1.35rem !important;
  letter-spacing: 0.4px;
}

/* --- 13. Map Container, Futuristic Controls & Popup Window --- */
.leaflet-container,
.maplibregl-map,
.map-container {
  font-family: var(--sy-font-family) !important;
  background-color: #0b0f19 !important;
}

/* HD Map Tiles Contrast & Vibrancy */
.leaflet-tile-container img,
.maplibregl-canvas {
  filter: brightness(0.95) contrast(1.08) saturate(1.1);
  transition: filter 0.3s ease;
}

@media (prefers-color-scheme: dark) {
  .leaflet-tile-container img {
    filter: brightness(0.85) contrast(1.15) saturate(1.2);
  }
}

/* Floating Glass Map Controls Dock */
.leaflet-bar,
.leaflet-control-layers,
.maplibregl-ctrl-group {
  background: rgba(15, 23, 42, 0.92) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-radius: var(--sy-radius-md) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.4) !important;
  overflow: hidden;
}

.leaflet-bar a,
.maplibregl-ctrl-group button {
  background: transparent !important;
  color: #38bdf8 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  transition: all 0.2s ease !important;
}

.leaflet-bar a:hover,
.maplibregl-ctrl-group button:hover {
  background: rgba(56, 189, 248, 0.2) !important;
  color: #ffffff !important;
}

/* Vehicle Path Polyline Glow */
path.leaflet-interactive {
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  filter: drop-shadow(0 0 8px rgba(2, 132, 199, 0.7));
}

/* Glassmorphism Vehicle Info Popup */
.map-popup-content,
.leaflet-popup-content-wrapper,
.maplibregl-popup-content {
  border-radius: var(--sy-radius-lg) !important;
  box-shadow: 0 25px 50px -10px rgba(0, 0, 0, 0.5) !important;
  font-family: var(--sy-font-family) !important;
  padding: 10px !important;
  background: rgba(15, 23, 42, 0.95) !important;
  color: #ffffff !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
}

.leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* --- 14. Neon Pulse Indicators for Device Telemetry --- */
.sy-status-online {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8);
  animation: sy-pulse-green 2s infinite;
}

@keyframes sy-pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* --- 15. Ultra-Realistic 3D Vehicle Map Icons & Symbols System --- */
.leaflet-marker-icon,
.map-icon-container,
svg.map-icon,
.device-icon {
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) !important;
  transform-style: preserve-3d !important;
  perspective: 800px !important;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease !important;
}

/* 3D Isometric Tilt on Vehicle Symbols */
.leaflet-marker-icon svg,
.device-icon svg,
svg[data-testid*="Car"],
svg[data-testid*="Truck"],
svg[data-testid*="Motorcycle"],
svg[data-testid*="DirectionsCar"] {
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.35)) !important;
  transform: perspective(500px) rotateX(10deg) rotateZ(0deg) translateZ(6px) !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* 3D Hover Projection */
.leaflet-marker-icon:hover {
  transform: scale(1.25) translateZ(20px) rotateX(12deg) !important;
  filter: drop-shadow(0 12px 20px rgba(2, 132, 199, 0.45)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) !important;
  z-index: 99999 !important;
}

.leaflet-marker-icon:hover svg {
  transform: perspective(500px) rotateX(15deg) scale(1.1) translateZ(10px) !important;
}

/* 3D Soft Base Disc & Pedestal */
.map-icon-wrapper,
.leaflet-marker-icon>div {
  position: relative;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95) 0%, rgba(30, 41, 59, 0.95) 70%, rgba(15, 23, 42, 1) 100%) !important;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.6), inset 0 -3px 6px rgba(0, 0, 0, 0.4), 0 6px 14px rgba(0, 0, 0, 0.25) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  transition: all 0.3s ease !important;
}

/* 3D Status Glow (Online Emerald 🟢 / Offline Red 🔴 / Moving Animation) */
.map-icon-online {
  background: radial-gradient(circle at 30% 25%, #34d399 0%, #10b981 55%, #047857 100%) !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.6) !important;
}

.map-icon-offline {
  background: radial-gradient(circle at 30% 25%, #f87171 0%, #ef4444 55%, #b91c1c 100%) !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.6) !important;
}

.map-icon-moving {
  animation: sy-3d-vehicle-float 2.2s infinite ease-in-out !important;
}

@keyframes sy-3d-vehicle-float {

  0%,
  100% {
    transform: translateY(0px) rotateX(0deg) scale(1);
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3));
  }

  50% {
    transform: translateY(-5px) rotateX(8deg) scale(1.05);
    filter: drop-shadow(0 12px 16px rgba(2, 132, 199, 0.4));
  }
}

/* --- 16. Futuristic Floating Glassmorphism Pill Bottom Navigation Bar --- */
.MuiBottomNavigation-root {
  background: linear-gradient(135deg, rgba(7, 10, 18, 0.94) 0%, rgba(15, 23, 42, 0.94) 100%) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
  border-radius: 28px !important;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.28), 0 0 15px rgba(2, 132, 199, 0.12) !important;
  height: 68px !important;
  padding: 4px 14px !important;
  margin: 6px 16px 10px 16px !important;
  width: calc(100% - 32px) !important;
  position: relative !important;
  bottom: 4px !important;
}

.MuiBottomNavigationAction-root {
  color: #94a3b8 !important;
  border-radius: var(--sy-radius-md) !important;
  margin: 2px 4px !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  padding: 6px 12px !important;
}

.MuiBottomNavigationAction-root:hover {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.12) !important;
  transform: translateY(-2px);
}

.MuiBottomNavigationAction-root.Mui-selected {
  color: #ffffff !important;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.35) 0%, rgba(13, 148, 136, 0.35) 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  box-shadow: 0 6px 20px -3px rgba(2, 132, 199, 0.4) !important;
  transform: translateY(-4px) scale(1.05) !important;
}

.MuiBottomNavigationAction-label {
  font-family: var(--sy-font-family) !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  letter-spacing: 0.3px;
  transition: all 0.2s ease !important;
}

.MuiBottomNavigationAction-root.Mui-selected .MuiBottomNavigationAction-label {
  font-weight: 800 !important;
  font-size: 0.9rem !important;
  color: #38bdf8 !important;
}

.MuiBottomNavigationAction-root .MuiSvgIcon-root {
  font-size: 1.5rem !important;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.MuiBottomNavigationAction-root.Mui-selected .MuiSvgIcon-root {
  transform: scale(1.18) !important;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.8)) !important;
  color: #38bdf8 !important;
}

/* --- 17. Custom Report Print Banner --- */
.MuiTable-root {
  border-collapse: separate !important;
  border-spacing: 0 6px !important;
}

.MuiTableRow-root {
  transition: all 0.2s ease !important;
}

.MuiTableRow-root:hover {
  background: rgba(2, 132, 199, 0.08) !important;
}

.MuiTableCell-head {
  font-weight: 800 !important;
  background: rgba(2, 132, 199, 0.12) !important;
  color: #38bdf8 !important;
  border-bottom: 2px solid rgba(2, 132, 199, 0.3) !important;
  text-transform: uppercase;
  font-size: 0.85rem !important;
  letter-spacing: 0.4px;
}

.MuiTableCell-body {
  border-bottom: 1px solid rgba(51, 65, 85, 0.5) !important;
  font-size: 0.92rem !important;
}

/* --- 16. Custom Report Print Banner --- */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .MuiAppBar-root,
  .MuiDrawer-paper,
  .no-print {
    display: none !important;
  }

  * {
    height: auto !important;
    overflow: visible !important;
    box-shadow: none !important;
  }

  .MuiTable-root {
    width: 100% !important;
  }

  body::before {
    content: "Siyada Track - Enterprise Fleet Management Report";
    display: block;
    font-size: 18pt;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: #0284c7;
    border-bottom: 2px solid #0284c7;
    padding-bottom: 10px;
  }
}

.siyada-driver-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.siyada-driver-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.siyada-driver-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.siyada-driver-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.siyada-driver-name {
  font-weight: 700;
  color: #1E293B;
}

.siyada-driver-val {
  font-weight: 700;
  color: #1E66F5;
}

.siyada-driver-bar-bg {
  width: 100%;
  height: 6px;
  background-color: #F1F5F9;
  border-radius: 3px;
  overflow: hidden;
}

.siyada-driver-bar {
  height: 100%;
  background-color: #1E66F5;
  border-radius: 3px;
}