/* ============================================
   JORNADA BÍBLICA — Animations
   ============================================ */

/* === Keyframes === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideOutDown {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse-soft {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(200, 169, 110, 0.2); }
  50% { box-shadow: 0 0 30px rgba(200, 169, 110, 0.5); }
}

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

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

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

@keyframes divine-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1), 0 0 40px rgba(255, 215, 0, 0.05);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.3), 0 0 80px rgba(255, 215, 0, 0.1);
  }
}

@keyframes text-reveal {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes verse-highlight {
  0% { background-color: transparent; }
  50% { background-color: rgba(200, 169, 110, 0.2); }
  100% { background-color: transparent; }
}

@keyframes xp-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  50% { opacity: 1; transform: translate(-50%, -70%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -120%) scale(1); }
}

@keyframes star-fill {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  50% { transform: scale(1.3) rotate(0deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes achievement-shine {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

@keyframes particle-float {
  0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) translateX(50px) rotate(360deg); opacity: 0; }
}

@keyframes bg-slow-zoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

@keyframes scroll-unroll {
  from { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; }
  to { max-height: 600px; opacity: 1; }
}

/* === Animation Classes === */
.anim-fade-in {
  animation: fadeIn var(--transition-dramatic) forwards;
}

.anim-fade-in-up {
  animation: fadeInUp var(--transition-dramatic) forwards;
}

.anim-fade-in-down {
  animation: fadeInDown var(--transition-dramatic) forwards;
}

.anim-fade-in-left {
  animation: fadeInLeft var(--transition-dramatic) forwards;
}

.anim-fade-in-right {
  animation: fadeInRight var(--transition-dramatic) forwards;
}

.anim-scale-in {
  animation: scaleIn var(--transition-dramatic) forwards;
}

.anim-float {
  animation: float 3s ease-in-out infinite;
}

.anim-shake {
  animation: shake 0.5s ease;
}

.anim-divine-glow {
  animation: divine-glow 3s ease-in-out infinite;
}

.anim-shimmer {
  background: linear-gradient(90deg, transparent 25%, rgba(255, 215, 0, 0.1) 50%, transparent 75%);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

.anim-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

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

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.8s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.9s; }
.stagger-children > *:nth-child(10) { animation-delay: 1s; }

/* === Scene Transitions === */
.scene-transition-fade .scene-background {
  transition: opacity 1.2s ease;
}

.scene-transition-dissolve {
  animation: fadeOut 0.6s ease forwards;
}

.scene-transition-dissolve-in {
  animation: fadeIn 0.6s ease forwards;
}

/* === Background Slow Pan === */
.bg-animate {
  animation: bg-slow-zoom 30s ease-in-out alternate infinite;
}

/* === XP Notification Animation === */
.xp-notification.animate {
  animation: xp-pop 1.5s ease forwards;
}

/* === Star Fill Animation === */
.star-animate {
  animation: star-fill 0.6s ease forwards;
}

.star-animate:nth-child(2) { animation-delay: 0.3s; }
.star-animate:nth-child(3) { animation-delay: 0.6s; }

/* === Scroll Unroll for Dialogue === */
.scroll-unroll {
  animation: scroll-unroll 0.8s ease forwards;
  overflow: hidden;
}

/* === Choice Hover Ripple === */
.btn-choice::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(200, 169, 110, 0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  border-radius: var(--radius-md);
}

.btn-choice:hover::after {
  opacity: 1;
}

/* === SVG Visual Silhouette Animations === */
@keyframes vs-breathe {
  0%, 100% { transform: scaleY(1) translateY(0); }
  50% { transform: scaleY(1.008) translateY(-1px); }
}
@keyframes vs-sway {
  0%, 100% { transform: rotate(-0.5deg) scaleX(1); }
  50% { transform: rotate(0.5deg) scaleX(1.01); }
}
@keyframes vs-sway-deep {
  0%, 100% { transform: rotate(-1deg); }
  33% { transform: rotate(0.5deg); }
  66% { transform: rotate(-0.3deg); }
}
@keyframes vs-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes vs-pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}
@keyframes vs-twinkle {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.9; }
}
@keyframes vs-rays {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes vs-bird {
  0% { transform: translate(0, 0); }
  25% { transform: translate(40px, -15px); }
  50% { transform: translate(90px, -5px); }
  75% { transform: translate(140px, -20px); }
  100% { transform: translate(200px, -10px); }
}
@keyframes vs-flame {
  0%, 100% { transform: scaleY(1) scaleX(1); opacity: 0.4; }
  25% { transform: scaleY(1.3) scaleX(0.9); opacity: 0.6; }
  50% { transform: scaleY(0.8) scaleX(1.1); opacity: 0.3; }
  75% { transform: scaleY(1.2) scaleX(0.95); opacity: 0.55; }
}

.vs-breathe { animation: vs-breathe 5s ease-in-out infinite; transform-origin: bottom center; }
.vs-sway { animation: vs-sway 7s ease-in-out infinite; transform-origin: bottom center; }
.vs-sway-deep { animation: vs-sway-deep 9s ease-in-out infinite; transform-origin: bottom center; }
.vs-float { animation: vs-float 4s ease-in-out infinite; }
.vs-pulse { animation: vs-pulse 3s ease-in-out infinite; }
.vs-twinkle { animation: vs-twinkle 3s ease-in-out infinite; }
.vs-rays { animation: vs-rays 50s linear infinite; transform-origin: center; }
.vs-bird { animation: vs-bird 12s linear infinite; }
.vs-flame { animation: vs-flame 2s ease-in-out infinite; transform-origin: bottom center; }
.vs-hidden { display: none; }

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