@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-ar: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg-dark: #090d16;
  --glass-bg: rgba(15, 23, 42, 0.85);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-border-hover: rgba(56, 189, 248, 0.4);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-blue: #3b82f6;
  --glow-cyan: 0 0 25px rgba(6, 182, 212, 0.45);
  --glow-emerald: 0 0 25px rgba(16, 185, 129, 0.45);
  --glow-rose: 0 0 25px rgba(244, 63, 94, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: #f1f5f9;
  font-family: var(--font-ar);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

body[dir="ltr"] {
  font-family: var(--font-en);
}

/* Glassmorphism Classes */
select {
  color-scheme: dark;
}

select option, select optgroup {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  padding: 8px 12px !important;
}

optgroup {
  color: #38bdf8 !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  background-color: #090d16 !important;
  padding-top: 8px !important;
}

option:checked, option:hover, option:focus {
  background: #1e293b !important;
  color: #38bdf8 !important;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.55);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
  border-color: var(--glass-border-hover);
}

.glass-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
}

/* Map Container */
#map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  background: #0b0f19;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Radar Ping & Pulse */
@keyframes radar-ripple {
  0% {
    transform: scale(0.2);
    opacity: 0.9;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

.radar-pulse {
  position: relative;
}
.radar-pulse::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border-radius: 50%;
  background: var(--accent-cyan);
  animation: radar-ripple 2s infinite ease-out;
  pointer-events: none;
}

/* Glowing Neon Elements */
.glow-cyan {
  box-shadow: var(--glow-cyan);
}
.glow-emerald {
  box-shadow: var(--glow-emerald);
}
.glow-rose {
  box-shadow: var(--glow-rose);
}

/* Score Progress Dial */
.score-circle {
  transition: stroke-dashoffset 1s ease-in-out;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

/* Drawer Animations */
.drawer-enter {
  transform: translateX(110%);
}
body[dir="rtl"] .drawer-enter {
  transform: translateX(-110%);
}
.drawer-active {
  transform: translateX(0);
}

/* Floating Controls */
.interactive-btn {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(59, 130, 246, 0.3));
  border: 1px solid rgba(6, 182, 212, 0.5);
  color: #38bdf8;
  transition: all 0.2s ease;
}
.interactive-btn:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.5), rgba(59, 130, 246, 0.5));
  box-shadow: var(--glow-cyan);
  color: #fff;
  transform: scale(1.02);
}
.interactive-btn:active {
  transform: scale(0.98);
}

/* AI Badge Shimmer */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.ai-shimmer-badge {
  background: linear-gradient(90deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  background-size: 200% 100%;
  animation: shimmer 3s infinite linear;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* POI Marker Badge */
.custom-poi-marker {
  background: rgba(15, 23, 42, 0.95);
  border: 1.5px solid #06b6d4;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.85), 0 0 12px rgba(6, 182, 212, 0.4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}
.custom-poi-marker:hover {
  transform: scale(1.1);
  border-color: #38bdf8;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.9), 0 0 18px rgba(56, 189, 248, 0.7);
  z-index: 1000 !important;
}

/* Road Name Static Labels on Map */
.road-label-badge {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fef08a;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

/* Leaflet Custom Tooltip & Popups */
.road-tooltip {
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(56, 189, 248, 0.5) !important;
  color: #ffffff !important;
  border-radius: 10px !important;
  box-shadow: 0 6px 25px rgba(0,0,0,0.7) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 6px 10px !important;
}

.road-tooltip::before {
  border-top-color: rgba(15, 23, 42, 0.95) !important;
}

.leaflet-popup-content-wrapper {
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(56, 189, 248, 0.5) !important;
  color: #ffffff !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6) !important;
}
.leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.95) !important;
}
