/* ========================================
   ANIMACIONES Y KEYFRAMES PERSONALIZADOS
======================================== */

/* Animación de rebote para el título */
@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Animación de flotación para elementos */
@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-10px) rotate(5deg);
  }
  66% {
    transform: translateY(-5px) rotate(-5deg);
  }
}

/* Animación de pulso para botones */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Animación de aparición desde abajo */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animación de aparición desde la izquierda */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Animación de aparición desde la derecha */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Animación de rotación */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Animación de escala */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animación de skeleton loading */
@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* Animación de revelación con clip-path */
@keyframes reveal {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* Animación de gradiente en movimiento */
@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Animación de typing effect */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary-color);
  }
}

/* ========================================
   CLASES DE ANIMACIÓN APLICABLES
======================================== */

/* Animación de pulso */
.pulse-animation {
  animation: pulse 2s infinite;
}

/* Animaciones de aparición */
.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in-left {
  animation: fadeInLeft 0.6s ease-out forwards;
}

.fade-in-right {
  animation: fadeInRight 0.6s ease-out forwards;
}

.scale-in {
  animation: scaleIn 0.5s ease-out forwards;
}

/* Animación de revelación para recetas */
.reveal-animation {
  animation: reveal 0.8s ease-out forwards;
  opacity: 0;
}

.reveal-animation.visible {
  opacity: 1;
}

/* Hover effects con transform */
.hover-scale {
  transition: transform var(--transition-normal);
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-lift {
  transition: transform var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-5px);
}

/* Animación de rotación para iconos */
.rotate-on-hover {
  transition: transform var(--transition-normal);
}

.rotate-on-hover:hover {
  transform: rotate(360deg);
}

/* Efecto de typing para textos */
.typing-effect {
  overflow: hidden;
  border-right: 2px solid var(--primary-color);
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

/* Gradiente animado para fondos */
.animated-gradient {
  background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c);
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
}

/* Animaciones de entrada con delay */
.stagger-animation {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-animation:nth-child(1) {
  animation-delay: 0.1s;
}
.stagger-animation:nth-child(2) {
  animation-delay: 0.2s;
}
.stagger-animation:nth-child(3) {
  animation-delay: 0.3s;
}
.stagger-animation:nth-child(4) {
  animation-delay: 0.4s;
}
.stagger-animation:nth-child(5) {
  animation-delay: 0.5s;
}
.stagger-animation:nth-child(6) {
  animation-delay: 0.6s;
}

/* Animación de carga para botones */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: rotate 1s ease-in-out infinite;
}

/* Efectos de parallax suave */
.parallax-element {
  transform: translateZ(0);
  transition: transform 0.1s ease-out;
}

/* Animación de ondas para fondos */
@keyframes wave {
  0% {
    transform: translateX(0) translateZ(0) scaleY(1);
  }
  50% {
    transform: translateX(-25%) translateZ(0) scaleY(0.55);
  }
  100% {
    transform: translateX(-50%) translateZ(0) scaleY(1);
  }
}

.wave-animation {
  position: relative;
  overflow: hidden;
}

.wave-animation::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: wave 2s infinite;
}

/* Animaciones específicas para elementos de la landing */
.hero-title {
  animation: fadeInUp 1s ease-out 0.5s both;
}

.hero-subtitle {
  animation: fadeInUp 1s ease-out 0.7s both;
}

.hero-cta {
  animation: fadeInUp 1s ease-out 0.9s both;
}

.hero-image {
  animation: fadeInRight 1s ease-out 1.1s both;
}

/* Animación de contador */
.counter-animation {
  font-variant-numeric: tabular-nums;
}

/* Efectos de hover para cards */
.card-hover-effect {
  position: relative;
  overflow: hidden;
}

.card-hover-effect::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s ease;
}

.card-hover-effect:hover::before {
  left: 100%;
}

/* Animación de aparición para elementos en scroll */
.scroll-reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.6s ease-out;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Efectos de texto animado */
.text-glow {
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
  }
  to {
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
  }
}

/* Animación de partículas flotantes */
@keyframes particle-float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
    opacity: 0.5;
  }
}

.floating-particle {
  animation: particle-float 4s ease-in-out infinite;
}

.floating-particle:nth-child(odd) {
  animation-delay: 2s;
}

/* Responsive animations */
@media (max-width: 768px) {
  .hero-title,
  .hero-subtitle,
  .hero-cta,
  .hero-image {
    animation-duration: 0.8s;
  }

  .stagger-animation {
    animation-duration: 0.4s;
  }
}

/* Animaciones para estados de carga */
.loading-state {
  position: relative;
  overflow: hidden;
}

.loading-state::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: loading-sweep 1.5s infinite;
}

@keyframes loading-sweep {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}
