/* ============================================================
   DisasterShield NE — Animations & Motion System
   ============================================================ */

/* ── Entry Animations ───────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Continuous Animations ──────────────────────────────────── */

/* Radar Sweep */
@keyframes radar-sweep {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Pulse Ring */
@keyframes pulse-ring {
  0%   { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* Alert Flash */
@keyframes alert-flash {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Float */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-6px); }
}

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

/* Spin slow */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Blink */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Data flow */
@keyframes data-flow {
  0%   { stroke-dashoffset: 1000; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/* Ticker scroll */
@keyframes ticker-scroll {
  0%   { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Wave */
@keyframes wave {
  0%, 100% { transform: scaleY(0.5); }
  50%       { transform: scaleY(1); }
}

/* Glow pulse */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 5px rgba(0,212,255,0.3), 0 0 10px rgba(0,212,255,0.1); }
  50%       { box-shadow: 0 0 20px rgba(0,212,255,0.6), 0 0 40px rgba(0,212,255,0.2); }
}

@keyframes glow-pulse-red {
  0%, 100% { box-shadow: 0 0 5px rgba(220,20,60,0.3), 0 0 10px rgba(220,20,60,0.1); }
  50%       { box-shadow: 0 0 20px rgba(220,20,60,0.6), 0 0 40px rgba(220,20,60,0.2); }
}

@keyframes glow-pulse-amber {
  0%, 100% { box-shadow: 0 0 5px rgba(255,140,0,0.3), 0 0 10px rgba(255,140,0,0.1); }
  50%       { box-shadow: 0 0 20px rgba(255,140,0,0.6), 0 0 40px rgba(255,140,0,0.2); }
}

/* Number counter */
@keyframes count-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Slide in panel */
@keyframes slide-in-panel {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* ── Animation Utilities ────────────────────────────────────── */
.anim-fade-in      { animation: fadeIn 0.4s ease forwards; }
.anim-fade-in-up   { animation: fadeInUp 0.5s ease forwards; }
.anim-fade-in-down { animation: fadeInDown 0.5s ease forwards; }
.anim-scale-in     { animation: scaleIn 0.4s ease forwards; }
.anim-float        { animation: float 4s ease-in-out infinite; }
.anim-spin         { animation: spin 1s linear infinite; }
.anim-spin-slow    { animation: spin-slow 8s linear infinite; }
.anim-blink        { animation: blink 1.2s step-start infinite; }
.anim-glow-cyan    { animation: glow-pulse 2s ease-in-out infinite; }
.anim-glow-red     { animation: glow-pulse-red 1.5s ease-in-out infinite; }
.anim-glow-amber   { animation: glow-pulse-amber 2s ease-in-out infinite; }

/* Delay utilities */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }

/* ── Alert Pulse Effect ──────────────────────────────────────── */
.alert-pulse-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.alert-pulse-wrapper::before,
.alert-pulse-wrapper::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: pulse-ring 2s ease-out infinite;
}

.alert-pulse-wrapper::after {
  animation-delay: 1s;
}

.alert-pulse-critical::before,
.alert-pulse-critical::after {
  background: rgba(220, 20, 60, 0.4);
}

.alert-pulse-warning::before,
.alert-pulse-warning::after {
  background: rgba(255, 140, 0, 0.3);
}

/* ── Radar Widget ───────────────────────────────────────────── */
.radar-container {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-rings {
  position: absolute;
  width: 100%;
  height: 100%;
}

.radar-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 255, 0.15);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.radar-ring:nth-child(1) { width: 30%;  height: 30%; }
.radar-ring:nth-child(2) { width: 55%;  height: 55%; }
.radar-ring:nth-child(3) { width: 80%;  height: 80%; }
.radar-ring:nth-child(4) { width: 100%; height: 100%; }

.radar-sweep-line {
  position: absolute;
  width: 50%;
  height: 2px;
  top: 50%;
  left: 50%;
  transform-origin: 0% 50%;
  background: linear-gradient(90deg, rgba(0,212,255,0.8), transparent);
  animation: radar-sweep 3s linear infinite;
  border-radius: 2px;
}

.radar-sweep-trail {
  position: absolute;
  width: 50%;
  height: 100%;
  top: 0;
  left: 50%;
  background: conic-gradient(from 0deg, rgba(0,212,255,0.15) 0deg, transparent 120deg);
  transform-origin: 0% 50%;
  animation: radar-sweep 3s linear infinite;
  border-radius: 0 50% 50% 0;
}

.radar-center {
  width: 8px;
  height: 8px;
  background: var(--cyan-300);
  border-radius: 50%;
  z-index: 10;
  box-shadow: 0 0 10px var(--cyan-300);
  animation: glow-pulse 2s ease-in-out infinite;
}

/* ── Data Flow Lines ─────────────────────────────────────────── */
.data-stream {
  display: flex;
  align-items: center;
  gap: 4px;
}

.data-stream-bar {
  width: 3px;
  border-radius: 2px;
  background: var(--cyan-300);
  opacity: 0.6;
}

.data-stream-bar:nth-child(1) { height: 8px;  animation: wave 1.2s ease-in-out infinite 0.0s; }
.data-stream-bar:nth-child(2) { height: 14px; animation: wave 1.2s ease-in-out infinite 0.1s; }
.data-stream-bar:nth-child(3) { height: 20px; animation: wave 1.2s ease-in-out infinite 0.2s; }
.data-stream-bar:nth-child(4) { height: 14px; animation: wave 1.2s ease-in-out infinite 0.3s; }
.data-stream-bar:nth-child(5) { height: 8px;  animation: wave 1.2s ease-in-out infinite 0.4s; }

/* ── News Ticker ────────────────────────────────────────────── */
.ticker-wrap {
  overflow: hidden;
  white-space: nowrap;
}

.ticker-content {
  display: inline-block;
  animation: ticker-scroll 30s linear infinite;
}

.ticker-content:hover {
  animation-play-state: paused;
}

/* ── Page Transition ────────────────────────────────────────── */
.page-enter {
  animation: fadeInUp 0.4s ease forwards;
}

/* ── Card Hover Lift ─────────────────────────────────────────── */
.hover-lift {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 20px rgba(0,212,255,0.08);
}

/* ── Severity Indicator ─────────────────────────────────────── */
.severity-bar {
  height: 4px;
  border-radius: 4px;
  width: 100%;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
  position: relative;
}

.severity-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.severity-fill.level-1 { background: var(--green-400);  width: 20%; }
.severity-fill.level-2 { background: var(--green-300);  width: 40%; }
.severity-fill.level-3 { background: var(--amber-300);  width: 60%; }
.severity-fill.level-4 { background: var(--amber-400);  width: 80%; }
.severity-fill.level-5 { background: var(--red-300);    width: 100%; animation: glow-pulse-red 1s infinite; }

/* ── Gradient Text ──────────────────────────────────────────── */
.gradient-text-cyan {
  background: linear-gradient(135deg, var(--cyan-200), var(--cyan-300), var(--cyan-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-warning {
  background: linear-gradient(135deg, #ffd166, #ff8c00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-danger {
  background: linear-gradient(135deg, #ff6b6b, #dc143c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Notification Badge ─────────────────────────────────────── */
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  background: var(--red-400);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-display);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-void);
  animation: glow-pulse-red 2s ease-in-out infinite;
}

/* ── Waveform ───────────────────────────────────────────────── */
.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 32px;
}

.waveform-bar {
  width: 4px;
  border-radius: 2px;
  background: var(--cyan-300);
  opacity: 0.7;
}

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