/* CLS (Cumulative Layout Shift) Optimization CSS */

/* Prevent layout shifts in features section */
.features-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2rem !important;
    min-height: 400px !important;
    contain: layout style paint !important;
}

.feature-card {
    min-height: 300px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    contain: layout style !important;
    background: rgba(255, 255, 255, 0.05) !important;
    padding: 2rem !important;
    border-radius: 15px !important;
    text-align: center !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.feature-icon {
    width: 60px !important;
    height: 60px !important;
    margin: 0 auto 1rem auto !important;
    flex-shrink: 0 !important;
}

.feature-icon img {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block !important;
}

.feature-card h4 {
    min-height: 3.2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #4ecdc4 !important;
    font-size: 1.3rem !important;
    margin-bottom: 1rem !important;
}

.feature-card p {
    flex-grow: 1 !important;
    display: flex !important;
    align-items: center !important;
    color: rgba(255, 255, 255, 0.8) !important;
    line-height: 1.6 !important;
}

/* Prevent animation-triggered layout shifts */
.feature-card:hover {
    transform: translateY(-10px) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

/* Responsive CLS prevention */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr !important;
        min-height: auto !important;
    }
    
    .feature-card {
        min-height: 250px !important;
    }
}

/* Prevent scroll-reveal layout shifts */
.scroll-reveal {
    opacity: 1 !important;
    transform: none !important;
}

.scroll-reveal.revealed {
    opacity: 1 !important;
    transform: none !important;
}

/* Force stable layout for all containers */
.container {
    contain: layout style !important;
}

section {
    contain: layout style paint !important;
}

/* Prevent font loading layout shifts */
* {
    font-display: swap !important;
}

/* Ensure images don't cause layout shifts */
img {
    max-width: 100% !important;
    height: auto !important;
}

/* Prevent button layout shifts */
.btn {
    min-height: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Prevent navigation layout shifts */
.navbar {
    min-height: 80px !important;
}

.nav-container {
    min-height: 80px !important;
    display: flex !important;
    align-items: center !important;
}

/* Prevent hero section layout shifts */
.hero {
    min-height: 400px !important;
    display: flex !important;
    align-items: center !important;
}

.hero-container {
    min-height: 300px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

/* Prevent footer layout shifts */
.footer {
    min-height: 200px !important;
}

.footer-content {
    min-height: 150px !important;
}
