/* ===== ANIMATED MARKER STYLES ===== */

/* Ghost / tube path — shown when debug paths are OFF. */
.anim-path-tube {
  stroke-linecap:  round;
  stroke-linejoin: round;
  transition: opacity 0.3s ease;
  will-change: filter;
}

/* Directional flow animation on the white contrail trail.
   Dashes scroll forward (start → end = direction the jet flew).
   Period = dasharray sum (18 + 10 = 28px). */
.anim-path-flow {
  stroke-dasharray:  18 10;
  stroke-linecap:    round;
  stroke-linejoin:   round;
  animation: pathFlow 0.9s linear infinite;
}

@keyframes pathFlow {
  to { stroke-dashoffset: -28; }
}

/* Hardware-accelerated smooth animations */
.leaflet-marker-icon {
  /* Enable GPU acceleration for smooth movement */
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Smooth transitions for animated markers */
.jet-marker .leaflet-marker-icon,
.missile-marker .leaflet-marker-icon {
  transition: transform 16ms linear; /* Reduced from 50ms for less visible rotation */
  transform-origin: center center;
  opacity: 1; /* Start visible since we pre-calculate rotation */
}

/* Path animation markers with shadow support */
.animated-path-marker {
  transform-origin: center center !important;
  will-change: transform;
}

.animation-container {
  position: relative !important;
  overflow: visible !important;
  will-change: transform;
}

/* Rotatable group for smooth rotation */
.rotatable-group {
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
  transition: transform 100ms linear;
}

/* Fixed direction shadows - never rotate */
.animation-container .path-shadow {
  position: absolute !important;
  pointer-events: none !important;
  z-index: 0 !important;
  /* Shadow maintains fixed direction regardless of main icon rotation */
}

/* Main icon - rotates with movement direction */
.animation-container .main-icon {
  position: relative !important;
  z-index: 1 !important;
  transform-origin: center center !important;
}

/* ===== SIMPLE ARROW MARKER (TEMPORARY FOR TESTING ROTATION) ===== */
.simple-arrow-marker {
  background: rgba(255, 255, 0, 0.8) !important;
  border: 2px solid #ff0000 !important;
  border-radius: 50% !important;
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.8) !important;
  font-size: 16px !important;
  font-weight: bold !important;
  color: #ff4444 !important;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.7) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transform-origin: center center !important;
  transition: transform 0.1s ease-out !important;
  z-index: 10000 !important;
  width: 20px !important;
  height: 20px !important;
  position: absolute !important;
}

/* ===== DIRECTIONAL ANIMATION ICONS ===== */
.animated-object,
.big-arrow-icon {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

.big-arrow-icon svg {
  filter: drop-shadow(3px 3px 6px rgba(0,0,0,0.7));
  transition: transform 0.1s ease-out;
}

.big-arrow-icon svg polygon {
  animation: arrowPulse 1s infinite ease-in-out;
}

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

/* ===== SOLDIER ANIMATION ===== */
.soldier-icon {
  width: 64px;
  height: 64px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.soldier-body {
  font-size: 48px;
  position: relative;
  z-index: 2;
  animation: soldierBounce 2s ease-in-out infinite;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

@keyframes soldierBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.05); }
}

/* ===== FIRE ANIMATION ===== */
.fire-icon {
  width: 48px;
  height: 48px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fire-flame {
  font-size: 36px;
  position: relative;
  z-index: 2;
  animation: flameFlicker 1.5s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px #ff6600);
}

.fire-glow {
  position: absolute;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(255, 102, 0, 0.8) 0%, rgba(255, 102, 0, 0.4) 50%, transparent 100%);
  border-radius: 50%;
  animation: fireGlow 2s ease-in-out infinite alternate;
}

@keyframes flameFlicker {
  0% { transform: rotate(-2deg) scale(1); }
  100% { transform: rotate(2deg) scale(1.05); }
}

@keyframes fireGlow {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 0.9; }
}

/* ===== PULSING LOCATION PIN ===== */
.location-pin {
  animation: locationPulse 2s ease-in-out infinite;
}

@keyframes locationPulse {
  0%, 100% { 
    transform: scale(1);
    filter: drop-shadow(0 0 5px rgba(0, 168, 255, 0.6));
  }
  50% { 
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px rgba(0, 168, 255, 0.9));
  }
}

/* ===== MARKER GLOW EFFECTS ===== */
.marker-glow {
  filter: drop-shadow(0 0 10px currentColor);
  animation: markerGlow 3s ease-in-out infinite;
}

@keyframes markerGlow {
  0%, 100% { filter: drop-shadow(0 0 10px currentColor); }
  50% { filter: drop-shadow(0 0 20px currentColor); }
}

/* ===== HELICOPTER ANIMATION ===== */
.helicopter-icon {
  width: 48px;
  height: 48px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.helicopter-body {
  font-size: 36px;
  position: relative;
  z-index: 2;
  animation: helicopterHover 3s ease-in-out infinite;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

@keyframes helicopterHover {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}

/* ===== TANK ANIMATION ===== */
.tank-icon {
  width: 48px;
  height: 48px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tank-body {
  font-size: 36px;
  position: relative;
  z-index: 2;
  animation: tankShake 4s ease-in-out infinite;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

@keyframes tankShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-1px); }
  75% { transform: translateX(1px); }
}

/* ===== GENERIC MARKER ANIMATION ===== */
.generic-marker-icon {
  width: 48px;
  height: 48px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-body {
  font-size: 36px;
  position: relative;
  z-index: 2;
  animation: markerPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.3));
}

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

/* ===== RESPONSIVE ANIMATIONS ===== */
@media (prefers-reduced-motion: reduce) {
  .radar-sweep,
  .soldier-figure,
  .flame,
  .location-pin,
  .marker-glow {
    animation: none;
  }
}

@media (max-width: 768px) {
  .radar-icon,
  .soldier-icon,
  .fire-icon {
    width: 30px;
    height: 30px;
  }
}

