/* Parallax and Animation Effects */
.parallax-element {
  transition: transform 0.5s cubic-bezier(0.33, 1, 0.68, 1);
  will-change: transform;
}

/* Entry animations with staggered delays - OPTIMIZED VERSION */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.215, 0.61, 0.355, 1),
              transform 0.7s cubic-bezier(0.215, 0.61, 0.355, 1);
  will-change: opacity, transform;
}

/* More specific selector to ensure higher priority */
.fade-in-up.visible,
h2.fade-in-up.visible,
.section-title.fade-in-up.visible,
.video-title.fade-in-up.visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  visibility: visible !important;
}

/* Specific styling for section titles */
.section-title.fade-in-up {
  transition-duration: 0.5s; /* Faster transition for section titles */
}

/* Comprehensive fix for section titles */
/* Target all section titles with maximum specificity */
h2.section-title.fade-in-up,
h2.section-title,
h2.fade-in-up,
h2.video-title.fade-in-up,
h2.video-title,
.section-title.fade-in-up,
.video-title.fade-in-up,
section h2.fade-in-up,
section h2.section-title,
.section-title {
  opacity: 1 !important;
  transform: none !important;
  transform: translateY(0) !important;
  transition: none !important;
  animation: none !important;
  will-change: auto !important;
  visibility: visible !important;
  display: block !important;
  pointer-events: auto !important;
}

/* Ensure all visible elements are actually visible with maximum priority */
.fade-in-up.visible,
h2.fade-in-up.visible,
.section-title.fade-in-up.visible,
.video-title.fade-in-up.visible,
h2.section-title.visible,
h2.visible,
.visible {
  opacity: 1 !important;
  transform: none !important;
  transform: translateY(0) !important;
  animation: none !important;
  visibility: visible !important;
}

.scale-in {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.7s cubic-bezier(0.215, 0.61, 0.355, 1),
              transform 0.7s cubic-bezier(0.215, 0.61, 0.355, 1);
  will-change: opacity, transform;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s cubic-bezier(0.215, 0.61, 0.355, 1),
              transform 0.7s cubic-bezier(0.215, 0.61, 0.355, 1);
  will-change: opacity, transform;
}

.slide-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s cubic-bezier(0.215, 0.61, 0.355, 1),
              transform 0.7s cubic-bezier(0.215, 0.61, 0.355, 1);
  will-change: opacity, transform;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered animation for multiple elements */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.215, 0.61, 0.355, 1),
              transform 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.stagger-item.visible:nth-child(1) { transition-delay: 0.1s; }
.stagger-item.visible:nth-child(2) { transition-delay: 0.2s; }
.stagger-item.visible:nth-child(3) { transition-delay: 0.3s; }
.stagger-item.visible:nth-child(4) { transition-delay: 0.4s; }
.stagger-item.visible:nth-child(5) { transition-delay: 0.5s; }

.stagger-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Floating animation for icons */
@keyframes float {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

.float-animation {
  animation: float 5s ease-in-out infinite;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1));
  will-change: transform;
}

/* Animated background */
.animated-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.animated-bg-shape {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.animated-bg-shape:nth-child(1) {
  width: 600px;
  height: 600px;
  top: -300px;
  right: -200px;
  background: linear-gradient(135deg, rgba(229, 68, 109, 0.05), rgba(162, 57, 202, 0.05));
  animation: shape-float-1 20s ease-in-out infinite alternate;
}

.animated-bg-shape:nth-child(2) {
  width: 400px;
  height: 400px;
  bottom: -200px;
  left: -100px;
  background: linear-gradient(135deg, rgba(162, 57, 202, 0.05), rgba(229, 68, 109, 0.05));
  animation: shape-float-2 15s ease-in-out infinite alternate-reverse;
}

@keyframes shape-float-1 {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(100px, 100px) rotate(10deg); }
}

@keyframes shape-float-2 {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(100px, -50px) rotate(-10deg); }
}

/* Swipe animations for Google reviews */
@keyframes swipeIn {
  from { 
    transform: translateX(50px);
    opacity: 0;
  }
  to { 
    transform: translateX(0);
    opacity: 1;
  }
}

.google-review {
  animation: swipeIn 0.5s forwards;
  opacity: 0;
}

.google-review:nth-child(1) { animation-delay: 0.1s; }
.google-review:nth-child(2) { animation-delay: 0.3s; }
.google-review:nth-child(3) { animation-delay: 0.5s; }

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Bounce effect animation */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-20px); }
  60% { transform: translateY(-10px); }
}

.bounce-effect {
  animation: bounce 2s infinite;
}

/* Morphing shapes animation */
@keyframes morph {
  0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
  25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; }
  50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
  75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
  100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

/* Rotating border animation */
@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Pulse animation */
@keyframes pulse {
  0% { 
    transform: scale(1); 
    box-shadow: 0 0 0 0 rgba(229, 68, 109, 0.5);
  }
  50% { 
    transform: scale(1.03); 
    box-shadow: 0 0 0 10px rgba(229, 68, 109, 0);
  }
  100% { 
    transform: scale(1); 
    box-shadow: 0 0 0 0 rgba(229, 68, 109, 0);
  }
}

.animate-pulse {
  animation: pulse 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  will-change: transform, box-shadow;
}

/* Nav icon bounce animation */
/* This animation is now defined in main.css */
/* @keyframes navIconBounce {
  0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
  40% {transform: translateY(-10px);}
  60% {transform: translateY(-5px);}
} */

/* Gradient animation for CTA buttons */
.gradient-animation {
  background-size: 200% auto;
  background-image: linear-gradient(to right, 
    var(--color-accent) 0%, 
    var(--color-accent-secondary) 30%, 
    var(--color-accent) 100%);
  animation: gradientShift 3s linear infinite;
  will-change: background-position;
}

@keyframes gradientShift {
  0% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
  100% {
    background-position: 0% center;
  }
}

/* Glow effect for highlighted elements */
.glow-effect {
  animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
  0% {
    box-shadow: 0 0 5px rgba(229, 68, 109, 0.2);
  }
  100% {
    box-shadow: 0 0 20px rgba(229, 68, 109, 0.6);
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .fade-in-up,
  .scale-in,
  .slide-in-left,
  .slide-in-right,
  .stagger-item {
    transition: none;
    opacity: 1;
    transform: none;
  }

  .float-animation,
  .animate-pulse,
  .bounce-effect,
  .gradient-animation,
  .glow-effect,
  .animated-bg-shape {
    animation: none;
  }
}