/* ==========================================
   EARTHQUAKE VISUALIZATION STYLES
   Liquid glass aesthetic for data viz
   Dark mode ready with visible glows
   ========================================== */

/* CSS Variables with fallbacks for standalone use */
:root {
  /* Glow variables */
  --glow-intensity: 0.8;
  --glow-color-boost: rgba(100, 100, 255, 0.6);
  
  /* Fallback variables if main style.css doesn't load */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  --text-primary: #1a1a1a;
  --text-secondary: #4a5568;
  --text-tertiary: #718096;
  
  --accent-blue: #0071e3;
  
  --glass-white: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.08);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  
  --transition-breath: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-exhale: 0.2s ease-out;
}

@media (prefers-color-scheme: dark) {
  :root {
    --glow-intensity: 1.2;
    --glow-color-boost: rgba(150, 150, 255, 0.8);
  }
  
  body {
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 100%);
    color: #e4e4e7;
  }
  
  .subtitle {
    color: #a1a1aa;
  }
  
  .controls-compact,
  .map-style-bar {
    background: rgba(30, 30, 40, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  .map-style-btn {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.15);
  }
  
  .map-style-btn:hover {
    background: rgba(50, 50, 65, 0.5);
    border-color: var(--accent-blue);
  }
  
  .map-style-btn.active {
    background: var(--accent-blue);
  }
  
  #map {
    border-color: rgba(255, 255, 255, 0.15);
  }
  
  .leaflet-container {
    background: #1a1f2e !important;
  }
}

/* Ensure Leaflet container renders */
#map .leaflet-container {
  background: #f5f7fa;
  font-family: inherit;
  height: 100%;
  width: 100%;
}

/* Leaflet pane must have proper dimensions */
#map .leaflet-pane {
  z-index: 400;
}

#map .leaflet-tile-pane {
  z-index: 200;
}

/* Ensure tiles are visible */
#map .leaflet-tile {
  opacity: 1 !important;
}

#map .leaflet-tile-container {
  opacity: 1 !important;
}

/* Subtitle styling */
.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
  max-width: 720px;
}

/* Immersive Timeline Button */
.immersive-btn {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(0, 255, 0, 0.15), rgba(0, 255, 0, 0.05));
  border: 2px solid rgba(0, 255, 0, 0.4);
  border-radius: 8px;
  color: #00dd00;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 255, 0, 0.1);
}

.immersive-btn:hover {
  background: linear-gradient(135deg, rgba(0, 255, 0, 0.25), rgba(0, 255, 0, 0.1));
  border-color: rgba(0, 255, 0, 0.7);
  color: #00ff00;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.25);
  transform: translateY(-2px);
}

.immersive-btn:active {
  transform: translateY(0);
}

/* Compact Controls Above Map */
.controls-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--glass-white);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.control-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.control-item label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  font-weight: 500;
  white-space: nowrap;
}

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

.value-display {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 40px;
  text-align: center;
}

/* Stats display - Compact */
.stats-compact {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  max-width: 100%;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-value.recent-count {
  color: #ef4444;
}

/* Live Indicator - Subtle green dot next to label */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.live-indicator.active {
  opacity: 1;
}

.status-dot {
  color: #10b981;
  font-size: 8px;
  text-shadow: 0 0 4px rgba(16, 185, 129, 0.5);
  animation: gentlePulse 3s ease-in-out infinite;
}

.update-time {
  font-size: 9px;
  color: var(--text-tertiary);
  font-weight: 400;
  letter-spacing: 0.02em;
}

@keyframes gentlePulse {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

/* Range input - refined */
.control-item input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 180px;
  height: 6px;
  background: linear-gradient(to right, var(--accent-blue) 0%, rgba(0, 113, 227, 0.2) 0%);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-exhale);
}

.control-item input[type="range"]:hover {
  height: 7px;
}

.control-item input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent-blue);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
  transition: all var(--transition-exhale);
}

.control-item input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.5);
}

.control-item input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent-blue);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
  transition: all var(--transition-exhale);
}

.control-item input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.5);
}

