/* ===== RESPONSIVE CSS - MOBILE FIRST APPROACH ===== */

/* ===== EXTRA SMALL DEVICES (PHONES) - UP TO 575PX ===== */
@media (max-width: 575.98px) {
    /* Typography Adjustments */
    h1 {
        font-size: 1.56rem !important;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.43rem !important;
    }
    
    h3 {
        font-size: 1.27rem !important;
    }
    
    /* Navigation */
    .navbar-brand {
        font-size: 1rem !important;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
        text-align: center;
    }
    
    /* Hero Section */
    .hero-section {
        padding-top: 70px;
        text-align: center;
    }
    
    .hero-section .col-lg-6:first-child {
        order: 2;
        margin-top: 2rem;
    }
    
    .hero-section .col-lg-6:last-child {
        order: 1;
    }
    
    /* Cards */
    .card-img-top {
        height: 120px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Buttons */
    .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.73rem;
    }
    
    .btn-group .btn {
        display: inline-block;
        width: auto;
    }
    
    /* Form Elements */
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Gallery */
    #gallery img {
        height: 120px;
        margin-bottom: 1rem;
    }
    
    /* Team Section */
    .col-lg-2.col-md-4 {
        margin-bottom: 2rem;
    }
    
    /* Sections */
    section {
        padding: 2rem 0;
    }
    
    /* Container Padding */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Footer */
    footer .col-lg-4 {
        text-align: center;
        margin-bottom: 2rem;
    }
}

/* ===== SMALL DEVICES (LANDSCAPE PHONES) - 576PX TO 767PX ===== */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Hero Section */
    .hero-section {
        padding-top: 80px;
    }
    
    /* Cards */
    .card-img-top {
        height: 150px;
    }
    
    /* Gallery */
    #gallery .col-6 {
        padding: 0.25rem;
    }
    
    #gallery img {
        height: 140px;
    }
    
    /* Team Members */
    .col-lg-2.col-md-4 img {
        width: 80px;
        height: 80px;
    }
    
    /* Process Steps */
    #process .col-lg-2 {
        margin-bottom: 1.60rem;
    }
    
    /* Timeline */
    #timeline .col-lg-2 {
        margin-bottom: 1rem;
    }
}

/* ===== MEDIUM DEVICES (TABLETS) - 768PX TO 991PX ===== */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Navigation */
    .navbar-brand {
        font-size: 1.25rem !important;
    }
    
    /* Hero Section */
    .hero-section {
        padding-top: 90px;
    }
    
    .hero-section img {
        max-height: 300px;
    }
    
    /* Cards */
    .card-img-top {
        height: 180px;
    }
    
    /* Gallery */
    #gallery img {
        height: 160px;
    }
    
    /* Services Grid */
    .services-grid .col-lg-4 {
        margin-bottom: 2rem;
    }
    
    /* Features Grid */
    .features-grid .col-lg-3 {
        margin-bottom: 1.66rem;
    }
    
    /* Team Section */
    .col-lg-2.col-md-4 {
        margin-bottom: 1.67rem;
    }
    
    /* Form Layout */
    .contact-form .col-md-6 {
        margin-bottom: 1rem;
    }
}

/* ===== LARGE DEVICES (DESKTOPS) - 992PX TO 1199PX ===== */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Hero Section */
    .hero-section img {
        max-height: 350px;
    }
    
    /* Cards */
    .card-img-top {
        height: 200px;
    }
    
    /* Gallery */
    #gallery img {
        height: 180px;
    }
    
    /* Container Max Width */
    .container {
        max-width: 960px;
    }
}

/* ===== EXTRA LARGE DEVICES (LARGE DESKTOPS) - 1200PX AND UP ===== */
@media (min-width: 1200px) {
    /* Hero Section */
    .hero-section img {
        max-height: 400px;
    }
    
    /* Cards */
    .card-img-top {
        height: 220px;
    }
    
    /* Gallery */
    #gallery img {
        height: 200px;
    }
    
    /* Container Max Width */
    .container {
        max-width: 1140px;
    }
    
    /* Large Text on Big Screens */
    .hero-section .lead {
        font-size: 1.32rem !important;
    }
}

