/* SEO and Performance Optimization CSS */

/* Lazy loading placeholder styles */
img[data-src] {
    background-color: #f8f9fa;
    background-image: linear-gradient(45deg, #f8f9fa 25%, transparent 25%),
                      linear-gradient(-45deg, #f8f9fa 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #f8f9fa 75%),
                      linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    min-height: 200px;
    display: block;
}

/* Smooth loading transition */
img.lazy-loaded {
    transition: opacity 0.3s ease-in-out;
}

/* Critical above-the-fold content optimization */
.hero-section {
    contain: layout style paint;
}

/* Optimize font loading */
@font-face {
    font-family: 'Primary';
    font-display: swap;
}

/* Reduce layout shift */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Optimize images for different screen sizes */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Breadcrumb SEO styling */
.breadcrumb-nav {
    background-color: #f8f9fa;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}

.breadcrumb {
    background-color: transparent;
    margin-bottom: 0;
    padding: 0;
    font-size: 14px;
}

.breadcrumb-item {
    color: #6c757d;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #6c757d;
    padding: 0 8px;
}

.breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #495057;
    font-weight: 500;
}

/* Heading hierarchy styles for better SEO */
h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    line-height: 1.3;
    margin-bottom: 0.875rem;
}

h3 {
    font-size: 1.5rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 1.25rem;
    line-height: 1.4;
    margin-bottom: 0.625rem;
}

h5 {
    font-size: 1.125rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

h6 {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

/* Responsive typography */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.375rem; }
    h4 { font-size: 1.125rem; }
}

/* Skip to content link for accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
}

.skip-to-content:focus {
    top: 6px;
}

/* Focus indicators for accessibility */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Optimize critical rendering path */
.above-fold {
    contain: layout style paint;
}

/* Reduce cumulative layout shift */
.container-fluid,
.container {
    contain: layout;
}

/* Performance optimizations for animations */
.animate-on-scroll {
    will-change: transform, opacity;
}

/* Optimize table rendering for mobile */
@media (max-width: 768px) {
    .table-responsive {
        border: none;
    }
    
    .table-responsive table {
        border: none;
    }
}

/* Print styles for SEO */
@media print {
    .no-print {
        display: none !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    .breadcrumb-nav {
        border-bottom: 1px solid #000;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .breadcrumb-nav {
        background-color: #343a40;
        color: #fff;
    }
    
    .breadcrumb-item {
        color: #adb5bd;
    }
    
    .breadcrumb-item a {
        color: #66b3ff;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .breadcrumb-item a {
        text-decoration: underline;
    }
    
    button,
    .btn {
        border: 2px solid;
    }
}
