/* ═══════════════════════════════════════════════
   LIVE MAP — Full-screen Leaflet map
═══════════════════════════════════════════════ */

.map-container {
  width: 100%;
  height: calc(100vh - 48px); /* subtract nav height */
  z-index: 0;
}

/* Override Leaflet defaults to match dark theme */
.leaflet-container {
  background: var(--bg, #0a0c10);
  font-family: 'IBM Plex Mono', monospace;
}
.leaflet-control-zoom a {
  background: rgba(10,12,16,0.9) !important;
  color: var(--muted, #6b7785) !important;
  border-color: rgba(107,119,133,0.2) !important;
}
.leaflet-control-zoom a:hover {
  color: var(--white, #f0f2f4) !important;
  background: rgba(20,24,32,0.95) !important;
}
.leaflet-control-attribution {
  background: rgba(10,12,16,0.7) !important;
  color: rgba(107,119,133,0.5) !important;
  font-size: 9px !important;
}
.leaflet-control-attribution a {
  color: rgba(107,119,133,0.6) !important;
}

/* ═══════════════════════════════════════════════
   FLOATING INFO PANEL (top-right)
═══════════════════════════════════════════════ */
.map-info-panel {
  position: fixed;
  top: 60px;
  right: 12px;
  background: rgba(10,12,16,0.92);
  border: 1px solid rgba(107,119,133,0.15);
  padding: 12px 16px;
  z-index: 1000;
  min-width: 180px;
}
[dir="rtl"] .map-info-panel {
  right: auto;
  left: 12px;
}
.map-info-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red-glow, #cc0000);
  margin-bottom: 4px;
}
.map-info-title {
  font-family: 'Bebas Neue', cursive;
  font-size: 28px;
  color: var(--white, #f0f2f4);
  line-height: 1;
  margin-bottom: 8px;
}
.map-info-stat {
  font-size: 11px;
  color: var(--muted, #6b7785);
  letter-spacing: 0.05em;
}
.map-info-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--amber, #e8a000);
  margin-inline-end: 4px;
}

/* ═══════════════════════════════════════════════
   FLOATING LEGEND (bottom-left)
═══════════════════════════════════════════════ */
.map-legend {
  position: fixed;
  bottom: 24px;
  left: 12px;
  background: rgba(10,12,16,0.92);
  border: 1px solid rgba(107,119,133,0.15);
  padding: 10px 14px;
  z-index: 1000;
}
[dir="rtl"] .map-legend {
  left: auto;
  right: 12px;
}
.map-legend-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted, #6b7785);
  margin-bottom: 8px;
}
.map-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted, #6b7785);
  padding: 2px 0;
}
.map-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   FILTER BUTTONS (top-center)
═══════════════════════════════════════════════ */
.map-filters {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  background: rgba(10,12,16,0.92);
  border: 1px solid rgba(107,119,133,0.15);
  padding: 4px;
  z-index: 1000;
  overflow-x: auto;
  max-width: calc(100vw - 240px);
  scrollbar-width: none;
}
.map-filters::-webkit-scrollbar { display: none; }
.map-filter-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted, #6b7785);
  background: none;
  border: 1px solid transparent;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.map-filter-btn:hover {
  color: var(--white, #f0f2f4);
}
.map-filter-btn.active {
  color: var(--white, #f0f2f4);
  background: rgba(255,255,255,0.06);
  border-color: rgba(107,119,133,0.25);
}
.map-filter-sep {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--red, #cc0000);
  padding: 5px 4px;
  white-space: nowrap;
  align-self: center;
  opacity: 0.6;
}

/* ═══════════════════════════════════════════════
   MARKER POPUPS
═══════════════════════════════════════════════ */
.leaflet-popup-content-wrapper {
  background: rgba(10,12,16,0.95) !important;
  border: 1px solid rgba(107,119,133,0.25) !important;
  border-radius: 2px !important;
  color: var(--white, #f0f2f4) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5) !important;
}
.leaflet-popup-tip {
  background: rgba(10,12,16,0.95) !important;
  border: 1px solid rgba(107,119,133,0.25) !important;
}
.leaflet-popup-content {
  margin: 10px 14px !important;
  font-family: 'IBM Plex Mono', monospace !important;
  font-size: 11px !important;
  line-height: 1.5 !important;
}
.popup-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.popup-type {
  font-size: 10px;
  color: var(--muted, #6b7785);
  margin-bottom: 6px;
}
.popup-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 1px;
}

/* ── Event popup styles ── */
.popup-event-time {
  font-size: 9px;
  color: var(--muted, #6b7785);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.popup-event-headline {
  font-size: 12px;
  font-weight: 700;
  color: var(--white, #f0f2f4);
  line-height: 1.4;
  margin-bottom: 6px;
}
.popup-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.popup-source-link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  color: var(--cyan, #00ccff);
  text-decoration: none;
  padding: 2px 6px;
  border: 1px solid rgba(0,204,255,0.25);
  border-radius: 2px;
  transition: background 0.2s, color 0.2s;
}
.popup-source-link:hover {
  background: rgba(0,204,255,0.12);
  color: #fff;
}

/* Pulsing marker animation */
@keyframes pulse-marker {
  0%   { transform: scale(1); opacity: 0.9; }
  50%  { transform: scale(1.6); opacity: 0.3; }
  100% { transform: scale(1); opacity: 0.9; }
}
.marker-pulse {
  animation: pulse-marker 2s ease-in-out infinite;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 600px) {
  .map-info-panel {
    top: 56px;
    right: 8px;
    padding: 8px 12px;
    min-width: 140px;
  }
  [dir="rtl"] .map-info-panel {
    right: auto;
    left: 8px;
  }
  .map-info-title {
    font-size: 22px;
  }
  .map-legend {
    bottom: 12px;
    left: 8px;
    padding: 8px 10px;
  }
  [dir="rtl"] .map-legend {
    left: auto;
    right: 8px;
  }
  .map-filters {
    top: 56px;
    max-width: calc(100vw - 180px);
  }
}

/* ═══════════════════════════════════════════════
   LIGHT MODE
═══════════════════════════════════════════════ */
[data-theme="light"] .leaflet-container {
  background: #e8e8e8;
}
[data-theme="light"] .map-info-panel,
[data-theme="light"] .map-legend,
[data-theme="light"] .map-filters {
  background: rgba(255,255,255,0.94);
  border-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .map-filter-btn.active {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.12);
}
[data-theme="light"] .leaflet-control-zoom a {
  background: rgba(255,255,255,0.92) !important;
  color: #333 !important;
  border-color: rgba(0,0,0,0.15) !important;
}
[data-theme="light"] .leaflet-control-attribution {
  background: rgba(255,255,255,0.8) !important;
  color: rgba(0,0,0,0.5) !important;
}
[data-theme="light"] .leaflet-popup-content-wrapper {
  background: rgba(255,255,255,0.97) !important;
  border-color: rgba(0,0,0,0.12) !important;
  color: #1a1a1a !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15) !important;
}
[data-theme="light"] .leaflet-popup-tip {
  background: rgba(255,255,255,0.97) !important;
  border-color: rgba(0,0,0,0.12) !important;
}