/* ===== LANDSCAPE ORIENTATION ADJUSTMENTS ===== */
@media (orientation: landscape) and (max-height: 600px) {
    .hero-section {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
    
    section {
        padding: 2rem 0;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    /* Hide interactive elements */
    .navbar,
    .btn,
    .form-control,
    .form-select,
    footer,
    .breadcrumb {
        display: none !important;
    }
    
    /* Optimize for print */
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000000 !important;
        background: #FFFFFF !important;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #000000 !important;
        page-break-after: avoid;
    }
    
    .card {
        border: 1px solid #000000 !important;
        page-break-inside: avoid;
    }
    
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Page breaks */
    section {
        page-break-inside: avoid;
    }
    
    .card,
    .accordion-item {
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize images for retina displays */
    .hero-section::before {
        background-image: url('../SAF_images/hero-bg@2x.webp');
    }
}

/* ===== DARK MODE SUPPORT ===== */

/* ===== REDUCED MOTION PREFERENCES ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .card:hover {
        transform: none !important;
    }
    
    .btn:hover {
        transform: none !important;
    }
    
    #gallery img:hover {
        transform: none !important;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (pointer: coarse) {
    /* Larger touch targets */
    .btn {
        min-height: 44px;
        padding: 0.875rem 1.5rem;
    }
    
    .nav-link {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    .form-control,
    .form-select {
        min-height: 44px;
        padding: 0.875rem 1rem;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
    
    .btn:hover {
        transform: none;
    }
    
    #gallery img:hover {
        transform: none;
    }
}

/* ===== SPECIFIC COMPONENT RESPONSIVE ADJUSTMENTS ===== */

/* Services Grid Responsive */
@media (max-width: 991.98px) {
    #services .row.g-4.mt-4 {
        margin-top: 1rem !important;
    }
    
    #services .col-lg-4:nth-child(4),
    #services .col-lg-4:nth-child(5),
    #services .col-lg-4:nth-child(6) {
        margin-top: 2rem;
    }
}

/* Timeline Responsive */
@media (max-width: 767.98px) {
    #timeline .col-lg-2 {
        margin-bottom: 1rem;
    }
    
    #timeline .card {
        margin-bottom: 1rem;
    }
}

/* Process Steps Responsive */
@media (max-width: 991.98px) {
    #process .col-lg-2 {
        margin-bottom: 2rem;
    }
}

/* Team Section Responsive */
@media (max-width: 767.98px) {
    #team .row.g-4 {
        text-align: center;
    }
    
    #team .col-lg-2 {
        margin-bottom: 2rem;
    }
}

/* FAQ Accordion Responsive */
@media (max-width: 575.98px) {
    .accordion-button {
        font-size: 1.00rem;
        padding: 0.75rem 1rem;
    }
    
    .accordion-body {
        padding: 1rem;
    }
}

/* Contact Form Responsive */
@media (max-width: 767.98px) {
    #contacts .col-lg-8 {
        padding: 0 1rem;
    }
    
    #contacts .row.mt-5 .col-lg-4 {
        margin-bottom: 2rem;
        text-align: center;
    }
}

/* Blog Grid Responsive */
@media (max-width: 991.98px) {
    #Blog .col-lg-4 {
        margin-bottom: 2rem;
    }
}

/* Gallery Responsive Grid */
@media (max-width: 575.98px) {
    #gallery .col-lg-3 {
        padding: 0.125rem;
    }
    
    #gallery img {
        border-radius: 0.25rem;
    }
}

/* Footer Responsive */
@media (max-width: 767.98px) {
    footer .row.g-4 .col-lg-4 {
        text-align: center;
        margin-bottom: 2rem;
    }
    
    footer .list-unstyled {
        padding-left: 0;
    }
    
    footer hr {
        margin: 2rem 0 1rem;
    }
}

/* Breadcrumbs Responsive */
@media (max-width: 575.98px) {
    .breadcrumb {
        justify-content: center;
    }
    
    .breadcrumb-item img {
        width: 20px;
        height: 20px;
    }
} 

.hero-section h1 {
    padding-top: 150px;
}