/* ============================================
   EONET Watch — Design System & Styles
   ============================================ */

:root {
  color-scheme: dark;
  
  /* Colors */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(31, 41, 55, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(249, 115, 22, 0.3);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-orange: #f97316;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-pink: #ec4899;

  /* Category Colors */
  --cat-wildfires: #ef4444;
  --cat-storms: #8b5cf6;
  --cat-volcanoes: #f97316;
  --cat-floods: #3b82f6;
  --cat-earthquakes: #f59e0b;
  --cat-other: #64748b;

  /* Gradients */
  --grad-fire: linear-gradient(135deg, #f97316, #ef4444);
  --grad-purple: linear-gradient(135deg, #8b5cf6, #6366f1);
  --grad-blue: linear-gradient(135deg, #3b82f6, #06b6d4);
  --grad-dark: linear-gradient(135deg, #1e293b, #0f172a);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(249, 115, 22, 0.15);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Font */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   Background Particles
   ============================================ */
.bg-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-10vh) scale(1);
  }
}

/* ============================================
   Header
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 14, 26, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
}

.header-inner {
  max-width: 1920px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon svg {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.4));
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.4)); }
  50% { filter: drop-shadow(0 0 16px rgba(249, 115, 22, 0.6)); }
}

.logo-title {
  display: block;
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #f97316, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.logo-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: var(--radius-xl);
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-orange);
}

.stat-pill span:last-child {
  color: var(--text-secondary);
  font-weight: 400;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-red);
  animation: pulseDot 2s ease-in-out infinite;
  box-shadow: 0 0 8px var(--accent-red);
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent-red); }
  50% { opacity: 0.5; box-shadow: 0 0 16px var(--accent-red); }
}

.last-updated {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-main);
}

.refresh-btn:hover {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.3);
  color: var(--accent-orange);
}

.refresh-btn.spinning svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.refresh-btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   Header Actions & Toggle
   ============================================ */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.auto-refresh-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.auto-refresh-toggle input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 32px;
  height: 18px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  transition: all 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auto-refresh-toggle input:checked + .toggle-slider {
  background: rgba(249, 115, 22, 0.2);
  border-color: var(--accent-orange);
}

.auto-refresh-toggle input:checked + .toggle-slider::before {
  transform: translateX(12px);
  background: var(--accent-orange);
}

.toggle-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

.auto-refresh-toggle:hover .toggle-label {
  color: var(--text-secondary);
}

.auto-refresh-toggle input:checked ~ .toggle-label {
  color: var(--accent-orange);
}

/* ============================================
   Date Selector
   ============================================ */
.date-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-input-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.date-input-group label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.date-input {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.25s ease;
}

.date-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  transition: 0.2s;
  /* Make the icon slightly orange */
  filter: invert(0.6) sepia(1) saturate(5) hue-rotate(345deg);
}

.date-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.date-input:hover,
.date-input:focus {
  border-color: rgba(249, 115, 22, 0.4);
  outline: none;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
}

select.date-input option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-main);
}

.date-presets {
  display: flex;
  gap: 4px;
}

.preset-btn {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-main);
}

.preset-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.preset-btn.active {
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.3);
  color: var(--accent-orange);
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-xl);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.status-badge.active .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: pulseDot 2s ease-in-out infinite;
  box-shadow: 0 0 6px #10b981;
}

.status-badge.closed {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
}

.status-badge.closed .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
}

/* ============================================
   Main Layout
   ============================================ */
.main-layout {
  display: grid;
  grid-template-columns: 320px 1fr 340px;
  gap: 0;
  height: calc(100vh - 64px);
  position: relative;
  z-index: 1;
}

/* ============================================
   Sidebar Left — Counters
   ============================================ */
.sidebar-left {
  padding: 16px;
  overflow-y: auto;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  backdrop-filter: blur(10px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-glow);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.card-title svg {
  width: 16px;
  height: 16px;
  color: var(--accent-orange);
  flex-shrink: 0;
}

/* ============================================
   Category Filters
   ============================================ */
.filter-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(249, 115, 22, 0.08));
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cat-filter {
  padding: 5px 12px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-main);
}

.cat-filter:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.cat-filter.active {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: #fff;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.3);
}

/* ============================================
   Counter List
   ============================================ */
.counter-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
}

.counter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  transition: all 0.25s ease;
  cursor: default;
  animation: fadeSlideIn 0.4s ease forwards;
  opacity: 0;
}

.counter-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(4px);
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.counter-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.counter-value {
  display: flex;
  align-items: center;
  gap: 6px;
}

.counter-number {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-orange);
  min-width: 20px;
  text-align: right;
}

.counter-bar {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.counter-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--grad-fire);
  transition: width 0.6s ease;
}

/* Skeleton loaders */
.skeleton-loader {
  height: 36px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.skeleton-card {
  height: 100px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   Map Section
   ============================================ */
.map-section {
  position: relative;
  display: flex;
  flex-direction: column;
}

.map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 14, 26, 0.6);
  flex-shrink: 0;
}