/* Map Style Bar - Below Map */
.map-style-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: var(--space-sm);
  margin-bottom: var(--space-sm);
  padding: 8px 16px;
  background: var(--glass-white);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.map-style-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-right: 4px;
}

.map-style-btn {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.map-style-btn:hover {
  background: rgba(0, 113, 227, 0.08);
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.map-style-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
  transform: scale(1.05);
}

/* Map container */
#map {
  width: 100%;
  height: 600px;
  min-height: 500px;
  max-height: 700px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-breath);
  position: relative;
}

#map:hover {
  box-shadow: var(--shadow-lg);
}

/* Map loading state */
#map.loading::after {
  content: 'Loading earthquake data...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--glass-white);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 14px;
  z-index: 1000;
  pointer-events: none;
}

/* Override Leaflet popup styles to match our design */
.leaflet-popup-content-wrapper {
  background: var(--glass-white);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 12px;
  font-family: inherit;
}

.leaflet-popup-content {
  margin: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}

.leaflet-popup-content strong {
  font-weight: 600;
  color: var(--text-primary);
}

.leaflet-popup-content a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition-exhale);
}

.leaflet-popup-content a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.leaflet-popup-tip {
  background: var(--glass-white);
  box-shadow: var(--shadow-sm);
}

/* Legend box - compact */
#legend {
  margin-top: var(--space-md);
  padding: var(--space-sm);
  background: var(--glass-white);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  max-width: 100%;
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

#legend > div:first-child {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  margin-right: auto;
}

#legend .row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

/* Recent earthquake pin markers */
.recent-pin-marker {
  background: transparent !important;
  border: none !important;
  pointer-events: auto;
  z-index: 1000 !important;
}

.pin-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 3px currentColor) 
          drop-shadow(0 0 6px currentColor);
  animation: pinPulse 2s ease-in-out infinite;
}

@keyframes pinPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.8;
  }
}

.recent-pin-marker:hover .pin-icon {
  filter: drop-shadow(0 0 6px currentColor) 
          drop-shadow(0 0 12px currentColor)
          drop-shadow(0 0 18px var(--glow-color-boost));
  animation: pinPulse 0.8s ease-in-out infinite;
}

/* Attribution text */
.attribution {
  margin-top: var(--space-sm);
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .subtitle {
    font-size: 0.9rem;
  }
  
  .controls-compact {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
    padding: var(--space-sm);
  }
  
  .control-item {
    width: 100%;
    justify-content: space-between;
  }
  
  .slider-group {
    flex: 1;
    max-width: 200px;
  }
  
  .control-item input[type="range"] {
    flex: 1;
    min-width: 120px;
    width: 100%;
  }
  
  .stats-compact {
    width: 100%;
    justify-content: space-around;
    padding-top: var(--space-xs);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }
  
  .map-style-bar {
    flex-wrap: wrap;
    justify-content: center;
    padding: 6px 12px;
  }
  
  .map-style-label {
    width: 100%;
    text-align: center;
    margin-bottom: 4px;
  }
  
  #map {
    height: 450px;
    min-height: 350px;
  }
  
  .attribution {
    font-size: 11px;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  h1 {
    font-size: 1.75rem;
  }
  
  .subtitle {
    font-size: 0.85rem;
  }
  
  .control-item label {
    font-size: 11px;
  }
  
  .value-display {
    font-size: 16px;
  }
  
  .stat-value {
    font-size: 20px;
  }
  
  .stat-label {
    font-size: 9px;
  }
  
  #map {
    height: 400px;
    min-height: 300px;
  }
  
  .map-style-btn {
    padding: 5px 8px;
    font-size: 16px;
  }
}

/* Loading states */
.stat-value.updating {
  opacity: 0.5;
  transform: scale(0.95);
}

/* Smooth entrance animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.controls,
#map,
#legend {
  animation: fadeInUp var(--transition-breath) cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1; /* Make immediately visible for debugging */
  animation-fill-mode: forwards;
}

.controls {
  animation-delay: 0ms;
}

#map {
  animation-delay: 100ms;
}

