/* Performance Optimizations CSS */

/* Disable heavy animations during page load */
body.loading * {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
}

/* Optimize rendering */
* {
    will-change: auto !important;
}

/* Prevent layout shifts */
img, video, iframe {
    aspect-ratio: attr(width) / attr(height);
    max-width: 100%;
    height: auto;
}

/* Optimize scrolling */
html {
    scroll-behavior: auto !important; /* Disable smooth scrolling temporarily */
}

/* Hide elements that cause reflows */
.loading-spinner,
.loader,
.spinner {
    display: none !important;
}

/* Optimize font loading */
body {
    font-display: swap;
}

/* Reduce paint areas */
.sidebar {
    contain: layout style paint;
}

.card {
    contain: layout style;
}

/* Disable pointer events on hidden elements */
[hidden], 
.d-none,
.hidden {
    pointer-events: none !important;
}

/* Force GPU acceleration for transforms */
.modal,
.dropdown-menu,
.sidebar {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Optimize table rendering */
table {
    table-layout: auto;
}

/* Reduce repaints on hover */
a, button {
    will-change: auto;
}

/* Emergency override for frozen pages */
body.unfreeze * {
    animation: none !important;
    transition: none !important;
}
