/* ==========================================================================
   TOPTIFIED.COM - Micro-Interactions & Animations
   Version: 1.0.0
   ========================================================================== */

/* ==========================================================================
   1. Keyframe Animations
   ========================================================================== */

/* Pulse dot (live indicator) */
@keyframes pulse-dot {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 182, 122, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(0, 182, 122, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 182, 122, 0);
  }
}

/* Fade in with slight upward movement */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scale up (modal entrance) */
@keyframes scaleUp {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

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

/* Slide down */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Skeleton loading shimmer */
@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.shimmer {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%) !important;
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

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

/* Bounce subtle */
@keyframes bounceSubtle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

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

/* ==========================================================================
   2. Utility Animation Classes
   ========================================================================== */

.fade-in {
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-up {
  animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-down {
  animation: slideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.scale-up {
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.shake {
  animation: shake 0.5s ease-in-out;
}

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

/* Modal entrance */
.modal-container {
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Staggered card entrance */
.host-card {
  opacity: 0;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.host-card:nth-child(1) { animation-delay: 0s; }
.host-card:nth-child(2) { animation-delay: 0.05s; }
.host-card:nth-child(3) { animation-delay: 0.1s; }
.host-card:nth-child(4) { animation-delay: 0.15s; }
.host-card:nth-child(5) { animation-delay: 0.2s; }
.host-card:nth-child(6) { animation-delay: 0.25s; }
.host-card:nth-child(7) { animation-delay: 0.3s; }
.host-card:nth-child(8) { animation-delay: 0.35s; }
.host-card:nth-child(9) { animation-delay: 0.4s; }
.host-card:nth-child(10) { animation-delay: 0.45s; }

/* Coupon card staggered */
.coupon-card {
  opacity: 0;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.coupon-card:nth-child(1) { animation-delay: 0s; }
.coupon-card:nth-child(2) { animation-delay: 0.08s; }
.coupon-card:nth-child(3) { animation-delay: 0.16s; }
.coupon-card:nth-child(4) { animation-delay: 0.24s; }
.coupon-card:nth-child(5) { animation-delay: 0.32s; }

/* ==========================================================================
   3. Reduced Motion Preference
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .host-card,
  .coupon-card {
    opacity: 1;
  }
}
