/**
 * Performance Optimization CSS
 * Reduces animations and improves rendering performance
 */

/* DISABLE ALL ANIMATIONS FOR BETTER PERFORMANCE */
*,
*::before,
*::after {
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.1s !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
}

/* Disable infinite animations completely */
* {
    animation-iteration-count: 1 !important;
}

/* Disable all infinite animations specifically */
[style*="animation"],
*[class*="float"],
*[class*="pulse"],
*[class*="rotate"],
*[class*="shimmer"],
*[class*="glow"] {
    animation: none !important;
}

/* Disable background animations */
body::before,
body::after,
.hero-bg-orb,
.trust-glow-orb,
.cta-glow-orb,
.search-hero-bg-1,
.search-hero-bg-2,
.search-hero-bg-3 {
    animation: none !important;
}

/* Disable background animations */
body {
    animation: none !important;
}

body::before,
body::after {
    animation: none !important;
}

/* Disable floating animations */
.search-hero-bg-1,
.search-hero-bg-2,
.search-hero-bg-3,
.hero-bg-orb,
.trust-glow-orb,
.cta-glow-orb {
    animation: none !important;
}

/* All keyframe animations are disabled via animation: none !important above */

/* Reduce motion for better performance */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0s !important;
        scroll-behavior: auto !important;
    }
}

/* Optimize animations - use transform and opacity only */
.product-card {
    transform: translateZ(0); /* Force GPU acceleration */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Only enable will-change on hover to save memory */
.product-card:hover {
    will-change: transform;
}

/* Reduce expensive filters - remove filter completely */
.product-card:hover .product-image img {
    transform: scale(1.03); /* Reduced further */
    transition: transform 0.15s ease;
}

/* Optimize backdrop-filter usage - reduce or disable */
.product-overlay {
    backdrop-filter: blur(0.5px); /* Further reduced */
    -webkit-backdrop-filter: blur(0.5px);
}

/* Disable expensive animations on low-end devices */
@media (max-width: 768px) {
    .product-card:hover .product-image img {
        transform: none;
        filter: none;
    }
    
    .product-overlay {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* Optimize hover effects - only enable will-change on hover */
.trust-card-premium,
.cta-btn-premium,
.how-it-works-item {
    transform: translateZ(0);
}

.trust-card-premium:hover,
.cta-btn-premium:hover,
.how-it-works-item:hover {
    will-change: transform;
}

/* Reduce animation complexity */
@keyframes trustFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

/* Optimize gradient animations - reduce will-change usage */
.hero-bg-orb,
.trust-glow-orb,
.cta-glow-orb {
    transform: translateZ(0);
    animation-play-state: running;
}

/* Disable expensive effects on mobile */
@media (max-width: 768px) {
    .hero-bg-orb,
    .trust-glow-orb,
    .cta-glow-orb {
        display: none;
    }
}

/* Optimize image rendering - especially for favicons */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -ms-interpolation-mode: bicubic;
}

/* Favicon images in page content - optimize for sharp display */
img[src*="favicon"],
img[alt*="favicon"],
.hero-logo-mobile,
img[src*="favicon_"] {
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: crisp-edges !important;
    -ms-interpolation-mode: nearest-neighbor !important;
    image-rendering: pixelated !important;
    image-rendering: -moz-crisp-edges !important;
}

/* Lazy loading placeholder */
img[loading="lazy"] {
    background: var(--bg-secondary);
    min-height: 200px;
}

/* Optimize font loading */
@font-face {
    font-display: swap; /* Show fallback font immediately */
}

/* Reduce repaints */
.stats-section-modern,
.cta-section-premium {
    contain: layout style paint;
}

/* Optimize scroll performance */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Optimize transitions - reduce duration for better responsiveness */
.product-card,
.trust-card-premium,
.cta-btn-premium,
.how-it-works-item,
.category-card {
    transition-property: transform, opacity;
    transition-duration: 0.1s !important;
    transition-timing-function: ease !important;
}

/* Disable hover transforms on mobile */
@media (max-width: 768px) {
    *:hover {
        transform: none !important;
    }
}

/* Disable expensive box-shadows on mobile */
@media (max-width: 768px) {
    * {
        box-shadow: none !important;
    }
    
    .product-card,
    .stat-card-modern,
    .trust-card-premium {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }
}

/* All keyframe animations are disabled above */

/* Optimize scroll performance - disable smooth scroll */
html {
    scroll-behavior: auto !important;
}

/* Disable all animations on low-end devices */
@media (max-width: 1024px) {
    * {
        animation: none !important;
        transition-duration: 0.05s !important;
    }
}

