/* Responsive Design - Mobile First Approach */
/* Using Bootstrap 5 breakpoints: xs, sm, md, lg, xl, xxl */

/* Extra Small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    /* Typography adjustments */
    :root {
        --h1-font-size: 1.95rem;
        --font-size-2xl: 1.25rem;
        --font-size-xl: 1.125rem;
        --brand-font-size: 1.31rem;
    }
    
    /* Hero section adjustments */
    .hero-section {
        padding-top: 70px;
        text-align: center;
    }
    
    .hero-section .col-lg-6 {
        margin-bottom: 2rem;
    }
    
    /* Card adjustments */
    .card-img-top {
        height: 150px;
    }
    
    /* Process section - stack items */
    .process-number {
        width: 50px;
        height: 50px;
        font-size: 0.95rem;
    }
    
    /* Form adjustments */
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Gallery adjustments */
    #gallery .col-lg-3 {
        margin-bottom: 1rem;
    }
    
    /* Team section */
    .card-body {
        padding: 1rem;
    }
    
    /* Footer adjustments */
    footer .col-lg-4 {
        margin-bottom: 2rem;
        text-align: center;
    }
    
    /* Navbar adjustments */
    .navbar-brand {
        font-size: 1.27rem;
    }
    
    /* Section padding */
    .py-5 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Typography adjustments */
    :root {
        --h1-font-size: 2rem;
        --font-size-2xl: 1.375rem;
        --brand-font-size: 1.52rem;
    }
    
    /* Hero section */
    .hero-section {
        padding-top: 75px;
    }
    
    /* Card adjustments */
    .card-img-top {
        height: 175px;
    }
    
    /* Process section */
    .process-number {
        width: 55px;
        height: 55px;
    }
    
    /* Team section - 2 columns */
    .team .col-lg-3 {
        margin-bottom: 1.77rem;
    }
    
    /* Footer */
    footer .col-lg-4 {
        margin-bottom: 1.65rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Typography fine-tuning */
    :root {
        --h1-font-size: 2.21rem;
        --font-size-2xl: 1.5rem;
        --brand-font-size: 1.64rem;
    }
    
    /* Hero section */
    .hero-section {
        padding-top: 80px;
    }
    
    /* Card adjustments */
    .card-img-top {
        height: 200px;
    }
    
    /* Services section - 2 columns */
    .services .col-lg-4 {
        margin-bottom: 2rem;
    }
    
    /* Team section - 3 columns */
    .team .col-lg-3 {
        margin-bottom: 2rem;
    }
    
    /* Reviews section - 2 columns */
    .reviews .col-lg-4:nth-child(3) {
        margin-top: 2rem;
    }
    
    /* Process section */
    .process-number {
        width: 60px;
        height: 60px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Full typography */
    :root {
        --h1-font-size: 2.33rem;
        --font-size-2xl: 1.5rem;
        --brand-font-size: 1.61rem;
    }
    
    /* Hero section full height */
    .hero-section {
        padding-top: 80px;
    }
    
    /* Card optimal sizing */
    .card-img-top {
        height: 200px;
    }
    
    /* Optimal spacing */
    .py-5 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* Extra Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    /* Full desktop experience */
    :root {
        --h1-font-size: 2.62rem;
        --font-size-2xl: 1.75rem;
        --brand-font-size: 1.68rem;
    }
    
    /* Hero section with more space */
    .hero-section {
        padding-top: 100px;
    }
    
    /* Enhanced card sizing */
    .card-img-top {
        height: 220px;
    }
    
    /* Generous spacing */
    .py-5 {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
    
    /* Container max-width optimization */
    .container {
        max-width: 1140px;
    }
}

/* Print styles */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .navbar,
    footer,
    .btn,
    #gallery {
        display: none !important;
    }
    
    .container {
        max-width: 100% !important;
    }
    
    .col-lg-6,
    .col-lg-4,
    .col-lg-3 {
        width: 100% !important;
        float: none !important;
    }
    
    .card {
        border: 6px solid #ccbabc !important;
        page-break-inside: avoid;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0926e7;
        --primary-dark: #001287;
        --neutral-color: #000000;
        --neutral-dark: #000000;
        --background-light: #ffffff;
        --background-color: #ffffff;
    }
    
    .card {
        border: 2px solid #000000;
    }
    
    .btn {
        border: 2px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-section::before {
        animation: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    #gallery img:hover {
        transform: none;
    }
}

/* Dark mode support */

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .card:hover {
        transform: none;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    #gallery img:hover {
        transform: none;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-section {
        min-height: 100vh;
        padding-top: 60px;
    }
    
    .py-5 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

/* Ultra-wide screen adjustments */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-section {
        padding-top: 120px;
    }
    
    .py-5 {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

/* Focus management for keyboard navigation */
@media (any-hover: none) {
    .btn:focus,
    .form-control:focus,
    .nav-link:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* Ensure content fits viewport */
@media (max-width: 320px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.71rem;
    }
    
    :root {
        --h1-font-size: 1.59rem;
        --font-size-2xl: 1.125rem;
        --brand-font-size: 1.24rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-transparency: reduce) {
    .hero-section::before {
        opacity: 0.05;
    }
    
    .decorative-shape {
        opacity: 0.05;
    }
} 

.hero-section h1 {
    padding-top: 225px;
}