/* Mobile First Responsive Design */

/* Extra Small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    h1 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    section {
        padding: 2rem 0;
    }
    
    #hero {
        min-height: 70vh;
        padding: 2rem 0;
    }
    
    .card-body {
        padding: 1rem;
    overflow-x: hidden;
}
    
    .btn {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Mobile navigation improvements */
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(108, 99, 255, 0.25);
    }
    
    /* Mobile form improvements */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Mobile gallery adjustments */
    #gallery .col-md-4 {
        margin-bottom: 1rem;
    }
    
    /* Disable animations on mobile for performance and accessibility */
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .card:hover {
        transform: none;
    }
    
    .card:hover .card-img-top {
        transform: none;
    }
    
    #gallery img:hover {
        transform: none;
    }
    
    .btn-primary:hover {
        transform: none;
    }
    
    #team img:hover {
        transform: none;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    section {
        padding: 2.5rem 0;
    }
    
    #hero {
        min-height: 80vh;
    }
    
    /* Disable scroll animations on small screens */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            transition-duration: 0.01ms !important;
        }
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .navbar-brand {
        font-size: 1.4rem;
    }
    
    h1 {
        font-size: 2.25rem;
    }
    
    h2 {
        font-size: 1.9rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    #hero {
        min-height: 85vh;
    }
    
    .card-img-top {
        height: 180px;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    section {
        padding: 4rem 0;
    }
    
    #hero {
        min-height: 90vh;
    }
    
    .card-img-top {
        height: 200px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    h1 {
        font-size: 2.75rem;
    }
    
    h2 {
        font-size: 2.25rem;
    }
    
    section {
        padding: 5rem 0;
    }
    
    #hero {
        min-height: 100vh;
    }
    
    .card-img-top {
        height: 220px;
    }
}

/* Accessibility and Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    #hero::before {
        animation: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .card:hover .card-img-top {
        transform: none;
    }
    
    #gallery img:hover {
        transform: none;
    }
    
    .btn-primary:hover {
        transform: none;
    }
    
    #team img:hover {
        transform: none;
    }
    
    .timeline-item:hover {
        transform: none;
    }
    
    .case-study:hover {
        transform: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn-primary {
        background: #000;
        color: #fff;
        border: 2px solid #000;
    }
    
    .btn-primary:hover {
        background: #333;
        border-color: #333;
    }
    
    #header {
        background: #fff;
        border-bottom: 2px solid #000;
    }
    
    #footer {
        background: #000;
        color: #fff;
    }
}

/* Print Styles */
@media print {
    #header,
    #footer,
    .navbar,
    .btn {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    a {
        color: #000 !important;
        text-decoration: underline;
    }
}

/* Focus Management */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 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: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .card:hover {
        transform: none;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    }
    
    .btn {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    #hero {
        min-height: 100vh;
        padding: 1rem 0;
    }
    
    section {
        padding: 2rem 0;
    }
}

/* Dark mode support (if system preference) */

/* Reduced data mode */
@media (prefers-reduced-data: reduce) {
    #hero::before {
        display: none;
    }
    
    .card-img-top {
        background-color: var(--bg-light);
    }
}

/* Container queries for modern browsers */
@supports (container-type: inline-size) {
    .card-container {
        container-type: inline-size;
    }
    
    @container (max-width: 300px) {
        .card-body {
            padding: 0.75rem;
        }
        
        .card-title {
            font-size: 1rem;
        }
    }
} 