/* Animations - Celebrations, hints, and transitions */

/* Celebration animation for correct answers */
@keyframes celebrate {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.1) rotate(-3deg);
  }
  50% {
    transform: scale(1.15) rotate(3deg);
  }
  75% {
    transform: scale(1.1) rotate(-2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.celebrate {
  animation: celebrate 0.6s ease;
}

/* Star burst effect */
@keyframes starBurst {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: scale(1.2) rotate(180deg);
    opacity: 0.8;
  }
  100% {
    transform: scale(0) rotate(360deg);
    opacity: 0;
  }
}

.star-burst {
  position: absolute;
  width: 50px;
  height: 50px;
  pointer-events: none;
}

.star-burst::before {
  content: '\2605'; /* Star character */
  position: absolute;
  font-size: 40px;
  color: var(--color-secondary);
  animation: starBurst 0.8s ease forwards;
}

/* Confetti particle */
@keyframes confettiFall {
  0% {
    transform: translateY(-100%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti {
  position: fixed;
  top: 0;
  width: 10px;
  height: 10px;
  pointer-events: none;
  animation: confettiFall 2s ease-out forwards;
}

/* Hint glow animation */
@keyframes hintGlow {
  0%, 100% {
    box-shadow: 0 0 10px var(--color-success);
  }
  50% {
    box-shadow: 0 0 25px var(--color-success), 0 0 35px var(--color-success);
  }
}

.hint-glow {
  animation: hintGlow 1.5s ease-in-out infinite;
}

/* Pulse animation for points */
@keyframes pointsPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.8;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.points-earned {
  position: absolute;
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-secondary);
  pointer-events: none;
  animation: pointsPulse 0.8s ease-out forwards;
}

/* Shake animation for wrong answers */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-10px);
  }
  40% {
    transform: translateX(10px);
  }
  60% {
    transform: translateX(-10px);
  }
  80% {
    transform: translateX(10px);
  }
}

.shake {
  animation: shake 0.4s ease;
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn var(--transition-normal) ease;
}

/* Slide up animation */
@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-up {
  animation: slideUp var(--transition-normal) ease;
}

/* Bounce animation */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.bounce {
  animation: bounce 0.5s ease;
}

/* World unlock celebration */
@keyframes worldUnlock {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.world-unlock-animation {
  animation: worldUnlock 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Progress bar fill animation */
@keyframes progressFill {
  from {
    transform: scaleX(var(--progress-from, 0));
  }
  to {
    transform: scaleX(var(--progress-to, 0));
  }
}

.progress-animate {
  animation: progressFill 0.5s ease forwards;
  transform-origin: left;
}

/* Reduced motion - disable all animations */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
