/* Mobile-First Responsive Design */

/* Extra Small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    /* Typography */
    .display-4 {
        font-size: 2rem;
    }
    
    .display-5 {
        font-size: 1.75rem;
    }
    
    .h2 {
        font-size: 1.5rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    /* Hero Section */
    #hero {
        min-height: 80vh;
        padding: 2rem 0;
    }
    
    #hero .container {
        text-align: center;
    }
    
    #hero .col-lg-6:first-child {
        margin-bottom: 2rem;
    }
    
    /* Navigation */
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
        text-align: center;
    }
    
    /* Sections */
    section {
        padding: 3rem 0;
    }
    
    /* Cards */
    .card-img-top {
        height: 180px;
    }
    
    /* Timeline */
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item::before {
        left: 20px;
    }
    
    .timeline-item .col-md-6 {
        padding-left: 3rem;
    }
    
    .timeline-item .col-md-6.offset-md-6 {
        margin-left: 0;
        padding-left: 3rem;
    }
    
    /* Team Section */
    .rounded-circle {
        width: 100px;
        height: 100px;
    }
    
    /* Process Section */
    .col-lg-2 {
        margin-bottom: 2rem;
    }
    
    /* Contact Form */
    .form-control {
        margin-bottom: 1rem;
    }
    
    /* Gallery */
    #gallery .col-lg-3 {
        margin-bottom: 1rem;
    }
    
    /* Buttons */
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Disable animations on mobile to improve performance */
    * {
        animation-duration: 0s;
        transition-duration: 0s;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .display-4 {
        font-size: 2.25rem;
    }
    
    .display-5 {
        font-size: 1.875rem;
    }
    
    #hero {
        min-height: 85vh;
    }
    
    .card-img-top {
        height: 190px;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item::before {
        left: 30px;
    }
    
    .timeline-item .col-md-6 {
        padding-left: 4rem;
    }
    
    .timeline-item .col-md-6.offset-md-6 {
        margin-left: 0;
        padding-left: 4rem;
    }
    
    .rounded-circle {
        width: 110px;
        height: 110px;
    }
    
    section {
        padding: 4rem 0;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .display-4 {
        font-size: 2.5rem;
    }
    
    .display-5 {
        font-size: 2rem;
    }
    
    #hero {
        min-height: 90vh;
    }
    
    .card-img-top {
        height: 200px;
    }
    
    .rounded-circle {
        width: 120px;
        height: 120px;
    }
    
    /* Timeline adjustments for tablet */
    .timeline::before {
        left: 50%;
    }
    
    .timeline-item::before {
        left: 50%;
    }
    
    .timeline-item .col-md-6 {
        padding-left: 1rem;
    }
    
    .timeline-item .col-md-6.offset-md-6 {
        padding-left: 1rem;
    }
    
    section {
        padding: 4.5rem 0;
    }
    
    /* Services grid optimization */
    .col-lg-4.col-md-6 {
        margin-bottom: 2rem;
    }
    
    /* Team members per row */
    .col-lg-2.col-md-4 {
        margin-bottom: 2rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    .display-4 {
        font-size: 2.75rem;
    }
    
    .display-5 {
        font-size: 2.25rem;
    }
    
    #hero {
        min-height: 100vh;
    }
    
    section {
        padding: 5rem 0;
    }
    
    .card-img-top {
        height: 220px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: var(--container-max-width);
    }
    
    .display-4 {
        font-size: 3rem;
    }
    
    .display-5 {
        font-size: 2.5rem;
    }
    
    #hero {
        min-height: 100vh;
    }
    
    section {
        padding: 6rem 0;
    }
    
    .card-img-top {
        height: 240px;
    }
    
    /* Enhanced spacing for large screens */
    .mb-5 {
        margin-bottom: 4rem;
    }
}

/* High-resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for high-DPI displays */
    .card-img-top,
    .rounded-circle,
    #gallery img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 600px) {
    #hero {
        min-height: 80vh;
        padding: 2rem 0;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .navbar {
        padding: 0.25rem 0;
    }
}

/* Print-specific responsive adjustments */
@media print {
    .container {
        max-width: none;
        width: 100%;
    }
    
    .col-lg-6, .col-md-6, .col-sm-6 {
        width: 48%;
        float: left;
        margin-right: 2%;
    }
    
    .col-lg-4, .col-md-4 {
        width: 32%;
        float: left;
        margin-right: 2%;
    }
    
    .col-lg-3, .col-md-3 {
        width: 23%;
        float: left;
        margin-right: 2%;
    }
    
    .col-12 {
        width: 100%;
        float: none;
    }
    
    section {
        padding: 1rem 0;
        page-break-inside: avoid;
    }
    
    .card {
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .timeline::before,
    .timeline-item::before {
        display: none;
    }
}

/* Dark mode support (if preferred) */

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    #gallery img:hover {
        transform: none;
    }
    
    .hover-lift:hover {
        transform: none;
    }
    
    #hero::before {
        display: none;
    }
}

/* Focus improvements for keyboard navigation */
@media (any-hover: none) {
    .card:hover,
    .btn:hover,
    #gallery img:hover {
        transform: none;
        box-shadow: none;
        filter: none;
    }
    
    .card:focus,
    .btn:focus,
    #gallery img:focus {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }
}

/* Specific breakpoint adjustments */

/* Between mobile and tablet */
@media (min-width: 480px) and (max-width: 767.98px) {
    .hero-content {
        padding: 2rem;
    }
    
    .card-deck .card {
        margin-bottom: 1.5rem;
    }
}

/* Between tablet and desktop */
@media (min-width: 900px) and (max-width: 1199.98px) {
    .services-grid .col-lg-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .services-grid .col-lg-4:nth-child(odd) {
        padding-right: 1rem;
    }
    
    .services-grid .col-lg-4:nth-child(even) {
        padding-left: 1rem;
    }
}

/* Ultra-wide screens */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    section {
        padding: 7rem 0;
    }
    
    .display-4 {
        font-size: 3.5rem;
    }
    
    .display-5 {
        font-size: 2.75rem;
    }
}

/* Container queries support (future-proofing) */
@supports (container-type: inline-size) {
    .card-container {
        container-type: inline-size;
    }
    
    @container (max-width: 300px) {
        .card .card-title {
            font-size: 1rem;
        }
        
        .card .card-text {
            font-size: 0.875rem;
        }
    }
} 

body {
    overflow-x: hidden;
}