/* ===== ANIMACIONES Y EFECTOS ESPECIALES - NUTRIHELP ===== */

/* ===== KEYFRAMES ===== */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(60px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  0% {
    opacity: 0;
    transform: translateY(-60px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  0% {
    opacity: 0;
    transform: translateX(-60px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  0% {
    opacity: 0;
    transform: translateX(60px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translateY(0);
  }
  40%, 43% {
    transform: translateY(-10px);
  }
  70% {
    transform: translateY(-5px);
  }
  90% {
    transform: translateY(-2px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}

@keyframes gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.1);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.1);
  }
  70% {
    transform: scale(1);
  }
}

/* ===== CLASES DE ANIMACIÓN ===== */
.animate-fade-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-down {
  animation: fadeInDown 0.8s ease-out forwards;
}

.animate-fade-left {
  animation: fadeInLeft 0.8s ease-out forwards;
}

.animate-fade-right {
  animation: fadeInRight 0.8s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.6s ease-out forwards;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-bounce {
  animation: bounce 1s infinite;
}

.animate-heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

/* ===== DELAYS PARA ANIMACIONES ESCALONADAS ===== */
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }
.animate-delay-6 { animation-delay: 0.6s; }

/* ===== EFECTOS HOVER ===== */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-rotate {
  transition: transform 0.3s ease;
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(212, 165, 116, 0.4);
}

/* ===== GRADIENTES ANIMADOS REFINADOS ===== */
.gradient-animated {
  background: linear-gradient(-45deg, var(--color-primary), var(--color-accent), var(--color-primary-dark), var(--color-purple-muted));
  background-size: 400% 400%;
  animation: gradient 4s ease infinite;
}

/* ===== EFECTOS DE TEXTO ===== */
.text-shimmer {
  background: linear-gradient(
    to right,
    var(--color-text) 0%,
    var(--color-primary) 25%,
    var(--color-accent) 50%,
    var(--color-primary) 75%,
    var(--color-text) 100%
  );
  background-size: 200% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 2s linear infinite;
}

.text-typing {
  overflow: hidden;
  border-right: 3px solid var(--color-primary);
  white-space: nowrap;
  animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--color-primary); }
}

/* ===== LOADING ANIMATIONS ===== */
.loading-dots {
  display: inline-block;
}

.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--color-white);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-grow {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-color: var(--color-primary);
  border-radius: 50%;
  animation: spinner-grow 0.75s linear infinite;
}

@keyframes spinner-grow {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* ===== EFECTOS DE PARALLAX ===== */
.parallax-element {
  transform: translateZ(0);
  will-change: transform;
}

.parallax-slow {
  transform: translate3d(0, 0, 0);
}

.parallax-medium {
  transform: translate3d(0, 0, 0);
}

.parallax-fast {
  transform: translate3d(0, 0, 0);
}

/* ===== EFECTOS DE REVEAL ===== */
.reveal-up {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-up.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* ===== EFECTOS DE CONTADOR ===== */
.counter {
  font-weight: 700;
  font-size: 2.5rem;
  color: var(--color-primary);
}

.counter-up {
  animation: countUp 2s ease-out forwards;
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== EFECTOS DE PARTÍCULAS ===== */
.particles-background {
  position: relative;
  overflow: hidden;
}

.particles-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(166, 141, 199, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(184, 166, 209, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(200, 184, 224, 0.02) 0%, transparent 50%);
  animation: float 8s ease-in-out infinite;
  pointer-events: none;
}

/* ===== EFECTOS DE MORPHING ===== */
.morph-shape {
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: morphing 8s ease-in-out infinite;
}

@keyframes morphing {
  0% { 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% 40% 60% 30% / 40% 50% 60% 40%; }
  75% { border-radius: 40% 70% 30% 60% / 60% 40% 50% 30%; }
  100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

/* ===== EFECTOS DE LÍQUIDO ===== */
.liquid-blob {
  position: relative;
  background: linear-gradient(45deg, var(--color-primary), var(--color-sage));
  border-radius: 50%;
  animation: liquid 4s ease-in-out infinite;
}

@keyframes liquid {
  0%, 100% {
    border-radius: 50% 40% 60% 30% / 40% 50% 30% 60%;
  }
  25% {
    border-radius: 60% 30% 40% 50% / 30% 60% 50% 40%;
  }
  50% {
    border-radius: 30% 60% 50% 40% / 60% 40% 30% 50%;
  }
  75% {
    border-radius: 40% 50% 30% 60% / 50% 30% 60% 40%;
  }
}

/* ===== EFECTOS DE GLASSMORPHISM ===== */
.glass-effect {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.glass-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius-large);
  transition: all 0.3s ease;
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(15px);
  transform: translateY(-5px);
}

/* ===== EFECTOS DE NEOMORPHISM ===== */
.neomorph {
  background: #f0f0f0;
  border-radius: var(--border-radius-large);
  box-shadow: 
    20px 20px 60px #d1d1d1,
    -20px -20px 60px #ffffff;
  transition: all 0.3s ease;
}

.neomorph:hover {
  box-shadow: 
    inset 20px 20px 60px #d1d1d1,
    inset -20px -20px 60px #ffffff;
}

.neomorph-inset {
  background: #f0f0f0;
  border-radius: var(--border-radius);
  box-shadow: 
    inset 8px 8px 16px #d1d1d1,
    inset -8px -8px 16px #ffffff;
}

/* ===== EFECTOS DE ONDAS ===== */
.wave-effect {
  position: relative;
  overflow: hidden;
}

.wave-effect::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(177, 156, 217, 0.2),
    transparent
  );
  animation: wave 2s infinite;
}: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(212, 165, 116, 0.2),
    transparent
  );
  animation: wave 2s infinite;
}

