/* ==========================================================================
   animations.css — Reusable @keyframes for the game UI
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Slide In / Out (panels, toasts)
   --------------------------------------------------------------------------- */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

/* ---------------------------------------------------------------------------
   Fade In / Out
   --------------------------------------------------------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

/* ---------------------------------------------------------------------------
   Float Up (cash feedback — drifts up and fades)
   --------------------------------------------------------------------------- */
@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-60px);
  }
}

/* ---------------------------------------------------------------------------
   Pulse (pulsing status dot)
   --------------------------------------------------------------------------- */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.15);
  }
}

/* ---------------------------------------------------------------------------
   Shimmer (edge shimmer / loading effect)
   --------------------------------------------------------------------------- */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ---------------------------------------------------------------------------
   Bounce (bouncy attention-grab)
   --------------------------------------------------------------------------- */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-6px);
  }
  50% {
    transform: translateY(0);
  }
  75% {
    transform: translateY(-3px);
  }
}

/* ---------------------------------------------------------------------------
   Number Flash (brief background highlight on value change)
   --------------------------------------------------------------------------- */
@keyframes numberFlash {
  0% {
    background: rgba(255, 255, 255, 0.15);
  }
  100% {
    background: transparent;
  }
}

/* ---------------------------------------------------------------------------
   Utility classes for applying animations
   --------------------------------------------------------------------------- */
.animate-slide-in-right {
  animation: slideInRight var(--transition-normal) ease forwards;
}

.animate-slide-out-right {
  animation: slideOutRight var(--transition-fast) ease forwards;
}

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

.animate-fade-out {
  animation: fadeOut var(--transition-fast) ease forwards;
}

.animate-scale-in {
  animation: scaleIn var(--transition-normal) ease forwards;
}

.animate-float-up {
  animation: floatUp 1.4s ease-out forwards;
}

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

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

.animate-bounce {
  animation: bounce 0.6s ease;
}

.animate-number-flash {
  animation: numberFlash 0.6s ease;
}
