/* ============================================================
   LEDGERGUARD UK — Animations
   Scroll reveals, keyframes, hover effects, a11y overrides
   ============================================================ */

/* ----------------------------------------------------------
   1. Scroll Reveal
   ---------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ----------------------------------------------------------
   2. Counter Animation (tabular numbers)
   ---------------------------------------------------------- */
.count-up {
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------
   3. Pulse (status indicators)
   ---------------------------------------------------------- */
@keyframes pulse {
  0%   { opacity: 1; }
  50%  { opacity: 0.5; }
  100% { opacity: 1; }
}

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

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

.float {
  animation: float 3s ease-in-out infinite;
}

/* ----------------------------------------------------------
   5. Console Cursor Blink
   ---------------------------------------------------------- */
@keyframes blink {
  0%, 50%  { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.cursor-blink {
  animation: blink 1s step-end infinite;
}

/* ----------------------------------------------------------
   6. Gradient Text Shift
   ---------------------------------------------------------- */
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-text-animated {
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
}

/* ----------------------------------------------------------
   7. Fade In Up (page load)
   ---------------------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.fade-in-up-delay-1 { animation-delay: 0.1s; }
.fade-in-up-delay-2 { animation-delay: 0.2s; }
.fade-in-up-delay-3 { animation-delay: 0.3s; }

/* ----------------------------------------------------------
   8. Hover Lift
   ---------------------------------------------------------- */
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ----------------------------------------------------------
   9. Progress Bar Fill
   ---------------------------------------------------------- */
@keyframes fillProgress {
  from { width: 0%; }
  to   { width: var(--progress, 100%); }
}

.progress-fill {
  animation: fillProgress 1.2s ease forwards;
}

/* ----------------------------------------------------------
   10. Shimmer / Loading Skeleton
   ---------------------------------------------------------- */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(30, 41, 75, 0.3) 25%,
    rgba(30, 41, 75, 0.6) 50%,
    rgba(30, 41, 75, 0.3) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

/* ----------------------------------------------------------
   11. Scale In (modals, tooltips)
   ---------------------------------------------------------- */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scale-in {
  animation: scaleIn 0.25s ease forwards;
}

/* ----------------------------------------------------------
   12. 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;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .fade-in-up {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .float {
    animation: none;
  }

  .pulse {
    animation: none;
  }

  .hover-lift:hover {
    transform: none;
  }
}
