/* ──────────────────────────────────────────────────────────────────
   Emissor de Recibos — Animations & Motion
   ────────────────────────────────────────────────────────────────── */

/* ── Keyframes ───────────────────────────────────────────────────── */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(var(--accent-500-rgb, 74,123,247), 0.3);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(var(--accent-500-rgb, 74,123,247), 0);
  }
}

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

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

/* ── Utility Classes ─────────────────────────────────────────────── */

.animate-fade-in {
  animation: fadeIn 0.2s ease-out both;
}

.animate-slide-up {
  animation: slideUp 0.25s ease-out both;
}

.animate-slide-down {
  animation: slideDown 0.25s ease-out both;
}

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

.animate-scale-in {
  animation: scaleIn 0.2s ease-out both;
}

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

/* Staggered entrance delays for lists */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
.stagger-6 { animation-delay: 300ms; }
.stagger-7 { animation-delay: 350ms; }
.stagger-8 { animation-delay: 400ms; }
.stagger-9 { animation-delay: 450ms; }
.stagger-10 { animation-delay: 500ms; }

/* ── Toast Animations ────────────────────────────────────────────── */

.toast-entering {
  animation: toastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.toast-exiting {
  animation: toastSlideOut 0.3s ease-in both;
}

/* ── Reduced Motion ──────────────────────────────────────────────── */

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

  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-down,
  .animate-shake,
  .animate-scale-in,
  .animate-pulse-glow,
  .toast-entering,
  .toast-exiting {
    animation: none !important;
  }
}