/* ==========================================================================
   ANIMATIONS.CSS - ANIMACIONES DE NUBES, GLOBOS, VINILO Y SCROLL REVEAL
   INVITACIÓN INFANTIL VINTAGE TEDDY BEAR & WOODEN TOYS
   ========================================================================== */

/* 1. Giro continuo del disco de vinilo ("Un Mensaje Especial") */
@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin-slow {
  animation: spin-slow 8s linear infinite;
}

.animate-spin-slow.paused {
  animation-play-state: paused;
}

/* 2. Flotación suave para globos PNG de fondo */
@keyframes floatBalloon {
  0% {
    transform: translateY(0px) translateX(0px) rotate(-3deg);
  }
  50% {
    transform: translateY(-18px) translateX(6px) rotate(3deg);
  }
  100% {
    transform: translateY(-6px) translateX(-5px) rotate(-2deg);
  }
}

/* 3. Desplazamiento horizontal y flotación suave para nubes blancas y celestes */
@keyframes driftCloudLeftToRight {
  0% {
    transform: translateX(0px) translateY(0px) scale(1);
  }
  50% {
    transform: translateX(22px) translateY(-8px) scale(1.03);
  }
  100% {
    transform: translateX(-10px) translateY(4px) scale(0.99);
  }
}

@keyframes driftCloudRightToLeft {
  0% {
    transform: translateX(0px) translateY(0px) scale(1);
  }
  50% {
    transform: translateX(-22px) translateY(-7px) scale(1.03);
  }
  100% {
    transform: translateX(10px) translateY(4px) scale(0.99);
  }
}

/* 4. Pulso suave para estrellas y corazones decorativos */
@keyframes gentle-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.12);
    opacity: 1;
  }
}

.animate-gentle-pulse {
  animation: gentle-pulse 3s infinite ease-in-out;
}

/* 5. Balanceo sutil para el osito en caballito mecedor */
@keyframes rockingHorse {
  0%,
  100% {
    transform: rotate(-3.5deg);
  }
  50% {
    transform: rotate(4.5deg);
  }
}

.animate-rocking {
  animation: rockingHorse 3.8s ease-in-out infinite;
  transform-origin: bottom center;
}

/* 6. Entrada Cinemática Inicial */
.page-dreamy-entrance {
  opacity: 0;
  filter: blur(8px);
  transform: scale(0.99);
  transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, filter, transform;
}

.page-dreamy-entrance.page-ready {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

/* 7. Revelado Suave en Scroll (Scroll Reveal) */
.scroll-reveal {
  opacity: 0;
  filter: blur(4px);
  transform: translateY(20px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, filter, transform;
}

.scroll-reveal.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.scroll-reveal-scale {
  opacity: 0;
  filter: blur(5px);
  transform: translateY(16px) scale(0.96);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, filter, transform;
}

.scroll-reveal-scale.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
}

.delay-1 {
  transition-delay: 0.1s;
}
.delay-2 {
  transition-delay: 0.2s;
}
.delay-3 {
  transition-delay: 0.3s;
}
.delay-4 {
  transition-delay: 0.4s;
}

/* 8. Notificación Toast Flotante */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, var(--sage-600) 0%, var(--sage-700) 100%);
  color: var(--cream-50);
  padding: 0.8rem 1.5rem;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(67, 61, 60, 0.28);
  border: 2px solid var(--cream-100);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* 9. Accesibilidad: Reducción de movimiento */
@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;
  }

  .page-dreamy-entrance,
  .scroll-reveal,
  .scroll-reveal-scale {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    transition: none !important;
  }
}
