/* Performance optimizations */

/* Remove heavy will-change from static elements */
.glass-spatial { will-change: auto !important; }

/* Smooth transitions for modals */
[style*="display:flex"].glass-spatial { 
    animation: modalIn 0.15s cubic-bezier(0.16, 1, 0.3, 1); 
}
@keyframes modalIn { 
    from { opacity: 0; transform: scale(0.97); } 
    to { opacity: 1; transform: scale(1); } 
}

/* Optimize button clicks */
.btn-spatial { 
    will-change: transform; 
    transition: transform 0.1s ease-out, opacity 0.15s ease, background 0.15s ease; 
}
.btn-spatial:active { transform: scale(0.96); transition-duration: 0.05s; }

/* Optimize nav transitions */
.sidebar-nav a { transition: all 0.12s ease-out; }

/* Smooth scroll for content area */
main { scroll-behavior: smooth; }

/* Optimize image rendering */
img { image-rendering: auto; }
.lazy-image { opacity: 0; transition: opacity 0.3s ease; }
.lazy-image.loaded { opacity: 1; }

/* Reduce reflow for animations */
.animate-fade-up { 
    will-change: opacity, transform;
    backface-visibility: hidden;
}

/* Optimize glass-spatial hover */
.glass-spatial { 
    transition: box-shadow 0.2s ease, border-color 0.2s ease; 
}
.glass-spatial:hover { 
    box-shadow: 0 12px 40px rgba(0,0,0,0.5); 
}

/* Debounce search input */
#globalSearch { transition: border-color 0.15s ease, box-shadow 0.15s ease; }
#globalSearch:focus { transition-duration: 0.08s; }

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

/* Reduce paint complexity */
.sidebar-nav { content-visibility: auto; contain-intrinsic-size: 0 600px; }

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