/* ===================================
   Driving Park - Responsive Styles
   =================================== */

/* Mobile First - Default Styles */
@media (max-width: 767px) {
    :root {
        --header-height: 70px;
        --spacing-md: 1.5rem;
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    /* Header */
    .mobile-menu-btn {
        display: block;
    }

    .nav-list {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: var(--color-secondary);
        flex-direction: column;
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .nav-list.active {
        transform: translateY(0);
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 1rem;
        text-align: center;
    }

    /* Hero */
    .hero {
        height: auto;
        min-height: 100vh;
        padding: var(--spacing-lg) 0;
    }

    .hero-content {
        padding: var(--spacing-md);
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    /* Section */
    .section {
        padding: var(--spacing-lg) 0;
    }

    /* About */
    .about-content {
        grid-template-columns: 1fr;
    }

    .about-stats {
        grid-template-columns: 1fr;
    }

    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }

    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
    }

    .social-links {
        justify-content: center;
    }
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 1024px) {
    :root {
        --header-height: 80px;
        --spacing-md: 2rem;
        --spacing-lg: 3.5rem;
        --spacing-xl: 5rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .container {
        padding: 0 var(--spacing-md);
    }

    /* Hero */
    .hero-title {
        font-size: 3rem;
    }

    /* About */
    .about-content {
        grid-template-columns: 1fr 1fr;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Contact */
    .contact-content {
        grid-template-columns: 1fr 1fr;
    }
}

/* Desktop Styles */
@media (min-width: 1025px) {
    :root {
        --header-height: 80px;
        --spacing-md: 2rem;
        --spacing-lg: 4rem;
        --spacing-xl: 6rem;
    }

    /* Hero */
    .hero-title {
        font-size: 3.5rem;
    }

    /* About */
    .about-content {
        grid-template-columns: 1fr 1fr;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Services */
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Contact */
    .contact-content {
        grid-template-columns: 1fr 1fr;
    }
}

/* Large Desktop */
@media (min-width: 1441px) {
    :root {
        --container-width: 1400px;
    }

    .container {
        padding: 0 var(--spacing-lg);
    }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimized for high-resolution displays */
}

/* Print Styles */
@media print {
    .header,
    .hero,
    .footer,
    .btn {
        display: none;
    }

    .section {
        page-break-inside: avoid;
    }

    body {
        font-size: 12pt;
    }
}

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

    html {
        scroll-behavior: auto;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #1A1A1A;
        --color-text: #E0E0E0;
        --color-text-light: #B0B0B0;
    }

    .hero-bg {
        background: linear-gradient(135deg, rgba(26, 26, 26, 0.9), rgba(26, 26, 26, 0.7)),
                    url('https://images.unsplash.com/photo-1568605114967-8130f3a36994?w=1920') center/cover;
    }

    .hero-overlay {
        background: linear-gradient(135deg, rgba(26, 26, 26, 0.8), rgba(26, 26, 26, 0.6));
    }
}

/* Accessibility - Focus Styles */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Accessibility - Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background-color: var(--color-primary);
    color: var(--color-secondary);
    padding: 1rem;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* Accessibility - High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #FFD700;
        --color-secondary: #000000;
        --color-accent: #FF0000;
        --color-background: #FFFFFF;
        --color-text: #000000;
        --color-text-light: #000000;
    }

    .service-card,
    .contact-form {
        border: 2px solid #000000;
    }
}

/* Accessibility - Reduced Contrast Mode */
@media (prefers-contrast: less) {
    :root {
        --color-primary: #FFD700;
        --color-secondary: #333333;
        --color-accent: #E63946;
        --color-background: #FFFFFF;
        --color-text: #333333;
        --color-text-light: #666666;
    }
}

/* Loading States */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Error States */
.error {
    border-color: var(--color-accent) !important;
}

/* Success States */
.success {
    border-color: #4CAF50 !important;
}

/* Form Validation */
input:invalid,
textarea:invalid {
    border-color: var(--color-accent);
}

input:valid,
textarea:valid {
    border-color: #4CAF50;
}

/* Image Optimization */
img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* Lazy Loading */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Performance - Critical CSS Inlining */
/* This section should be inlined in the head for faster initial render */

/* Performance - Preload */
@font-face {
    font-family: 'Oswald';
    font-display: swap;
    font-weight: 400;
    src: local('Oswald'), url('https://fonts.gstatic.com/s/oswald/v53/ROTvZ-4qW57QJ37YJ7K7Q.woff2') format('woff2');
}

@font-face {
    font-family: 'Roboto';
    font-display: swap;
    font-weight: 300;
    src: local('Roboto Light'), url('https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmSU5fBBc4.woff2') format('woff2');
}

@font-face {
    font-family: 'Roboto';
    font-display: swap;
    font-weight: 400;
    src: local('Roboto'), url('https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4mxK.woff2') format('woff2');
}

@font-face {
    font-family: 'Roboto';
    font-display: swap;
    font-weight: 500;
    src: local('Roboto Medium'), url('https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfBBc4.woff2') format('woff2');
}

@font-face {
    font-family: 'Roboto';
    font-display: swap;
    font-weight: 700;
    src: local('Roboto Bold'), url('https://fonts.gstatic.com/s/roboto/v30/KFOlCnqEu92Fr1MmWUlfBBc4.woff2') format('woff2');
}

/* Performance - Preconnect */
preconnect {
    connection: high;
}