.map-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.map-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.wildfires { background: var(--cat-wildfires); box-shadow: 0 0 6px var(--cat-wildfires); }
.legend-dot.severeStorms { background: var(--cat-storms); box-shadow: 0 0 6px var(--cat-storms); }
.legend-dot.volcanoes { background: var(--cat-volcanoes); box-shadow: 0 0 6px var(--cat-volcanoes); }
.legend-dot.floods { background: var(--cat-floods); box-shadow: 0 0 6px var(--cat-floods); }
.legend-dot.earthquakes { background: var(--cat-earthquakes); box-shadow: 0 0 6px var(--cat-earthquakes); }
.legend-dot.other { background: var(--cat-other); box-shadow: 0 0 6px var(--cat-other); }

#map {
  flex: 1;
  min-height: 0;
  z-index: 1;
  background: var(--bg-primary); /* Fixes white bars when zooming out */
}

/* Force dark background for empty map areas */
.leaflet-container {
  background: var(--bg-primary) !important;
}

/* Leaflet custom dark tiles overlay */
.leaflet-tile-pane {
  filter: brightness(0.7) contrast(1.1) saturate(0.8);
}

.leaflet-control-zoom a {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.leaflet-popup-content-wrapper {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--border-color) !important;
}

.leaflet-popup-tip {
  background: var(--bg-secondary) !important;
}

.leaflet-popup-close-button {
  color: var(--text-muted) !important;
}

.popup-content {
  padding: 4px;
}

.popup-content h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--accent-orange);
}

.popup-content p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.popup-content .popup-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-xl);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 4px;
}

.map-overlay-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 500;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.map-overlay-info.hidden {
  opacity: 0;
}

.overlay-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 14, 26, 0.9);
  padding: 14px 24px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.overlay-loading span {
  font-size: 14px;
  color: var(--text-secondary);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Custom map markers */
.custom-marker {
  position: relative;
}

.marker-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 10px currentColor;
  animation: markerPulse 2s ease-in-out infinite;
}

.marker-ring {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0.3;
  animation: ringPulse 2s ease-in-out infinite;
}

@keyframes markerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.5); opacity: 0; }
}

/* ============================================
   Sidebar Right — Event Feed
   ============================================ */
.sidebar-right {
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.feed-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.feed-badge {
  background: var(--grad-fire);
  padding: 2px 10px;
  border-radius: var(--radius-xl);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.event-feed {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================
   AdSense Placement Containers
   ============================================ */
.ad-container {
  min-height: 100px;
  background: var(--bg-glass);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  position: relative;
  overflow: hidden;
}

.ad-container::before {
  content: 'ADVERTISEMENT';
  position: absolute;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.2);
  z-index: 0;
  pointer-events: none;
}

.ad-container ins {
  z-index: 1;
}

/* Event Card */
.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 14px 14px 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: cardSlideIn 0.5s ease forwards;
  opacity: 0;
  position: relative;
}

.event-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--card-accent, var(--accent-orange));
  border-radius: 3px 0 0 3px;
}

.event-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.event-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.event-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  flex: 1;
  word-break: break-word;
  overflow-wrap: break-word;
}

.event-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-xl);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  white-space: nowrap;
}

.event-cat-badge.wildfires {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}
.event-cat-badge.severeStorms {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
}
.event-cat-badge.volcanoes {
  background: rgba(249, 115, 22, 0.15);
  color: #fdba74;
}
.event-cat-badge.floods {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}
.event-cat-badge.earthquakes {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

.event-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.event-meta-item svg {
  width: 12px;
  height: 12px;
}

.event-location {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.event-location svg {
  width: 12px;
  height: 12px;
  color: var(--accent-orange);
  flex-shrink: 0;
}

/* ============================================
   Trajectory Styles
   ============================================ */
.trajectory-tooltip {
  background: rgba(10, 14, 26, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px !important;
  color: var(--text-primary) !important;
  font-family: var(--font-main) !important;
  font-size: 11px !important;
  padding: 6px 10px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(8px);
}

.trajectory-tooltip::before {
  border-top-color: rgba(10, 14, 26, 0.92) !important;
}

.trajectory-arrow {
  background: none !important;
  border: none !important;
  font-size: 14px;
  text-shadow: 0 0 8px currentColor;
  filter: drop-shadow(0 0 4px currentColor);
  display: flex;
  align-items: center;
  justify-content: center;
}

.trajectory-arrow div {
  line-height: 1;
}

/* ============================================
   Toast
   ============================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1400px) {
  .main-layout {
    grid-template-columns: 280px 1fr 300px;
  }
}

@media (max-width: 1100px) {
  .main-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 50vh auto;
    height: auto;
  }

  .sidebar-left {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: none;
    overflow: visible;
  }

  .filter-card {
    grid-column: 1 / -1;
  }

  .sidebar-right {
    border-left: none;
    border-top: 1px solid var(--border-color);
    max-height: 60vh;
  }

  .counter-list {
    max-height: 180px;
  }

  .map-section {
    min-height: 50vh;
  }
}

@media (max-width: 768px) {
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 10px;
  }

  .header-stats {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .sidebar-left {
    grid-template-columns: 1fr;
  }

  .main-layout {
    grid-template-rows: auto 40vh auto;
  }

  .map-legend {
    display: none;
  }
}
