/* ═══════════════════════════════════════════════════════════
   Effects — Animations, Grid BG, Scanlines, Glow
   ═══════════════════════════════════════════════════════════ */

/* ── Grid Background ─────────────────────────────────────── */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 222, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 222, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

/* ── Scanline Effect (on panels) ─────────────────────────── */

.scanline::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  border-radius: inherit;
}

/* ── Glow Border ─────────────────────────────────────────── */

.glow-border {
  box-shadow: 0 0 0 1px var(--border-glow), var(--shadow-md);
}

/* ── Fade In Animation ───────────────────────────────────── */

.fade-in {
  animation: fadeIn var(--dur-slow) var(--ease-out) forwards;
  opacity: 0;
}

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

/* ── Stagger Children ────────────────────────────────────── */

.stagger > * {
  animation: fadeIn var(--dur-slow) var(--ease-out) forwards;
  opacity: 0;
}

.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 40ms; }
.stagger > *:nth-child(3) { animation-delay: 80ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; }
.stagger > *:nth-child(6) { animation-delay: 200ms; }
.stagger > *:nth-child(7) { animation-delay: 240ms; }
.stagger > *:nth-child(8) { animation-delay: 280ms; }
.stagger > *:nth-child(9) { animation-delay: 320ms; }
.stagger > *:nth-child(10) { animation-delay: 360ms; }
.stagger > *:nth-child(n+11) { animation-delay: 400ms; }

/* ── Slide In ────────────────────────────────────────────── */

.slide-in-right {
  animation: slideInRight var(--dur-slow) var(--ease-out) forwards;
}

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

/* ── Spin ────────────────────────────────────────────────── */

.spin {
  animation: spin 1s linear infinite;
}

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

/* ── Loading Skeleton ────────────────────────────────────── */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-2) 25%,
    var(--bg-3) 50%,
    var(--bg-2) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s ease-in-out infinite;
  border-radius: var(--r-sm);
}

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

/* ── Notification Shake ──────────────────────────────────── */

.shake {
  animation: shake 0.4s ease-in-out;
}

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

/* ── Gradient Text ───────────────────────────────────────── */

.gradient-text {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Hover Lift ──────────────────────────────────────────── */

.hover-lift {
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ── Progress Bar ────────────────────────────────────────── */

.progress-bar {
  height: 3px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  border-radius: 2px;
  transition: width var(--dur-slow) var(--ease-out);
}
