/* Default to Cairo for Arabic text; Latin still falls through to the sans stack. */
body {
  font-family: "Cairo", "Inter", "Hanken Grotesk", system-ui, sans-serif;
}

.map-overlay-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image: radial-gradient(circle at 50% 50%, rgba(75, 142, 255, 0.12) 0%, rgba(10, 15, 24, 0.9) 100%),
    repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(255, 255, 255, 0.05) 50px),
    repeating-linear-gradient(90deg, transparent, transparent 49px, rgba(255, 255, 255, 0.05) 50px);
}

.map-overlay {
  pointer-events: none;
}

.mapboxgl-map {
  font-family: inherit;
}

.emerg-marker {
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

.emerg-marker-incident {
  background: #ff5c5c;
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.emerg-marker-unit {
  background: #fbbf24;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.emerg-marker-available {
  background: #fbbf24;
}

.emerg-marker-hub {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.85);
}

/* Ambulance hubs: blue + medical cross. Civil defense: orange + shield. */
.emerg-marker-hub-ambulance {
  background: #2563eb;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.6);
}

.emerg-marker-hub-civil {
  background: #f97316;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.6);
}

.emerg-marker-icon {
  font-size: 14px;
  line-height: 1;
  color: #ffffff;
}

.emerg-marker-selected {
  width: 18px;
  height: 18px;
  background: #ffb874;
  border: 2px solid #ffffff;
  box-shadow: 0 0 16px rgba(255, 184, 116, 0.8);
}

/* ETA card pinned above a car marker. As a child of the marker element it is
   carried along whenever Mapbox repositions the marker. */
.emerg-unit-card {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(18, 22, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 3px 7px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 5;
}
.emerg-unit-card-name {
  display: block;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #adc6ff;
  font-weight: 700;
}
.emerg-unit-card-eta {
  display: block;
  color: #ffb874;
  letter-spacing: 0.04em;
}
.emerg-unit-card-eta.is-on-scene {
  color: #22c55e;
}
.emerg-unit-card::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(18, 22, 32, 0.95);
}

/* Popup */
.emerg-popup .mapboxgl-popup-content {
  background: rgba(18, 22, 32, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  min-width: 190px;
}
.emerg-popup.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip {
  border-top-color: rgba(18, 22, 32, 0.97);
}
.emerg-popup.mapboxgl-popup-anchor-top .mapboxgl-popup-tip {
  border-bottom-color: rgba(18, 22, 32, 0.97);
}
.emerg-popup .mapboxgl-popup-close-button {
  color: #8b90a0;
  font-size: 18px;
  padding: 4px 10px;
  border-radius: 0 8px 0 0;
  line-height: 1;
}
.emerg-popup .mapboxgl-popup-close-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #e0e2ed;
}
.emerg-popup-inner {
  padding: 12px 14px;
  font-family: 'JetBrains Mono', monospace;
  color: #e0e2ed;
}
.emerg-popup-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
  padding-right: 20px;
}
.emerg-popup-sub {
  font-size: 10px;
  color: #8b90a0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.emerg-popup-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 8px 0;
}
.emerg-popup-label {
  font-size: 9px;
  color: #8b90a0;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 6px;
}
.emerg-popup-value {
  font-size: 12px;
  color: #e0e2ed;
  margin-top: 1px;
}

