/* /css/animations.css */

/* Simple entrance transitions */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Pulse animation for WhatsApp & Call floating buttons */
@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

.float-whatsapp {
  animation: pulseGlow 2s infinite;
}

@keyframes pulseCyan {
  0% {
    box-shadow: 0 0 0 0 rgba(189, 255, 0, 0.4);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(189, 255, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(189, 255, 0, 0);
  }
}

.float-call {
  animation: pulseCyan 2.5s infinite;
}

/* Entrance fade-in for lazy-loaded content */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-in forwards;
}

/* Dynamic needle swing for calculator speedometer gauge */
@keyframes needleSwing {
  from {
    transform: translateX(-50%) rotate(-90deg);
  }
}

/* Live heart rate indicator heartbeat */
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.15); }
  40% { transform: scale(1); }
  55% { transform: scale(1.1); }
}

.heartbeat-icon {
  animation: heartbeat 1.2s infinite ease-in-out;
  color: #ff3e3e !important;
}

/* Floating organic circles */
@keyframes floatSlow {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-15px) scale(1.05); }
}

.float-slow {
  animation: floatSlow 6s ease-in-out infinite;
}

/* Scroll-driven reveals (Progressive enhancement for supported browsers) */
@supports ((animation-timeline: scroll()) and (animation-range: 0% 100%)) {
  /* Animate elements as they enter the scrollport */
  @keyframes revealOnScroll {
    from {
      opacity: 0;
      transform: translateY(40px) scale(0.97);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .scroll-reveal {
    animation: revealOnScroll linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 30%;
  }

  /* Shrinking header scroll effect */
  @keyframes shrinkHeader {
    to {
      height: 75px;
    }
  }

  .header {
    animation: shrinkHeader auto linear both;
    animation-timeline: scroll(block root);
    animation-range: 0px 100px;
  }
}

/* Fallback class for browsers without scroll-timeline support */
.js-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Hover lift and neon outline pulse */
.hover-lift {
  transition: var(--transition-smooth);
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(189, 255, 0, 0.1);
}

/* Drag slider animation utility */
.comparison-slider {
  position: relative;
  width: 100%;
  height: 450px;
  overflow: hidden;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--color-border);
}

.slider-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  pointer-events: none;
}

.slider-before {
  z-index: 2;
  width: 50%;
}

.slider-after {
  z-index: 1;
}

.slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background-color: var(--color-accent-gold);
  z-index: 3;
  cursor: ew-resize;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(189, 255, 0, 0.8);
}

.slider-handle::after {
  content: '↔';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background-color: var(--color-bg-primary);
  border: 2px solid var(--color-accent-gold);
  color: var(--color-accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  box-shadow: 0 0 10px rgba(189, 255, 0, 0.4);
}