@keyframes wave {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ===== EFECTOS DE RESPIRACIÓN ===== */
.breathe {
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* ===== EFECTOS PARA NOTIFICACIONES ===== */
.notification {
  animation: slideInRight 0.3s ease-out;
}

.notification.removing {
  animation: slideOutRight 0.3s ease-in;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ===== EFECTOS DE PROGRESO ===== */
.progress-bar {
  position: relative;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-sage));
  border-radius: 2px;
  animation: progressFill 2s ease-out;
}

@keyframes progressFill {
  from { width: 0%; }
  to { width: var(--progress-width, 100%); }
}

/* ===== EFECTOS ESPECÍFICOS PARA ELEMENTOS ===== */

/* Hero Section */
.hero-content {
  animation: fadeInLeft 1s ease-out 0.2s both;
}

.hero-image {
  animation: fadeInRight 1s ease-out 0.4s both;
}

.floating-badge {
  animation: float 3s ease-in-out infinite;
}

/* Service Cards */
.service-card-warm {
  animation: fadeInUp 0.8s ease-out both;
}

.service-card-warm:nth-child(1) { animation-delay: 0.1s; }
.service-card-warm:nth-child(2) { animation-delay: 0.2s; }
.service-card-warm:nth-child(3) { animation-delay: 0.3s; }
.service-card-warm:nth-child(4) { animation-delay: 0.4s; }
.service-card-warm:nth-child(5) { animation-delay: 0.5s; }
.service-card-warm:nth-child(6) { animation-delay: 0.6s; }

.service-icon-warm {
  animation: pulse 2s infinite;
}

/* Testimonial Cards */
.testimonial-card-warm {
  animation: scaleIn 0.6s ease-out both;
}

.testimonial-rating i {
  animation: heartbeat 1.5s ease-in-out infinite;
  animation-delay: calc(var(--star-index) * 0.1s);
}

/* WhatsApp Button */
.whatsapp-btn {
  animation: bounce 2s infinite;
}

.whatsapp-btn:hover {
  animation: pulse 0.5s ease-in-out;
}

/* Form Elements */
.form-control:focus {
  animation: pulse 0.3s ease-in-out;
}

.btn:active {
  animation: scaleIn 0.1s ease-in-out;
}

/* ===== RESPONSIVE ANIMATIONS ===== */
@media (max-width: 768px) {
  .animate-fade-up,
  .animate-fade-left,
  .animate-fade-right {
    animation-duration: 0.6s;
  }
  
  .hero-content,
  .hero-image {
    animation-duration: 0.8s;
  }
  
  .service-card-warm,
  .testimonial-card-warm {
    animation-delay: 0s !important;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .animate-pulse,
  .animate-float,
  .animate-bounce,
  .animate-heartbeat,
  .breathe,
  .floating-badge,
  .service-icon-warm,
  .whatsapp-btn {
    animation: none !important;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}