/* Performance Optimizations for Smooth Scrolling and Animations */

/* Enable smooth scrolling with hardware acceleration */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optimize scroll performance with will-change and transform */
* {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
}

/* Smooth transitions for all elements */
*, *::before, *::after {
    transition-timing-function: cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Optimize animations with GPU acceleration */
.animated,
[class*="animate__"],
[class*="wow"],
[class*="fadeIn"],
[class*="slideIn"],
[class*="zoomIn"] {
    will-change: transform, opacity;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Smooth scroll for anchor links */
a[href^="#"] {
    scroll-behavior: smooth;
}

/* Optimize fixed/sticky elements */
#sticky-header,
.sticky,
[class*="sticky"] {
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Optimize carousel and slider transitions */
.owl-carousel,
.slider-area,
[class*="slider"] {
    will-change: transform;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}

/* Improve hover transitions */
a,
button,
.btn,
[class*="button"] {
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Optimize images for better rendering */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Prevent layout shifts during loading */
img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

/* Optimize parallax and scroll effects */
[data-parallax],
.parallax {
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

/* Smooth loader transitions */
.loader-wrapper {
    transition: opacity 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Optimize navigation menu animations */
.hendre_nav_manu,
.hendre_menu {
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Prevent flickering on hover effects */
.service-single-box,
.portfolio-single-box,
.blog-single-box,
[class*="single-box"] {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}