#legend {
  animation-delay: 200ms;
}

/* Earthquake marker animations - dramatic ripple effect */
.earthquake-marker {
  cursor: pointer;
  position: relative;
  filter: drop-shadow(0 0 0 transparent);
  transition: filter 0.3s ease;
}

/* Ensure animations apply to Leaflet SVG paths */
path.earthquake-marker {
  cursor: pointer;
  filter: drop-shadow(0 0 0 transparent);
  transition: filter 0.3s ease;
}

/* ALL Leaflet SVG paths get basic styling */
.leaflet-interactive {
  transform: none !important;
  transform-origin: center center !important;
  cursor: pointer !important;
}

.leaflet-interactive:hover {
  opacity: 1 !important;
}

/* Single breathing animation - applied via inline styles in JS */
@keyframes breathe {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.9;
  }
}

/* ==========================================
   EVENT TYPE ANIMATIONS
   Each seismic event type has distinct motion
   ========================================== */

/* EXPLOSION - Sharp, aggressive burst */
/* EXPLOSION - Sharp violent pulse with intense glow */
@keyframes explosion {
  0% {
    opacity: 0.1;
    transform: scale(0.5);
    box-shadow: 0 0 2px currentColor;
  }
  10% {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 0 12px currentColor, 0 0 24px rgba(255, 51, 0, 0.8);
  }
  25% {
    opacity: 0.8;
    transform: scale(1.3);
    box-shadow: 0 0 20px currentColor, 0 0 40px rgba(255, 51, 0, 0.6);
  }
  40% {
    opacity: 0.6;
    transform: scale(1.15);
    box-shadow: 0 0 16px currentColor, 0 0 32px rgba(255, 51, 0, 0.4);
  }
  60% {
    opacity: 0.4;
    transform: scale(0.95);
    box-shadow: 0 0 10px currentColor, 0 0 20px rgba(255, 51, 0, 0.3);
  }
  85% {
    opacity: 0.2;
    transform: scale(0.8);
    box-shadow: 0 0 6px currentColor, 0 0 12px rgba(255, 51, 0, 0.2);
  }
  100% {
    opacity: 0.05;
    transform: scale(0.6);
    box-shadow: 0 0 2px currentColor;
  }
}

/* MINING EXPLOSION - Rapid cascading pulses */
@keyframes miningExplosion {
  0% {
    opacity: 0.15;
    transform: scale(0.7);
  }
  12% {
    opacity: 0.95;
    transform: scale(1.2);
  }
  24% {
    opacity: 0.7;
    transform: scale(0.9);
  }
  36% {
    opacity: 0.85;
    transform: scale(1.15);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.0);
  }
  70% {
    opacity: 0.3;
    transform: scale(0.85);
  }
  100% {
    opacity: 0.1;
    transform: scale(0.7);
  }
}

/* QUARRY BLAST - Heavy percussive pulse */
@keyframes quarryBlast {
  0% {
    opacity: 0.2;
    transform: scale(0.6);
  }
  8% {
    opacity: 1;
    transform: scale(1.25);
  }
  20% {
    opacity: 0.75;
    transform: scale(1.05);
  }
  35% {
    opacity: 0.5;
    transform: scale(0.95);
  }
  55% {
    opacity: 0.35;
    transform: scale(0.8);
  }
  100% {
    opacity: 0.1;
    transform: scale(0.6);
  }
}

/* SONIC BOOM - Fast radiating pulse with sharp edges */
@keyframes sonicBoom {
  0% {
    opacity: 0.3;
    transform: scale(0.5);
  }
  5% {
    opacity: 1;
    transform: scale(1.0);
  }
  15% {
    opacity: 0.8;
    transform: scale(1.15);
  }
  30% {
    opacity: 0.5;
    transform: scale(1.3);
  }
  50% {
    opacity: 0.2;
    transform: scale(1.1);
  }
  100% {
    opacity: 0.05;
    transform: scale(0.8);
  }
}

