/* ============================================================
   ALP Animations — animations.css
   Keyframes, utility classes, effects & motion system
   ============================================================ */

/* ── Fade Keyframes ───────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

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

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

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

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

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

/* ── Slide Keyframes ──────────────────────────────────────── */
@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@keyframes slideInUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@keyframes slideInDown {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

@keyframes slideOutRight {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}

/* ── Scale Keyframes ──────────────────────────────────────── */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.92);
  }
}

/* ── Modal Keyframes ──────────────────────────────────────── */
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
}

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

/* ── Pulse Keyframes ──────────────────────────────────────── */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

@keyframes pulseRing {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

@keyframes pulseDot {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
}

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

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

/* ── Bounce ───────────────────────────────────────────────── */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(-6px);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── Shake ────────────────────────────────────────────────── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* ── Count Up (for stat numbers) ──────────────────────────── */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Ripple ───────────────────────────────────────────────── */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 0.5;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* ── Glow Pulse ───────────────────────────────────────────── */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5), 0 0 40px rgba(99, 102, 241, 0.15);
  }
}

@keyframes glowPulseSuccess {
  0%, 100% {
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5), 0 0 40px rgba(16, 185, 129, 0.15);
  }
}

/* ── Toast slide ──────────────────────────────────────────── */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

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

/* ── Progress bar stripe ──────────────────────────────────── */
@keyframes progressStripe {
  0%   { background-position: 1rem 0; }
  100% { background-position: 0 0; }
}

@keyframes progressIndeterminate {
  0%   { left: -35%; width: 35%; }
  60%  { left: 100%; width: 35%; }
  100% { left: 100%; width: 35%; }
}

/* ── Typing dot bounce ────────────────────────────────────── */
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}


/* ============================================================
   Utility Classes
   ============================================================ */

.animate-fadeIn       { animation: fadeIn      var(--duration-normal) var(--ease-out) both; }
.animate-fadeInUp     { animation: fadeInUp    var(--duration-slow) var(--ease-out) both; }
.animate-fadeInDown   { animation: fadeInDown  var(--duration-slow) var(--ease-out) both; }
.animate-fadeInLeft   { animation: fadeInLeft  var(--duration-slow) var(--ease-out) both; }
.animate-fadeInRight  { animation: fadeInRight var(--duration-slow) var(--ease-out) both; }
.animate-fadeOut      { animation: fadeOut     var(--duration-normal) var(--ease-out) both; }

.animate-scaleIn      { animation: scaleIn  var(--duration-slow) var(--ease-spring) both; }
.animate-scaleOut     { animation: scaleOut var(--duration-normal) var(--ease-out) both; }

.animate-slideInLeft  { animation: slideInLeft  var(--duration-slow) var(--ease-out) both; }
.animate-slideInRight { animation: slideInRight var(--duration-slow) var(--ease-out) both; }
.animate-slideInUp    { animation: slideInUp    var(--duration-slow) var(--ease-out) both; }
.animate-slideInDown  { animation: slideInDown  var(--duration-slow) var(--ease-out) both; }

.animate-bounce       { animation: bounce 1s infinite; }
.animate-bounceIn     { animation: bounceIn var(--duration-slower) var(--ease-out) both; }
.animate-shake        { animation: shake 0.5s ease both; }
.animate-spin         { animation: spin 1s linear infinite; }
.animate-pulse        { animation: pulse 2s ease-in-out infinite; }

.animate-countUp      { animation: countUp var(--duration-slow) var(--ease-out) both; }

.animate-modalIn      { animation: modalIn var(--duration-slow) var(--ease-spring) both; }
.animate-modalOut     { animation: modalOut var(--duration-normal) var(--ease-out) both; }

/* ── Stagger Delays ───────────────────────────────────────── */
.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; }

/* ── Page Transition ──────────────────────────────────────── */
.page-transition-enter {
  animation: fadeInUp var(--duration-slow) var(--ease-out) both;
}

.page-transition-exit {
  animation: fadeOut var(--duration-fast) var(--ease-out) both;
}

/* ── Card Hover Lift ──────────────────────────────────────── */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

/* ── Button Press Effect ──────────────────────────────────── */
.press-effect {
  transition: transform var(--transition-fast);
}

.press-effect:active {
  transform: scale(0.97);
}

/* ── Ripple Effect ────────────────────────────────────────── */
.ripple-container {
  position: relative;
  overflow: hidden;
}

.ripple-container .ripple {
  position: absolute;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.15);
  pointer-events: none;
  animation: ripple 0.6s linear forwards;
}

/* ── Glow Effects ─────────────────────────────────────────── */
.glow {
  animation: glowPulse 2s ease-in-out infinite;
}

.glow-success {
  animation: glowPulseSuccess 2s ease-in-out infinite;
}

.glow-static {
  box-shadow: var(--shadow-glow);
}

/* ── Hover Glow Border ────────────────────────────────────── */
.hover-glow {
  position: relative;
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* ── Shimmer Loading ──────────────────────────────────────── */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-hover) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

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

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

/* ── Rotate in ────────────────────────────────────────────── */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

.animate-rotateIn {
  animation: rotateIn var(--duration-slow) var(--ease-spring) 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;
    scroll-behavior: auto !important;
  }

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

  .press-effect:active {
    transform: none;
  }
}
