/* ========================================
   PERFORMANCE OPTIMIZATION CSS (No Lazy Loading)
   Fast Loading & Smooth Performance
   ======================================== */

/* 1. Image Optimization */
img {
    max-width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* 2. Reduce animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 3. Optimize carousel images */
.header-carousel img,
.owl-carousel img {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* 4. GPU Acceleration for smoother animations */
.wow,
.animated,
.fadeIn,
.fadeInUp,
.fadeInDown,
.fadeInLeft,
.fadeInRight {
    will-change: opacity, transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* 5. Optimize hover effects */
.service-item img,
.blog-item img,
.team-item img {
    will-change: transform;
    transform: translateZ(0);
}

/* 6. Reduce repaints */
.btn,
.nav-link,
a {
    will-change: color, background-color;
}

/* 7. Critical CSS - Above the fold optimization */
#spinner:not(.show) {
    display: none !important;
}

/* 8. Font loading optimization */
body {
    font-display: swap;
}

/* 9. Reduce box-shadow blur for better performance */
.service-item:hover,
.blog-item:hover {
    box-shadow: 0 0 30px rgba(0, 0, 0, .1) !important;
}

/* 10. Optimize footer animations */
.contact-img::after {
    animation-duration: 15s;
}

/* 11. Prevent unnecessary reflows */
* {
    box-sizing: border-box;
}

/* 12. Optimize video and iframe loading */
iframe {
    loading: eager;
}

/* 13. Reduce opacity transitions */
.fade {
    transition: opacity 0.15s linear;
}

/* 14. Optimize background images */
.bg-breadcrumb {
    background-attachment: scroll;
}

/* 15. Reduce motion for better performance */
.wow {
    animation-duration: 0.6s !important;
}

/* 16. Critical path optimization */
.topbar,
.navbar {
    contain: layout style;
}

/* 17. Optimize forms */
input,
textarea,
select {
    will-change: auto;
}

/* 18. Reduce blur effects */
.contact-img::after {
    filter: none;
}

/* 19. Optimize counter animations */
.counter-item {
    will-change: auto;
}

/* 20. Final performance tweaks */
@media (max-width: 768px) {
    /* Disable expensive effects on mobile */
    .service-item:hover img,
    .blog-item:hover img {
        transform: scale(1.05) !important;
    }
    
    /* Faster animations on mobile */
    * {
        transition-duration: 0.2s !important;
    }
}

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

/* 22. Optimize spinner removal */
#spinner {
    transition: opacity 0.3s ease-out;
}

/* 23. Preload images hint */
img {
    content-visibility: auto;
}
