/* ===================================
   ANIMATIONS.CSS
   Additional animations for Phase 2 interactivity
   =================================== */

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* Slide Out to Left */
@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-30px);
  }
}

/* Slide Out to Right */
@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(30px);
  }
}

/* Pulse Animation (for loading brain) */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }
}

/* Scale In Animation (for scratch reveal badge) */
@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Bounce Animation */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

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

/* Glow Animation */
@keyframes glow {
  from {
    box-shadow: 0 0 5px rgba(0, 119, 181, 0.5);
  }
  to {
    box-shadow: 0 0 20px rgba(0, 119, 181, 0.8);
  }
}

/* Shimmer Animation (for scratch overlay) */
@keyframes shimmer {
  0% {
    background-position: -100% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Confetti Fall Animation */
@keyframes confettiFall {
  from {
    transform: translateY(-100%) rotate(0deg);
    opacity: 1;
  }
  to {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Progress Bar Fill Animation */
@keyframes progressFill {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

/* Fade Out Animation */
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

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

/* Wiggle Animation (for CTA button) */
@keyframes wiggle {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-3deg);
  }
  75% {
    transform: rotate(3deg);
  }
}

/* Heartbeat Animation */
@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  10%, 30% {
    transform: scale(1.05);
  }
  20%, 40% {
    transform: scale(1);
  }
}

/* Confetti Particle (Center Explosion) */
.confetti-particle {
  position: absolute;
  pointer-events: none;
  will-change: transform, opacity;
}

/* ===================================
   UTILITY CLASSES FOR ANIMATIONS
   =================================== */

.animate-fadeIn {
  animation: fadeIn 0.5s ease forwards;
}

.animate-slideInRight {
  animation: slideInRight 0.5s ease forwards;
}

.animate-slideInLeft {
  animation: slideInLeft 0.5s ease forwards;
}

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

.animate-bounce {
  animation: bounce 1s ease infinite;
}

.animate-glow {
  animation: glow 1.5s ease-in-out infinite alternate;
}

.animate-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}

/* ===================================
   TRANSITION UTILITIES
   =================================== */

.transition-all {
  transition: all 0.3s ease;
}

.transition-fast {
  transition: all 0.15s ease;
}

.transition-slow {
  transition: all 0.6s ease;
}

/* ===================================
   HOVER EFFECTS
   =================================== */

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

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

.hover-brighten:hover {
  filter: brightness(1.1);
}

/* ===================================
   INTERACTIVE ELEMENT STYLES
   =================================== */

/* Slider dragging state */
.ba-slider.dragging {
  cursor: grabbing;
}

.ba-slider.dragging .ba-handle {
  cursor: grabbing;
}

/* Scratch reveal animations */
.scratch-reveal {
  opacity: 1;
  transform: scale(1);
}

/* Step transitions */
.step {
  transition: opacity 0.3s ease;
}

.step.active {
  animation: fadeIn 0.3s ease;
}

/* Card hover and selection states */
.image-card,
.option-card {
  transform-origin: center;
  will-change: transform, box-shadow;
}

.image-card:active,
.option-card:active {
  transform: scale(0.98);
}

/* Button states */
.continue-button,
.btn-continue,
.cta-button {
  will-change: transform, box-shadow;
}

.continue-button:active,
.btn-continue:active,
.cta-button:active {
  transform: translateY(0) !important;
}
