/* Performance Optimization CSS */

/* Hardware acceleration for animations */
.loader,
.loader-svg,
.header,
.mobile-nav,
.fade-in,
.slide-up,
.slide-in-left,
.slide-in-right,
.parallax {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Optimize scroll performance */
html {
    scroll-behavior: smooth;
}

/* Reduce paint and layout thrashing */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent-color);
    z-index: 10001;
    transition: width 0.1s ease;
    will-change: width;
}

/* Optimize image loading */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
}

/* Reduce repaints on hover */
.btn,
.nav-link,
.mobile-menu-toggle {
    will-change: transform, background-color, color;
}

/* Optimize animations */
@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;
    }
}

/* GPU acceleration for transforms */
.hero-content,
.feature-card,
.industry-card,
.product-card {
    transform: translateZ(0);
    will-change: transform;
}

/* Optimize font rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Reduce layout shifts */
.container {
    contain: layout style;
}

/* Optimize background images */
.hero-section,
.cta-section {
    background-attachment: scroll; /* Better performance than fixed */
}

/* Preload critical resources */
.critical-image {
    content-visibility: visible;
}

.lazy-image {
    content-visibility: auto;
    contain-intrinsic-size: 300px;
}

/* Optimize table layouts */
table {
    table-layout: fixed;
}

/* Reduce composite layers */
.floating-buttons {
    will-change: transform;
    transform: translateZ(0);
}

/* Optimize dropdown animations */
.dropdown-menu {
    will-change: opacity, visibility, transform;
    transform: translateZ(0);
}

/* Critical CSS for above-the-fold content */
.hero-section {
    contain: layout style paint;
}

/* Optimize mobile performance */
@media (max-width: 768px) {
    .parallax {
        transform: none !important; /* Disable parallax on mobile */
    }
    
    .loader-svg {
        width: 50px;
        height: 50px;
    }
    
    /* Reduce animation complexity on mobile */
    .fade-in,
    .slide-up,
    .slide-in-left,
    .slide-in-right {
        transition-duration: 0.2s;
    }
}

/* Optimize for low-end devices */
@media (max-width: 480px) {
    /* Disable complex animations on very small screens */
    .parallax,
    .complex-animation {
        animation: none !important;
        transform: none !important;
    }
    
    /* Simplify loader */
    .loader-svg {
        animation-duration: 1s;
    }
}

/* Content visibility optimization */
.section {
    content-visibility: auto;
    contain-intrinsic-size: 500px;
}

/* Optimize intersection observer targets */
.observe-target {
    contain: layout style paint;
}