/* ============================================================
   SnapQuiz — sq-animations.css
   ============================================================ */

/* ── Keyframes ───────────────────────────────────────────── */
@keyframes sq-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}
@keyframes sq-pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(232,69,10,0.4); }
  70%  { box-shadow: 0 0 0 16px rgba(232,69,10,0); }
  100% { box-shadow: 0 0 0 0 rgba(232,69,10,0); }
}
@keyframes sq-gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes sq-spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes sq-fade-up {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes sq-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes sq-slide-right {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes sq-scale-in {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes sq-bounce-gentle {
  0%, 100% { transform: translateY(0); }
  40%       { transform: translateY(-6px); }
  60%       { transform: translateY(-3px); }
}
@keyframes sq-shimmer {
  from { background-position: -200% center; }
  to   { background-position: 200% center; }
}
@keyframes sq-count-pulse {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes sq-hero-label {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes sq-blob-move {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  25%       { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  50%       { border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%; }
  75%       { border-radius: 70% 30% 50% 60% / 60% 40% 60% 30%; }
}
@keyframes sq-progress-flash {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Hero Animations ─────────────────────────────────────── */
.sq-hero-label       { animation: sq-hero-label 0.6s ease 0.2s both; }
.sq-hero-title       { animation: sq-fade-up 0.7s ease 0.35s both; }
.sq-hero-sub         { animation: sq-fade-up 0.7s ease 0.5s both; }
.sq-hero-actions     { animation: sq-fade-up 0.7s ease 0.65s both; }
.sq-hero-stats       { animation: sq-fade-up 0.7s ease 0.8s both; }
.sq-hero-card-float  { animation: sq-scale-in 0.7s ease 0.5s both, sq-float 6s ease-in-out 1.2s infinite; }

/* ── Floating orbs ───────────────────────────────────────── */
.sq-orb {
  position: absolute; border-radius: 50%; pointer-events: none; opacity: 0.15;
  animation: sq-blob-move 12s ease-in-out infinite;
}
.sq-orb-1 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--sq-accent2), transparent);
  top: 10%; right: 15%; animation-delay: 0s;
}
.sq-orb-2 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--sq-accent), transparent);
  bottom: 20%; left: 10%; animation-delay: -4s;
}
.sq-orb-3 {
  width: 160px; height: 160px;
  background: radial-gradient(circle, var(--sq-accent3), transparent);
  top: 55%; right: 5%; animation-delay: -8s;
}

/* ── Shimmer text ────────────────────────────────────────── */
.sq-shimmer-text {
  background: linear-gradient(90deg, var(--sq-ink) 0%, var(--sq-accent2) 40%, var(--sq-accent) 60%, var(--sq-ink) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: sq-shimmer 4s linear infinite;
}

/* ── Gradient animated bg ────────────────────────────────── */
.sq-gradient-animated {
  background: linear-gradient(-45deg, #e8450a, #1a6aff, #00c896, #f5a623);
  background-size: 400% 400%;
  animation: sq-gradient-shift 8s ease infinite;
}

/* ── Bounce icon ─────────────────────────────────────────── */
.sq-bounce { animation: sq-bounce-gentle 2s ease-in-out infinite; }

/* ── Pulse CTA ───────────────────────────────────────────── */
.sq-pulse { animation: sq-pulse-ring 2.5s ease-out infinite; }

/* ── Spin loader ─────────────────────────────────────────── */
.sq-spin { animation: sq-spin-slow 2s linear infinite; }

/* ── Staggered reveals ───────────────────────────────────── */
.sq-stagger-1 { transition-delay: 0.05s; }
.sq-stagger-2 { transition-delay: 0.1s; }
.sq-stagger-3 { transition-delay: 0.15s; }
.sq-stagger-4 { transition-delay: 0.2s; }
.sq-stagger-5 { transition-delay: 0.25s; }
.sq-stagger-6 { transition-delay: 0.3s; }

/* ── Quiz option wiggle on correct ───────────────────────── */
@keyframes sq-wiggle {
  0%  { transform: rotate(0); }
  25% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
  75% { transform: rotate(-1deg); }
  100%{ transform: rotate(0); }
}
.sq-wiggle { animation: sq-wiggle 0.4s ease; }

/* ── Page transition ─────────────────────────────────────── */
.sq-page-enter {
  animation: sq-fade-in 0.4s ease;
}

/* ── Score ring fill ─────────────────────────────────────── */
@keyframes sq-ring-fill {
  from { stroke-dashoffset: 283; }
  to   { stroke-dashoffset: var(--sq-offset); }
}
.sq-ring-progress {
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 1s cubic-bezier(0.4,0,0.2,1);
}

/* ── Hover lift ──────────────────────────────────────────── */
.sq-hover-lift {
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s ease;
}
.sq-hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(13,13,13,0.14);
}

/* ── Number counter flash ────────────────────────────────── */
.sq-counter-animate { animation: sq-count-pulse 0.3s ease; }

/* ── Decorative SVG shapes ───────────────────────────────── */
.sq-hero-shape {
  position: absolute; pointer-events: none;
}
.sq-hero-shape-1 {
  top: -60px; right: -60px; width: 400px; height: 400px;
  border: 1px solid rgba(255,255,255,0.04); border-radius: 50%;
  animation: sq-spin-slow 40s linear infinite;
}
.sq-hero-shape-2 {
  bottom: -80px; left: 30%; width: 280px; height: 280px;
  border: 1px solid rgba(255,255,255,0.05); border-radius: 50%;
  animation: sq-spin-slow 30s linear infinite reverse;
}

/* ── Mobile menu animation ───────────────────────────────── */
.sq-hamburger.sq-open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.sq-hamburger.sq-open span:nth-child(2) { opacity: 0; }
.sq-hamburger.sq-open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

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