/* Extra Large Devices (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 1.25rem;
    }
    
    .navbar-cta .phone-btn .d-none {
        display: inline !important;
    }
}

/* Large Devices (1200px and up) */
@media (min-width: 1200px) {
    .section-title {
        font-size: 2.75rem;
    }
    
    .hero-section h1 {
        font-size: 3.5rem;
    }
    
    .navbar-nav {
        flex-grow: 0;
    }
    
    .navbar-cta {
        margin-left: 1rem;
    }
}

/* Medium Devices (992px and up) */
@media (min-width: 992px) {
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }
    
    .service-card {
        padding: 2.5rem;
    }
    
    .testimonial-card {
        padding: 2.5rem;
    }
    
    .navbar-collapse {
        justify-content: space-between;
    }
}

/* Navbar adjustments for screens below 1400px */
@media (max-width: 1399.98px) {
    .navbar-cta .phone-btn .d-none.d-xxl-inline {
        display: none !important;
    }
}

/* Hide CTA section on tablets and smaller */
@media (max-width: 1199.98px) {
    .navbar-cta {
        display: none !important;
    }
}

/* Small Devices (768px and up) */
@media (min-width: 768px) {
    .hero-section {
        padding-top: 120px;
    }
    
    .section-title {
        font-size: 2.25rem;
    }
    
    .hero-section h1 {
        font-size: 3rem;
    }
}

/* Extra Small Devices (576px and up) */
@media (min-width: 576px) {
    .btn {
        padding: 0.875rem 2rem;
    }
    
    .service-icon {
        width: 90px;
        height: 90px;
    }
    
    .service-icon i {
        font-size: 2.25rem;
    }
}

/* Mobile Devices (767px and down) */
@media (max-width: 767.98px) {
    /* Navigation */
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar-collapse {
        background: white;
        border-radius: 0.5rem;
        box-shadow: var(--shadow-medium);
        padding: 1rem;
        margin-top: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    
    .dropdown-menu {
        background: var(--light-gray);
        border-radius: 0.5rem;
        margin-top: 0.5rem;
    }
    
    /* Hero Section */
    .hero-section {
        padding-top: 100px;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2.25rem;
        margin-bottom: 1rem;
    }
    
    .hero-section .lead {
        font-size: 1.125rem;
        margin-bottom: 2rem;
    }
    
    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 250px;
    }
    
    .hero-stats {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
    
    .hero-stats h3 {
        font-size: 1.5rem;
    }
    
    .hero-image {
        margin-top: 2rem;
    }
    
    /* Sections */
    .section-title {
        font-size: 1.875rem;
        text-align: center;
    }
    
    .section-subtitle {
        font-size: 1rem;
        text-align: center;
        margin-bottom: 2rem;
    }
    
    /* Service Cards */
    .service-card {
        padding: 1.5rem;
        margin-bottom: 2rem;
        text-align: center;
    }
    
    .service-icon {
        width: 70px;
        height: 70px;
        margin: 0 auto 1.5rem;
    }
    
    .service-icon i {
        font-size: 1.75rem;
    }
    
    .service-content h4 {
        font-size: 1.125rem;
    }
    
    .service-image img {
        height: 180px;
    }
    
    /* Features */
    .feature-item {
        text-align: left;
        margin-bottom: 1.5rem;
    }
    
    .why-choose-image {
        margin-top: 2rem;
        text-align: center;
    }
    
    /* Testimonials */
    .testimonial-card {
        padding: 1.5rem;
        margin-bottom: 2rem;
        text-align: center;
    }
    
    /* Call to Action */
    .cta-section {
        text-align: center;
    }
    
    .cta-section .row > div {
        margin-bottom: 2rem;
    }
    
    .cta-section .row > div:last-child {
        margin-bottom: 0;
    }
    
    /* Footer */
    .footer-widget {
        margin-bottom: 2rem;
        text-align: center;
    }
    
    .footer-widget h5 {
        margin-bottom: 1rem;
    }
    
    .social-links {
        margin-top: 1rem;
    }
    
    .contact-item {
        justify-content: center;
        text-align: center;
    }
    
    .newsletter-form {
        margin-bottom: 2rem;
    }
    
    .newsletter-form .input-group {
        flex-direction: column;
    }
    
    .newsletter-form .form-control {
        border-radius: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .newsletter-form .btn {
        border-radius: 0.5rem;
    }
    
    /* Back to Top */
    #backToTop {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    /* Utilities */
    .py-5 {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }
    
    .mb-5 {
        margin-bottom: 2.5rem;
    }
    
    .mt-5 {
        margin-top: 2.5rem;
    }
}

/* Small Mobile Devices (480px and down) */
@media (max-width: 479.98px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-section h1 {
        font-size: 1.875rem;
    }
    
    .section-title {
        font-size: 1.625rem;
    }
    
    .service-card {
        padding: 1.25rem;
    }
    
    .testimonial-card {
        padding: 1.25rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .hero-stats h3 {
        font-size: 1.25rem;
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
    }
    
    .service-icon i {
        font-size: 1.5rem;
    }
}

/* Landscape Mobile Devices */
@media (max-width: 767.98px) and (orientation: landscape) {
    .hero-section {
        padding-top: 80px;
        padding-bottom: 2rem;
    }
    
    .hero-section .min-vh-100 {
        min-height: auto;
    }
    
    .hero-stats {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .hero-section,
    .cta-section,
    footer,
    #backToTop,
    #preloader {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    .service-card,
    .testimonial-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --secondary-color: #000080;
        --text-color: #000000;
        --border-color: #000000;
    }
    
    .service-card,
    .testimonial-card {
        border: 2px solid var(--border-color);
    }
    
    .btn {
        border-width: 2px;
    }
}

/* 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;
    }
    
    .service-card:hover,
    .testimonial-card:hover,
    .btn:hover,
    .hover-lift:hover {
        transform: none;
    }
}

/* Focus Styles for Accessibility */
.btn:focus,
.nav-link:focus,
.form-control:focus,
.dropdown-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to Content Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 10000;
}

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