/* ===================================
   Animations
   =================================== */

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

.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Slide Up Animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slideUp 0.5s ease-out;
}

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

.animate-scale-in {
  animation: scaleIn 0.3s ease-out;
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Float Animation (for background elements) */
@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  33% {
    transform: translateY(-20px) translateX(10px);
  }
  66% {
    transform: translateY(-10px) translateX(-10px);
  }
}

.animate-float {
  animation: float 20s ease-in-out infinite;
}

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

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

/* Toast Slide In */
@keyframes toastSlideIn {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

.toast-show {
  animation: toastSlideIn 0.3s ease-out forwards;
}

.toast-hide {
  animation: toastSlideOut 0.3s ease-in forwards;
}

/* Stagger Animation for Word Cards */
.word-card {
  animation: scaleIn 0.3s ease-out;
  animation-fill-mode: both;
}

.word-card:nth-child(1) { animation-delay: 0.05s; }
.word-card:nth-child(2) { animation-delay: 0.1s; }
.word-card:nth-child(3) { animation-delay: 0.15s; }
.word-card:nth-child(4) { animation-delay: 0.2s; }
.word-card:nth-child(5) { animation-delay: 0.25s; }
.word-card:nth-child(6) { animation-delay: 0.3s; }
.word-card:nth-child(7) { animation-delay: 0.05s; }
.word-card:nth-child(8) { animation-delay: 0.1s; }
.word-card:nth-child(9) { animation-delay: 0.15s; }
.word-card:nth-child(10) { animation-delay: 0.2s; }
.word-card:nth-child(11) { animation-delay: 0.25s; }
.word-card:nth-child(12) { animation-delay: 0.3s; }
.word-card:nth-child(13) { animation-delay: 0.05s; }
.word-card:nth-child(14) { animation-delay: 0.1s; }
.word-card:nth-child(15) { animation-delay: 0.15s; }
.word-card:nth-child(16) { animation-delay: 0.2s; }
.word-card:nth-child(17) { animation-delay: 0.25s; }
.word-card:nth-child(18) { animation-delay: 0.3s; }
.word-card:nth-child(19) { animation-delay: 0.05s; }
.word-card:nth-child(20) { animation-delay: 0.1s; }

/* Hover Effects */
button:not(:disabled):hover {
  transform: translateY(-1px);
}

button:not(:disabled):active {
  transform: translateY(0);
}

/* Transition Utilities */
.transition-all {
  transition: all 0.2s ease;
}

.transition-colors {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.transition-transform {
  transition: transform 0.2s ease;
}

/* Loading Spinner */
@keyframes spinFast {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.loading-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spinFast 0.6s linear infinite;
}

/* Shimmer Effect (for loading states) */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

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

/* Gradient Animation */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

/* Success Animation */
@keyframes checkmark {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.checkmark-animation {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: checkmark 0.3s ease-out forwards;
}

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

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

/* 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;
  }
}
