/* ═══════════════════════════════════════
   ANIMATIONS.CSS — Efeitos Especiais
═══════════════════════════════════════ */

/* ── Scroll-triggered entrance animations ── */
.animate-step, .animate-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease calc(var(--delay, 0s)), transform 0.55s cubic-bezier(0.34, 1.3, 0.64, 1) calc(var(--delay, 0s));
}
.animate-step.visible, .animate-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Hero text fade in ── */
/* Hero animations (eyebrow, title, sub) are now defined in main.css
   using slideUpStagger with staggered delays. Do NOT redeclare here
   or cascade will override the newer values. */
.card-wrapper {
  animation: fadeSlideUp 0.8s ease 0.15s both;
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Staggered slide up for hero redesign ── */
@keyframes slideUpStagger {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Prize strip number tick ── */
.prize-value.tick {
  animation: priceTick 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes priceTick {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* ── Background grid pattern on body ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(27,138,61,0.04) 1px, transparent 0);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: -1;
}

/* ── Floating money notes background decoration ── */
.floating-balls {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}
.floating-ball {
  position: absolute;
  width: 56px;
  height: 28px;
  border-radius: 6px;
  opacity: 0.045;
  animation: floatBall linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border: 1.5px solid currentColor;
}
.floating-ball::after {
  content: 'R$';
  font-family: var(--font-display);
}
.floating-ball:nth-child(1) { color:var(--green); left:5%; top:20%; animation-duration:20s; animation-delay:-3s; transform: rotate(-8deg); width:64px; height:32px; }
.floating-ball:nth-child(2) { color:var(--green-mid); left:82%; top:12%; animation-duration:26s; animation-delay:-8s; transform: rotate(5deg); }
.floating-ball:nth-child(3) { color:var(--green); left:68%; top:58%; animation-duration:18s; animation-delay:-1s; transform: rotate(-12deg); width:72px; height:36px; }
.floating-ball:nth-child(4) { color:var(--gold); left:18%; top:68%; animation-duration:22s; animation-delay:-14s; transform: rotate(7deg); width:48px; height:26px; }
.floating-ball:nth-child(5) { color:var(--green-dark); left:48%; top:78%; animation-duration:28s; animation-delay:-6s; transform: rotate(-4deg); }
@keyframes floatBall {
  0%   { transform: translateY(0px)   rotate(-8deg)  scale(1); }
  25%  { transform: translateY(-30px) rotate(-4deg)  scale(1.04); }
  50%  { transform: translateY(-15px) rotate(2deg)   scale(0.97); }
  75%  { transform: translateY(-40px) rotate(-10deg) scale(1.03); }
  100% { transform: translateY(0px)   rotate(-8deg)  scale(1); }
}

/* ── Shimmer on prize value ── */
.prize-value::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmerPrize 4s ease-in-out infinite;
}
.prize-amount { position: relative; overflow: hidden; }
@keyframes shimmerPrize {
  0% { left: -100%; }
  30%, 100% { left: 150%; }
}

/* ── Card shine effect on hover ── */
.lottery-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
  z-index: 0;
}
.lottery-card:hover::after { left: 150%; }

/* ── Toast icon ── */
.toast-icon { font-size: 20px; flex-shrink: 0; }

/* ── Pulse on pending numbers ── */
@keyframes selectPulse {
  0% { box-shadow: 0 0 0 0 rgba(27,138,61,0.4); }
  70% { box-shadow: 0 0 0 12px rgba(27,138,61,0); }
  100% { box-shadow: 0 0 0 0 rgba(27,138,61,0); }
}
.number-btn.just-selected {
  animation: selectPulse 0.6s ease;
}

/* ── Confetti celebration ── */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}
.confetti-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiDrop linear forwards;
}
@keyframes confettiDrop {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ── How cards entrance ── */
.how-card:nth-child(1) { --delay: 0.1s; }
.how-card:nth-child(2) { --delay: 0.2s; }
.how-card:nth-child(3) { --delay: 0.3s; }
.how-card:nth-child(4) { --delay: 0.4s; }

/* ── Focus styles for accessibility ── */
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

/* ── Spin (compartilhado: pix-spinner, loading-spinner) ── */
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Wiggle on empty cart checkout attempt ── */
.wiggle {
  animation: wiggle 0.5s ease;
}
@keyframes wiggle {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* Trust bar styles consolidated in main.css @media (max-width: 768px) */

/* ── Prefers reduced motion — desativa todas as animações contínuas ── */
@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;
  }
  .floating-balls,
  .prize-particles,
  .floating-ball,
  .pix-particle {
    display: none;
  }
  .logo-icon { animation: none; }
  .prize-value { animation: none; }
  .eyebrow-dot { animation: none; opacity: 1; transform: none; }
  .countdown-sep { animation: none; opacity: 0.5; }
  html { scroll-behavior: auto; }
}

/* ── PIX icon floating particles inside prize strip ── */
.pix-particle {
  position: absolute;
  animation: pixFloat linear infinite;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
@keyframes pixFloat {
  0%   { transform: translateY(90px) rotate(0deg) scale(0.8); opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translateY(-110px) rotate(180deg) scale(1.1); opacity: 0; }
}
