/* ===== ANR KIDS WORLD — animations.css ===== */

/* ===========================
   KEYFRAME DEFINITIONS
   =========================== */

/* Float — gentle levitation with slight rotation */
@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-10px) rotate(2deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
  75% {
    transform: translateY(-8px) rotate(-2deg);
  }
}

/* Float Slow — larger, slower movement */
@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0px) rotate(0deg) scale(1);
  }
  33% {
    transform: translateY(-30px) rotate(6deg) scale(1.02);
  }
  66% {
    transform: translateY(-15px) rotate(-4deg) scale(0.98);
  }
}

/* Float Reverse — drifts the opposite direction */
@keyframes floatReverse {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(20px) rotate(-5deg);
  }
}

/* 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(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Left (slides from right to left) */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Right (slides from left to right) */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In (simple opacity) */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Scale In Bounce */
@keyframes scaleInBounce {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  70% {
    transform: scale(1.08);
  }
  85% {
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Pulse — gentle opacity / scale throb */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
}

/* Pulse Glow — box-shadow pulse */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.4);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(255, 107, 53, 0);
  }
}

/* Pulse Glow Teal */
@keyframes pulseGlowTeal {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(78, 205, 196, 0.4);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(78, 205, 196, 0);
  }
}

/* Shimmer — horizontal shine sweep for skeleton loaders */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Spin — full 360° rotation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

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

/* Bounce — vertical bounce */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
  }
  40% {
    transform: translateY(-20px);
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
  }
  60% {
    transform: translateY(-10px);
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
  }
  80% {
    transform: translateY(-4px);
  }
}

/* Gradient Shift — animates background-position for moving gradient */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Gradient Pan — horizontal pan */
@keyframes gradientPan {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 300% 0%;
  }
}

/* Glow — box-shadow pulsing in orange */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.3),
                0 0 20px rgba(255, 107, 53, 0.2);
  }
  50% {
    box-shadow: 0 0 25px rgba(255, 107, 53, 0.6),
                0 0 50px rgba(255, 107, 53, 0.35),
                0 0 80px rgba(255, 107, 53, 0.15);
  }
}

/* Glow Teal */
@keyframes glowTeal {
  0%, 100% {
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.3),
                0 0 20px rgba(78, 205, 196, 0.2);
  }
  50% {
    box-shadow: 0 0 25px rgba(78, 205, 196, 0.6),
                0 0 50px rgba(78, 205, 196, 0.35);
  }
}

/* Slide Down — for mobile menu open */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide Up — for closing */
@keyframes slideUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Slide In Right — panel/drawer */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide In Left — panel/drawer */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Typing — typewriter width expand */
@keyframes typing {
  from {
    width: 0;
    opacity: 1;
  }
  to {
    width: 100%;
    opacity: 1;
  }
}

/* Blink Cursor — for typewriter effect */
@keyframes blinkCursor {
  0%, 100% { border-right-color: var(--primary); }
  50%       { border-right-color: transparent; }
}

/* Hero Glow — slow radial glow position shift */
@keyframes heroGlow {
  0% {
    background-position: 0% 50%;
    opacity: 0.8;
  }
  50% {
    background-position: 100% 50%;
    opacity: 1;
  }
  100% {
    background-position: 0% 50%;
    opacity: 0.8;
  }
}

/* Number Count — subtle scale pop for counter elements */
@keyframes numberCount {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(20px);
  }
  60% {
    transform: scale(1.15) translateY(-4px);
  }
  80% {
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Wiggle — playful attention-grabber */
@keyframes wiggle {
  0%, 100% { transform: rotate(-3deg); }
  25%       { transform: rotate(3deg); }
  50%       { transform: rotate(-2deg); }
  75%       { transform: rotate(2deg); }
}

/* Shake — error feedback */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-8px); }
  40%       { transform: translateX(8px); }
  60%       { transform: translateX(-6px); }
  80%       { transform: translateX(6px); }
}

