/* Performance Optimization CSS - SEO Mastery Hub */

/* Preload critical resources */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* Optimize font loading */
@font-face {
    font-family: 'Inter';
    font-display: swap;
    src: url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
}

/* Critical CSS - Above the fold styles */
.critical-styles {
    /* Hero section optimization */
    .hero-gradient {
        background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
        will-change: transform;
    }
    
    /* Optimize animations */
    .hover-transition {
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform, opacity;
    }
    
    /* Reduce layout shift */
    .content-placeholder {
        min-height: 200px;
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
    }
}

/* Optimize images */
img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

/* Reduce Cumulative Layout Shift (CLS) */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Optimize buttons for better FID */
button, .btn {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Optimize navigation */
.nav-link {
    position: relative;
    overflow: hidden;
}

/* Reduce paint operations */
.card {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Optimize dropdowns */
.dropdown-menu {
    transform: translateZ(0);
    will-change: transform, opacity;
}

/* Loading animation */
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Optimize for mobile */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    /* Reduce animations on mobile for better performance */
    .hover-transition {
        transition: none;
    }
}

/* Optimize for Core Web Vitals */
.content-visual {
    contain: layout style paint;
}

/* Reduce JavaScript execution time */
.js-optimized {
    contain: layout style;
}

/* Optimize for Largest Contentful Paint (LCP) */
.hero-title {
    font-display: swap;
    font-weight: 700;
    line-height: 1.2;
}

/* Optimize for First Input Delay (FID) */
.interactive-element {
    pointer-events: auto;
    touch-action: manipulation;
}

/* Optimize for Cumulative Layout Shift (CLS) */
.stable-layout {
    aspect-ratio: 16/9;
    width: 100%;
    height: auto;
}

/* Preload critical images */
.preload-critical {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
} 