/* ═══════════════════════════════════════════════════════════════
   Animations & Micro-interactions
   ═══════════════════════════════════════════════════════════════ */

/* ── Fade In Up ─────────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Fade In Down ───────────────────────────────────────────── */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Slide In Left ──────────────────────────────────────────── */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Slide In Right ─────────────────────────────────────────── */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Scale Up ───────────────────────────────────────────────── */
@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── Pulse ──────────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

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

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

/* ── 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(-15px);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

/* ── Typewriter ─────────────────────────────────────────────── */
@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  0%, 100% { border-color: transparent; }
  50% { border-color: var(--color-primary); }
}

/* ── Glow Pulse ─────────────────────────────────────────────── */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 5px rgba(37, 99, 235, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
  }
}

/* ── Rotate In ──────────────────────────────────────────────── */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-200deg);
  }
  to {
    opacity: 1;
    transform: rotate(0);
  }
}

/* ═══ Animation Utility Classes ═══════════════════════════════ */

.anim-fade-in-up {
  opacity: 0;
  transform: translateY(30px);
}

.anim-fade-in-up.visible {
  animation: fadeInUp 0.6s ease forwards;
}

.anim-fade-in-down {
  opacity: 0;
  transform: translateY(-20px);
}

.anim-fade-in-down.visible {
  animation: fadeInDown 0.6s ease forwards;
}

.anim-slide-in-left {
  opacity: 0;
  transform: translateX(-40px);
}

.anim-slide-in-left.visible {
  animation: slideInLeft 0.6s ease forwards;
}

.anim-slide-in-right {
  opacity: 0;
  transform: translateX(40px);
}

.anim-slide-in-right.visible {
  animation: slideInRight 0.6s ease forwards;
}

.anim-scale-up {
  opacity: 0;
  transform: scale(0.9);
}

.anim-scale-up.visible {
  animation: scaleUp 0.5s ease forwards;
}

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

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

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

.anim-bounce {
  animation: bounce 1s infinite;
}

.anim-glow {
  animation: glowPulse 2s ease-in-out infinite;
}

/* ── Stagger delays ─────────────────────────────────────────── */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

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

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

.hover-scale {
  transition: transform var(--transition-base);
}

.hover-scale:hover {
  transform: scale(1.03);
}

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

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

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