/* ========================================
   IRAN WAR UPDATES — Animations
   ======================================== */

/* Ticker scroll — infinite horizontal */
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ticker-content {
  animation: ticker-scroll 35s linear infinite;
}

/* Pulse — LIVE badge dot and map pins */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.4);
  }
}

.live-dot {
  animation: pulse 1.5s ease-in-out infinite;
}

.map-pin-dot {
  animation: pulse 2s ease-in-out infinite;
}

/* Hero content fade-in-up */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-content {
  animation: fade-in-up 1.2s ease-out 0.3s both;
}

/* Smoke drift on hero */
@keyframes smoke-drift {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.25;
  }
  25% {
    transform: translate(-10px, -20px) scale(1.05);
    opacity: 0.15;
  }
  50% {
    transform: translate(5px, -30px) scale(1.08);
    opacity: 0.1;
  }
  75% {
    transform: translate(15px, -15px) scale(1.03);
    opacity: 0.18;
  }
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.25;
  }
}

.hero-smoke {
  animation: smoke-drift 10s ease-in-out infinite;
}

/* Hero glow pulse */
@keyframes glow-pulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.3;
  }
}

/* Reaction button pop */
@keyframes reaction-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Breaking bar slide-in */
@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.breaking-inner {
  animation: slide-in-left 0.8s ease-out 0.5s both;
}

/* Countdown imminent pulse */
@keyframes imminent-pulse {
  0%, 100% {
    opacity: 1;
    text-shadow: 0 0 10px rgba(204, 0, 0, 0.5);
  }
  50% {
    opacity: 0.7;
    text-shadow: 0 0 30px rgba(204, 0, 0, 0.8);
  }
}

.countdown-imminent {
  animation: imminent-pulse 1.5s ease-in-out infinite;
}

/* Scroll-triggered animation utility */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered entrance for grid cards */
.update-card:nth-child(1) { transition-delay: 0s; }
.update-card:nth-child(2) { transition-delay: 0.1s; }
.update-card:nth-child(3) { transition-delay: 0.2s; }
.update-card:nth-child(4) { transition-delay: 0.3s; }
.update-card:nth-child(5) { transition-delay: 0.4s; }
.update-card:nth-child(6) { transition-delay: 0.5s; }

/* LIVE badge container glow */
@keyframes badge-glow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(204, 0, 0, 0.4);
  }
  50% {
    box-shadow: 0 0 20px rgba(204, 0, 0, 0.7);
  }
}

.live-badge {
  animation: badge-glow 2s ease-in-out infinite;
}

/* Subtle shimmer on breaking bar */
@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

.breaking-label {
  background: linear-gradient(90deg, #fff 40%, #ffe0e0 50%, #fff 60%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
  /* Fallback for non-supporting browsers */
  color: var(--accent-red);
}

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

  .ticker-content {
    animation: none;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}
