/* swift-animations.css — subtle interactive animations across Swift */

/* ── Keyframes ─────────────────────────────────────── */
@keyframes swiftFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes swiftPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.07); }
  100% { transform: scale(1); }
}
@keyframes swiftPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,69,0,0); }
  50%       { box-shadow: 0 0 0 8px rgba(255,69,0,0.12); }
}
@keyframes swiftShimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes swiftCountPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}
@keyframes swiftBounce {
  0%, 100% { transform: translateY(0); }
  30%       { transform: translateY(-5px); }
  60%       { transform: translateY(-2px); }
}
@keyframes swiftHaloRing {
  0%   { box-shadow: 0 0 0 0 rgba(255,69,0,0.3); }
  70%  { box-shadow: 0 0 0 10px rgba(255,69,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,69,0,0); }
}
@keyframes swiftSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes swiftRedPulse {
  0%, 100% { color: #e53935; }
  50%       { color: #ff8a80; }
}
@keyframes swiftSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes swiftGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,69,0,0); }
  50%       { box-shadow: 0 4px 20px rgba(255,69,0,0.25); }
}

/* ── Utility Classes ───────────────────────────────── */

/* [1] Fade-up appear — apply to sections on scroll */
.swift-fade-up {
  animation: swiftFadeUp 0.45s cubic-bezier(0.22,1,0.36,1) both;
}
.swift-fade-up-2 { animation: swiftFadeUp 0.45s 0.08s cubic-bezier(0.22,1,0.36,1) both; }
.swift-fade-up-3 { animation: swiftFadeUp 0.45s 0.16s cubic-bezier(0.22,1,0.36,1) both; }
.swift-fade-up-4 { animation: swiftFadeUp 0.45s 0.24s cubic-bezier(0.22,1,0.36,1) both; }

/* [2] Cards: lift on hover */
.swift-card-hover {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.swift-card-hover:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 8px 28px rgba(0,0,0,0.10);
}

/* [3] Buttons: scale + pulse ring */
.swift-btn-hover {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.swift-btn-hover:hover {
  transform: scale(1.03);
}
.swift-btn-hover:active {
  transform: scale(0.97);
}

/* [4] Primary CTA shimmer */
.swift-cta-shimmer {
  background-size: 200% auto;
  background-image: linear-gradient(105deg, var(--accent) 40%, #ff8c5a 50%, var(--accent) 60%);
  animation: swiftShimmer 3s linear infinite;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.swift-cta-shimmer:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 22px rgba(255,69,0,0.35);
}

/* [5] Pill/chip hover */
.swift-pill-hover {
  transition: transform 0.13s ease, background 0.13s ease;
  cursor: pointer;
}
.swift-pill-hover:hover {
  transform: scale(1.06);
}
.swift-pill-hover:active {
  animation: swiftPop 0.25s ease;
}

/* [6] Input focus glow */
.swift-input-glow:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,69,0,0.18);
  border-color: var(--accent) !important;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

/* [7] Image hover zoom */
.swift-img-hover {
  overflow: hidden;
  border-radius: inherit;
}
.swift-img-hover img {
  transition: transform 0.35s ease;
}
.swift-img-hover:hover img {
  transform: scale(1.06);
}

/* [8] Stat value count-up glow */
.swift-stat-glow {
  animation: swiftGlow 2.5s ease-in-out infinite;
}

/* [9] Countdown red pulse (auction) */
.swift-timer-urgent {
  animation: swiftRedPulse 1s ease-in-out infinite;
}

/* [10] Bounce on appear */
.swift-bounce-in {
  animation: swiftBounce 0.5s ease both;
}

/* [11] Halo ring on avatar / logo */
.swift-halo {
  animation: swiftHaloRing 2s ease-in-out infinite;
}

/* [12] Slide-in stagger for list items */
.swift-stagger > *:nth-child(1) { animation: swiftSlideIn 0.3s 0.0s ease both; }
.swift-stagger > *:nth-child(2) { animation: swiftSlideIn 0.3s 0.05s ease both; }
.swift-stagger > *:nth-child(3) { animation: swiftSlideIn 0.3s 0.10s ease both; }
.swift-stagger > *:nth-child(4) { animation: swiftSlideIn 0.3s 0.15s ease both; }
.swift-stagger > *:nth-child(5) { animation: swiftSlideIn 0.3s 0.20s ease both; }
.swift-stagger > *:nth-child(6) { animation: swiftSlideIn 0.3s 0.25s ease both; }

/* [13] Nav-item active indicator */
.nav-item {
  transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}
.nav-item:hover:not(.active) {
  padding-left: 22px;
  background: rgba(255,69,0,0.06);
}

/* [14] Toast pop */
.toast.show {
  animation: swiftBounce 0.4s ease;
}

/* [15] Stat card pulse on hover */
.stat-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.09);
}

/* [16] Product card grid stagger (applied via JS) */
.product-card-anim {
  animation: swiftFadeUp 0.4s ease both;
}

/* [17] Search bar subtle pulse */
.search-pulse:focus-within {
  box-shadow: 0 0 0 3px rgba(255,69,0,0.15);
  transition: box-shadow 0.2s ease;
}

/* [18] Scroll reveal (hidden until IntersectionObserver fires) */
.sr-hidden {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.sr-visible {
  opacity: 1;
  transform: translateY(0);
}

/* [19] Ripple on click */
.swift-ripple {
  position: relative;
  overflow: hidden;
}
.swift-ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.3);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.swift-ripple:active::after {
  opacity: 1;
}

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