/* SEO and Performance Enhancements for DRC Assist */

/* Performance optimizations */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Improve perceived performance */
.lazyload {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazyloaded {
    opacity: 1;
}

/* Critical above-the-fold styles */
.hero-section {
    contain: layout style paint;
    will-change: transform;
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Improve Core Web Vitals */
.card, .btn {
    contain: layout style;
}

/* Reduce layout shift */
.hero-section .container {
    min-height: 400px;
    display: flex;
    align-items: center;
}

/* Font loading optimization */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Inter Regular'), local('Inter-Regular'),
         url('https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Structured data styling */
.breadcrumb-schema {
    position: absolute;
    left: -9999px;
    visibility: hidden;
}

/* SEO-friendly headings hierarchy */
.seo-h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--bs-heading-color);
}

.seo-h2 {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--bs-heading-color);
}

.seo-h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--bs-heading-color);
}

/* Semantic content containers */
.content-section {
    margin: 3rem 0;
    padding: 2rem 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

/* Accessibility and SEO improvements */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Skip links for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--bs-primary);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 6px;
}

/* Focus indicators */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Schema.org structured data styling */
.organization-schema,
.service-schema,
.breadcrumb-schema {
    display: none !important;
    visibility: hidden !important;
}

/* Page speed optimizations */
.critical-css {
    contain: strict;
    content-visibility: auto;
}

/* Reduce repaint/reflow */
.card-img-top {
    aspect-ratio: 16/9;
    object-fit: cover;
    background-color: var(--bs-gray-200);
}

/* Local business schema styling */
.business-info {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-secondary) 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.business-info h3 {
    color: white;
    margin-bottom: 1rem;
}

.business-info .contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* FAQ schema styling */
.faq-section {
    margin: 3rem 0;
}

.faq-item {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
}

.faq-question {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--bs-heading-color);
}

.faq-answer {
    color: var(--bs-body-color);
    line-height: 1.6;
}

/* CTA sections for conversion optimization */
.cta-section {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-secondary) 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 12px;
    text-align: center;
    margin: 3rem 0;
}

.cta-section h2 {
    color: white;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-section .btn {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Testimonial schema styling */
.testimonial-section {
    background: var(--bs-gray-50);
    padding: 3rem 0;
    margin: 3rem 0;
    border-radius: 12px;
}

.testimonial {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.testimonial-content {
    font-style: italic;
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--bs-body-color);
}

.testimonial-author {
    font-weight: 600;
    color: var(--bs-primary);
}

.testimonial-role {
    font-size: 0.875rem;
    color: var(--bs-text-muted);
    margin-top: 0.25rem;
}

/* Service areas for local SEO */
.service-areas {
    background: var(--bs-light);
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.service-areas h3 {
    margin-bottom: 1rem;
    color: var(--bs-heading-color);
}

.service-areas .location-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.service-areas .location-list li {
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    text-align: center;
    font-size: 0.875rem;
}

/* Performance monitoring helpers */
.performance-mark {
    display: none !important;
}

/* Print styles for better SEO */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .card {
        page-break-inside: avoid;
    }
}

/* Dark mode SEO considerations */
@media (prefers-color-scheme: dark) {
    .business-info {
        background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    }
    
    .testimonial-section {
        background: var(--bs-dark);
    }
    
    .testimonial {
        background: var(--bs-gray-800);
        color: var(--bs-light);
    }
    
    .service-areas {
        background: var(--bs-gray-800);
    }
    
    .service-areas .location-list li {
        background: var(--bs-gray-700);
        color: var(--bs-light);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .card {
        border: 2px solid var(--bs-border-color);
    }
    
    .form-control {
        border: 2px solid var(--bs-border-color);
    }
}