/* ICE QUAKE - Crystalline slow pulse with rhythmic tremor */
@keyframes iceQuake {
  0% {
    opacity: 0.2;
    transform: scale(0.8);
  }
  10% {
    opacity: 0.6;
    transform: scale(0.95);
  }
  25% {
    opacity: 0.9;
    transform: scale(1.05);
  }
  40% {
    opacity: 0.7;
    transform: scale(0.98);
  }
  60% {
    opacity: 0.4;
    transform: scale(1.02);
  }
  80% {
    opacity: 0.2;
    transform: scale(0.95);
  }
  100% {
    opacity: 0.1;
    transform: scale(0.85);
  }
}

/* ROCK BURST - Underground thump with multiple pulses */
@keyframes rockBurst {
  0% {
    opacity: 0.15;
    transform: scale(0.65);
  }
  10% {
    opacity: 0.9;
    transform: scale(1.1);
  }
  22% {
    opacity: 0.6;
    transform: scale(0.95);
  }
  35% {
    opacity: 0.8;
    transform: scale(1.08);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.0);
  }
  70% {
    opacity: 0.2;
    transform: scale(0.88);
  }
  100% {
    opacity: 0.05;
    transform: scale(0.75);
  }
}

/* CHEMICAL EXPLOSION - Organic gas cloud expansion and dissipation */
@keyframes chemicalSpill {
  0% {
    opacity: 0.2;
    transform: scale(0.3);
    filter: blur(0px) drop-shadow(0 0 3px #00ff00);
  }
  10% {
    opacity: 0.9;
    transform: scale(0.8) translate(-12px, 15px);
    filter: blur(1px) drop-shadow(0 0 8px #00ff00) drop-shadow(0 0 12px #00dd00);
  }
  25% {
    opacity: 0.8;
    transform: scale(1.2) translate(18px, -10px);
    filter: blur(1.5px) drop-shadow(0 0 10px #00dd00) drop-shadow(0 0 16px #00aa00);
  }
  40% {
    opacity: 0.65;
    transform: scale(1.6) translate(-20px, -18px);
    filter: blur(2px) drop-shadow(0 0 12px #00aa00) drop-shadow(0 0 18px #009900);
  }
  55% {
    opacity: 0.5;
    transform: scale(2.0) translate(22px, 12px);
    filter: blur(2.5px) drop-shadow(0 0 10px #00aa00) drop-shadow(0 0 16px #007700);
  }
  70% {
    opacity: 0.35;
    transform: scale(2.4) translate(-18px, 20px);
    filter: blur(3px) drop-shadow(0 0 8px #009900) drop-shadow(0 0 12px #006600);
  }
  85% {
    opacity: 0.2;
    transform: scale(2.8) translate(15px, -15px);
    filter: blur(3.5px) drop-shadow(0 0 6px #007700);
  }
  100% {
    opacity: 0.05;
    transform: scale(3.2);
    filter: blur(4px) drop-shadow(0 0 2px #005500);
  }
}

/* ORGANIC GAS SPILL - Flowing wisps with irregular movement */
@keyframes gasSpillAura {
  0% {
    opacity: 0.25;
    transform: scale(0.4) translate(0, 0);
    filter: blur(0.3px);
  }
  6% {
    opacity: 0.8;
    transform: scale(0.6) translate(5px, -7px);
    filter: blur(0.6px);
  }
  12% {
    opacity: 0.7;
    transform: scale(0.8) translate(-9px, 4px);
    filter: blur(0.8px);
  }
  18% {
    opacity: 0.65;
    transform: scale(0.95) translate(11px, 6px);
    filter: blur(1px);
  }
  24% {
    opacity: 0.6;
    transform: scale(1.08) translate(-6px, -8px);
    filter: blur(1.1px);
  }
  31% {
    opacity: 0.55;
    transform: scale(1.18) translate(8px, 9px);
    filter: blur(1.3px);
  }
  38% {
    opacity: 0.5;
    transform: scale(1.28) translate(-11px, 3px);
    filter: blur(1.4px);
  }
  46% {
    opacity: 0.45;
    transform: scale(1.36) translate(9px, -7px);
    filter: blur(1.6px);
  }
  54% {
    opacity: 0.4;
    transform: scale(1.44) translate(-7px, -10px);
    filter: blur(1.7px);
  }
  62% {
    opacity: 0.3;
    transform: scale(1.51) translate(10px, 8px);
    filter: blur(1.8px);
  }
  70% {
    opacity: 0.2;
    transform: scale(1.58) translate(-8px, 6px);
    filter: blur(1.9px);
  }
  80% {
    opacity: 0.12;
    transform: scale(1.64) translate(6px, -5px);
    filter: blur(2.1px);
  }
  90% {
    opacity: 0.08;
    transform: scale(1.7) translate(-4px, 4px);
    filter: blur(2.2px);
  }
  100% {
    opacity: 0.02;
    transform: scale(1.75) translate(0, 0);
    filter: blur(2.3px);
  }
}

/* Secondary flowing wisp animation (offset) */
@keyframes gasSpillWisp {
  0% {
    opacity: 0.1;
    transform: scale(0.2) translate(0, 0) rotate(0deg);
    filter: blur(0.5px);
  }
  20% {
    opacity: 0.6;
    transform: scale(0.8) translate(20px, -20px) rotate(45deg);
    filter: blur(1.5px);
  }
  40% {
    opacity: 0.5;
    transform: scale(1.1) translate(-25px, 25px) rotate(90deg);
    filter: blur(2.5px);
  }
  60% {
    opacity: 0.4;
    transform: scale(1.4) translate(30px, 15px) rotate(180deg);
    filter: blur(3px);
  }
  80% {
    opacity: 0.2;
    transform: scale(1.9) translate(-20px, -30px) rotate(270deg);
    filter: blur(3.5px);
  }
  100% {
    opacity: 0.05;
    transform: scale(2.4) translate(0, 0) rotate(360deg);
    filter: blur(4px);
  }
}

/* Bright green glow center for chemical spill */
@keyframes gasGlowCenter {
  0% {
    opacity: 0.3;
    box-shadow: 0 0 4px #00ff00, 0 0 8px #00dd00;
  }
  50% {
    opacity: 0.8;
    box-shadow: 0 0 12px #00ff00, 0 0 24px #00dd00, 0 0 36px #00aa00;
  }
  100% {
    opacity: 0.3;
    box-shadow: 0 0 4px #00ff00, 0 0 8px #00dd00;
  }
}

/* Explosion marker styling - divIcon with inline SVG */
.explosion-marker-icon {
  background: transparent;
  border: none;
  margin: 0;
  /* Explicitly disable Leaflet's default divIcon margin offsets */
}

.explosion-marker-icon svg.star-burst,
.explosion-marker-icon svg.gas-cloud {
  display: block;
  position: relative;
  transform-origin: center;
}

.explosion-marker-icon svg.star-burst {
  filter: drop-shadow(0 0 4px rgba(255, 51, 0, 0.6)) 
          drop-shadow(0 0 8px rgba(255, 68, 0, 0.4));
}

.explosion-marker-icon svg.gas-cloud {
  filter: drop-shadow(0 0 6px rgba(255, 204, 0, 0.5));
}

/* CHEMICAL SPILL OVERLAY - Animated element on custom pane */
.chemical-gas-overlay {
  pointer-events: none;
  z-index: 450;
}

.chemical-gas-overlay svg.chemical-gas-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chemical-gas-overlay .gas-wisps {
  transform-origin: 50px 50px;
}

/* Technical Details Card */
.tech-card {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.tech-card-trigger {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.tech-card-trigger:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.tech-card-content {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
  min-width: 250px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.tech-card:hover .tech-card-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tech-card-content p {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.tech-card-content p:last-child {
  margin-bottom: 0;
}

/* Concentric ripple animations for chemical spill markers */
@keyframes ripple1 {
  0% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
  }
}

@keyframes ripple2 {
  0% {
    opacity: 0.4;
  }
  40% {
    opacity: 0.15;
  }
  100% {
    opacity: 0;
  }
}


.tech-card-content strong {
  color: var(--text-primary);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