/* Pop — scale up & back */
@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Morph — border-radius morphing */
@keyframes morph {
  0%, 100% { border-radius: 40% 60% 70% 30% / 40% 40% 60% 50%; }
  25%       { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
  50%       { border-radius: 30% 70% 30% 70% / 50% 60% 40% 50%; }
  75%       { border-radius: 60% 40% 60% 40% / 60% 30% 60% 40%; }
}

/* Fade Scale — modal open */
@keyframes fadeScale {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Ripple — button click ripple */
@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ===========================
   ANIMATION UTILITY CLASSES
   =========================== */

/* Core animation classes */
.animate-float        { animation: float 6s ease-in-out infinite; }
.animate-float-slow   { animation: floatSlow 9s ease-in-out infinite; }
.animate-float-reverse { animation: floatReverse 7s ease-in-out infinite; }
.animate-pulse        { animation: pulse 2s ease-in-out infinite; }
.animate-pulse-glow   { animation: pulseGlow 2s ease-in-out infinite; }
.animate-spin         { animation: spin 1s linear infinite; }
.animate-spin-slow    { animation: spin 3s linear infinite; }
.animate-bounce       { animation: bounce 1s ease infinite; }
.animate-wiggle       { animation: wiggle 0.5s ease-in-out; }
.animate-shake        { animation: shake 0.4s ease-in-out; }
.animate-glow         { animation: glow 2.5s ease-in-out infinite; }
.animate-glow-teal    { animation: glowTeal 2.5s ease-in-out infinite; }
.animate-gradient     {
  background-size: 300% 300%;
  animation: gradientShift 5s ease infinite;
}

/* Entrance animations (use with animation-fill-mode: both) */
.animate-fade-up      { animation: fadeInUp 0.8s ease both; }
.animate-fade-down    { animation: fadeInDown 0.8s ease both; }
.animate-fade-left    { animation: fadeInLeft 0.8s ease both; }
.animate-fade-right   { animation: fadeInRight 0.8s ease both; }
.animate-fade-in      { animation: fadeIn 0.6s ease both; }
.animate-scale-in     { animation: scaleIn 0.5s ease both; }
.animate-scale-bounce { animation: scaleInBounce 0.6s ease both; }
.animate-number-count { animation: numberCount 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) both; }
.animate-slide-down   { animation: slideDown 0.25s ease both; }
.animate-fade-scale   { animation: fadeScale 0.35s ease both; }

/* ===========================
   ANIMATION DELAYS
   =========================== */
.delay-50    { animation-delay: 50ms; }
.delay-100   { animation-delay: 100ms; }
.delay-150   { animation-delay: 150ms; }
.delay-200   { animation-delay: 200ms; }
.delay-250   { animation-delay: 250ms; }
.delay-300   { animation-delay: 300ms; }
.delay-350   { animation-delay: 350ms; }
.delay-400   { animation-delay: 400ms; }
.delay-500   { animation-delay: 500ms; }
.delay-600   { animation-delay: 600ms; }
.delay-700   { animation-delay: 700ms; }
.delay-800   { animation-delay: 800ms; }
.delay-1000  { animation-delay: 1000ms; }
.delay-1200  { animation-delay: 1200ms; }
.delay-1500  { animation-delay: 1500ms; }

/* ===========================
   ANIMATION DURATIONS
   =========================== */
.duration-200   { animation-duration: 200ms; }
.duration-300   { animation-duration: 300ms; }
.duration-400   { animation-duration: 400ms; }
.duration-500   { animation-duration: 500ms; }
.duration-600   { animation-duration: 600ms; }
.duration-700   { animation-duration: 700ms; }
.duration-800   { animation-duration: 800ms; }
.duration-1000  { animation-duration: 1000ms; }
.duration-1500  { animation-duration: 1500ms; }
.duration-2000  { animation-duration: 2000ms; }

/* ===========================
   ANIMATION EASING
   =========================== */
.ease-linear  { animation-timing-function: linear; }
.ease-in      { animation-timing-function: ease-in; }
.ease-out     { animation-timing-function: ease-out; }
.ease-in-out  { animation-timing-function: ease-in-out; }
.ease-bounce  { animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.ease-spring  { animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ===========================
   FILL MODE UTILITIES
   =========================== */
.fill-both      { animation-fill-mode: both; }
.fill-forwards  { animation-fill-mode: forwards; }
.fill-backwards { animation-fill-mode: backwards; }
.fill-none      { animation-fill-mode: none; }

/* ===========================
   PLAY STATE UTILITIES
   =========================== */
.paused  { animation-play-state: paused; }
.running { animation-play-state: running; }

/* Hover-triggered animations */
.hover-float:hover    { animation: float 3s ease-in-out infinite; }
.hover-pulse:hover    { animation: pulse 1s ease-in-out infinite; }
.hover-wiggle:hover   { animation: wiggle 0.4s ease-in-out; }
.hover-bounce:hover   { animation: bounce 0.6s ease; }
.hover-glow:hover     { animation: glow 1.5s ease-in-out infinite; }

/* ===========================
   SPECIFIC COMPONENT ANIMATIONS
   =========================== */

/* Animated gradient heading */
.animated-gradient-text {
  background: linear-gradient(270deg, #FF6B35, #FFE66D, #4ECDC4, #A855F7, #EC4899, #FF6B35);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientPan 6s linear infinite;
}

/* Morphing blob background */
.animate-morph {
  animation: morph 8s ease-in-out infinite;
}

/* Typewriter line */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--primary);
  width: 0;
  animation:
    typing 3s steps(40, end) forwards,
    blinkCursor 0.75s step-end infinite;
}

/* Shimmer skeleton */
.shimmer-effect {
  background: linear-gradient(
    90deg,
    var(--dark-card) 25%,
    var(--dark-light) 50%,
    var(--dark-card) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* Hero glow layer */
.hero-animated-glow {
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(255, 107, 53, 0.15) 0%,
    rgba(78, 205, 196, 0.1) 40%,
    transparent 70%
  );
  background-size: 200% 200%;
  animation: heroGlow 8s ease infinite;
}

/* Ripple on buttons */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple .ripple-circle {
  position: absolute;
  border-radius: 50%;
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* Staggered grid reveal delays */
.stagger-1  { animation-delay: 0.05s; }
.stagger-2  { animation-delay: 0.10s; }
.stagger-3  { animation-delay: 0.15s; }
.stagger-4  { animation-delay: 0.20s; }
.stagger-5  { animation-delay: 0.25s; }
.stagger-6  { animation-delay: 0.30s; }
.stagger-7  { animation-delay: 0.35s; }
.stagger-8  { animation-delay: 0.40s; }

/* Number pop for stats */
.stat-number-pop {
  display: inline-block;
  animation: numberCount 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* Category card icon pop */
.category-card:hover .category-icon {
  animation: pop 0.4s ease;
}

/* Social card icon wiggle */
.social-card:hover .social-card-icon {
  animation: wiggle 0.5s ease-in-out;
}

/* Notification / badge blink */
.badge-live {
  animation: pulse 1.2s ease-in-out infinite;
  background: var(--primary);
  color: white;
}

/* Loader spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

/* Page transition */
.page-enter {
  animation: fadeInUp 0.5s ease both;
}

/* Scroll progress bar shimmer */
.reading-progress::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 1.2s ease-in-out infinite;
}

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

.animate-spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}

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

  .animate-float,
  .animate-float-slow,
  .animate-float-reverse,
  .floating-element,
  .animate-spin {
    animation: none !important;
  }
}

