/* /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 15px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

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

@keyframes pulseGold {
  0% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(249, 115, 22, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
  }
}

.float-call {
  animation: pulseGold 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;
}

/* 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(50px) scale(0.95);
    }
    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 {
      background-color: rgba(8, 9, 12, 0.95);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--color-border);
      box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    }
  }

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

/* 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 gold outline pulse */
.hover-lift {
  transition: var(--transition-smooth);
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(249, 115, 22, 0.15);
}

/* 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(249, 115, 22, 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(249, 115, 22, 0.5);
}
