/* Performance Optimization CSS */

/* Critical above-the-fold styles */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 9999;
    transition: opacity 0.3s ease-out;
}

.loader-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Optimize images */
img {
    max-width: 100%;
    height: auto;
}

/* Reduce layout shifts */
.banner-bg {
    position: relative;
    background-size: cover;
    background-position: center;
    min-height: 400px;
}

/* Optimize animations */
.animated {
    will-change: transform, opacity;
}

/* Reduce paint operations */
header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    will-change: transform;
}

/* Optimize carousel */
.carousel {
    will-change: transform;
}

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

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

/* Lazy loading placeholder */
.lazy-placeholder {
    background: #f0f0f0;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Optimize buttons */
.btn {
    will-change: transform;
    transition: transform 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Reduce JavaScript execution time */
.no-js .js-only {
    display: none;
}

/* Optimize modals */
.modal {
    will-change: opacity;
}

/* Reduce DOM queries */
.cached-selector {
    contain: layout style;
}

/* Optimize scroll performance */
.scroll-optimized {
    will-change: scroll-position;
}

/* Reduce memory usage */
.cleanup {
    contain: layout style paint;
} 