/* Responsive CSS - Mobile First Approach */

/* Large Tablets and Small Desktops (992px) */
@media (max-width: 992px) {
    :root {
        --header-height: 70px;
        --section-padding: 60px 0;
    }

    .container {
        max-width: 960px;
    }

    /* Navigation */
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 80%;
        height: calc(100vh - var(--header-height));
        background-color: var(--background);
        box-shadow: var(--box-shadow-xl);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        transition: var(--transition);
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 0.75rem 0;
        font-size: 1.125rem;
    }

    .nav-cta {
        width: 100%;
        margin-top: 2rem;
    }

    .nav-cta .btn {
        width: 100%;
    }

    .nav-toggle {
        display: flex;
    }

    /* Hero Section */
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-text {
        max-width: 100%;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image {
        display: none;
    }

    /* Services Grid */
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }

    /* Projects Grid */
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }

    /* Contact Section */
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .footer-section {
        margin-bottom: 1rem;
    }
}

/* Tablets (768px) */
@media (max-width: 768px) {
    h1 {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }

    h2 {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    h3 {
        font-size: clamp(1.125rem, 4vw, 1.5rem);
    }

    .container {
        padding: 0 1.5rem;
    }

    /* Hero Section */
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }

    .hero-main-title {
        font-size: clamp(2rem, 7vw, 3rem);
    }

    .hero-description {
        font-size: 1.125rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    /* Buttons */
    .btn-lg {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
    }

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

    /* Projects */
    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* Form Grid */
    .form-grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-bottom-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
}

/* Mobile Devices (576px) */
@media (max-width: 576px) {
    :root {
        --header-height: 60px;
        --section-padding: 40px 0;
    }

    /* Typography */
    body {
        font-size: 0.95rem;
    }

    p {
        font-size: 0.95rem;
    }

    /* Header */
    .logo {
        font-size: 1.25rem;
    }

    .nav-menu {
        width: 90%;
    }

    /* Hero Section */
    .hero-content {
        padding: 2rem 0;
    }

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

    .hero-main-title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
        margin-bottom: 1rem;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
    }

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

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Section Headers */
    .section-header {
        margin-bottom: 2rem;
    }

    .section-subtitle {
        font-size: 0.75rem;
    }

    .section-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .section-description {
        font-size: 1rem;
    }

    /* Service Cards */
    .service-card {
        padding: 1.5rem;
    }

    .service-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .service-title {
        font-size: 1.25rem;
    }

    /* Project Cards */
    .project-image {
        height: 200px;
    }

    /* Testimonials */
    .testimonials-carousel {
        height: auto;
    }

    .testimonial-card {
        padding: 2rem 1.5rem;
    }

    .testimonial-text {
        font-size: 1.125rem;
    }

    /* CTA Section */
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .cta-buttons .btn {
        width: 100%;
    }

    /* Contact Info */
    .contact-info {
        padding: 0 1rem;
    }

    /* Footer */
    .footer {
        padding: 3rem 0 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-section {
        text-align: center;
    }

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

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form input,
    .newsletter-form .btn {
        width: 100%;
    }

    /* Back to Top Button */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* Toast */
    .toast {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* Small Mobile Devices (400px) */
@media (max-width: 400px) {
    .container {
        padding: 0 1rem;
    }

    .hero-main-title {
        font-size: 1.5rem;
    }

    .hero-stats {
        gap: 0.5rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.625rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* Landscape Mode Adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
    }

    .hero-content {
        padding: 1rem 0;
    }

    .hero-stats {
        display: none;
    }

    .nav-menu {
        height: 100vh;
    }
}

/* Print Styles */
@media print {
    /* Hide non-essential elements */
    .header,
    .hero-scroll-indicator,
    .back-to-top,
    .toast,
    .loading-spinner,
    .nav-toggle,
    .footer-social,
    .newsletter-form,
    .carousel-btn {
        display: none !important;
    }

    /* Adjust colors for print */
    body {
        color: #000;
        background: #fff;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    /* Page breaks */
    .section {
        page-break-inside: avoid;
    }

    /* Expand content */
    .container {
        max-width: 100%;
    }
}

/* High Resolution Displays */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    /* Sharper borders and shadows */
    .service-card,
    .project-card,
    .testimonial-card {
        box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.1), var(--box-shadow);
    }
}

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

    .hero-image-wrapper {
        animation: none;
    }

    .scroll-icon {
        animation: none;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-link,
    .btn,
    .social-link,
    .carousel-btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .service-card:hover,
    .project-card:hover,
    .btn:hover {
        transform: none;
        box-shadow: var(--box-shadow);
    }

    /* Improve scrolling performance */
    .nav-menu {
        -webkit-overflow-scrolling: touch;
    }
}