/* ============================================
   Animations & Transitions
   Keyframes, utility animation classes
   ============================================ */

/* ---- Keyframes ---- */

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@keyframes loadingBounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

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

@keyframes toastOut {
  from { opacity: 1; }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes typing {
  from { width: 0; }
  to   { width: 100%; }
}

/* ---- Utility Animation Classes ---- */

.fade-in {
  animation: fadeInUp 0.4s ease forwards;
}

.fade-in-fast {
  animation: fadeIn 0.2s ease forwards;
}

.slide-up {
  animation: fadeInUp 0.5s ease forwards;
}

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

/* Staggered children animation */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.35s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.00s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.10s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.20s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.30s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.35s; }

/* Shimmer loading skeleton */
.shimmer-bg {
  background: linear-gradient(
    90deg,
    var(--color-border-light) 25%,
    var(--color-border) 50%,
    var(--color-border-light) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Candy stripe accent (applied via ::after) */
.candy-stripe-accent {
  position: relative;
}

.candy-stripe-accent::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--color-candy-pink) 0px,
    var(--color-candy-pink) 8px,
    var(--color-candy-lavender) 8px,
    var(--color-candy-lavender) 16px,
    var(--color-candy-mint) 16px,
    var(--color-candy-mint) 24px,
    var(--color-candy-peach) 24px,
    var(--color-candy-peach) 32px
  );
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  opacity: 0.5;
}

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