/* Mobile-First Responsive Design */

/* Extra Small Devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    /* Typography adjustments */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    /* Navigation */
    .navbar-brand {
        font-size: 1.25rem !important;
    }
    
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.98);
        border-radius: 10px;
        margin-top: 1rem;
        padding: 1rem;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    }
    
    /* Hero section mobile optimizations */
    #hero {
        padding: 2rem 0;
        text-align: center;
    }
    
    #hero h1 {
        margin-bottom: 1rem;
    }
    
    #hero .btn {
        width: 100%;
        max-width: 250px;
        margin-top: 1.5rem;
    }
    
    /* Cards and grid adjustments */
    .card {
        margin-bottom: 1.5rem;
    }
    
    .card-body {
        padding: 1.5rem;
    overflow-x: hidden;
}
    
    /* Statistics mobile layout */
    .stat-number {
        font-size: 2rem;
    }
    
    .impact-stat {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    /* Process steps mobile */
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .process-step {
        padding: 1.5rem 0.5rem;
    }
    
    /* Team section mobile */
    .team-member img {
        width: 120px;
        height: 120px;
    }
    
    /* Contact form mobile */
    .contact-info {
        margin-top: 2rem;
        padding: 1.5rem;
    }
    
    /* Footer mobile */
    #footer {
        text-align: center;
    }
    
    #footer .row > div {
        margin-bottom: 2rem;
    }
    
    /* Gallery mobile spacing */
    #gallery .col-md-4 {
        margin-bottom: 1rem;
    }
    
    /* Custom component mobile adjustments */
    .certification-card,
    .goal-card,
    .program-card,
    .supply-step,
    .innovation-card {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
    }
    
    /* Button adjustments */
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    /* Disable animations on mobile for better performance */
    .card:hover,
    .impact-stat:hover,
    .certification-card:hover,
    .goal-card:hover,
    .program-card:hover,
    .supply-step:hover,
    .innovation-card:hover,
    #gallery img:hover {
        transform: none;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Hero adjustments */
    #hero {
        padding: 3rem 0;
    }
    
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    
    /* Cards in two columns where appropriate */
    .services-grid .col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    /* Statistics in rows of 2 */
    .impact-stat {
        padding: 1.75rem;
    }
    
    /* Team section adjustments */
    .team-member img {
        width: 130px;
        height: 130px;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Typography */
    h1 { font-size: 2.125rem; }
    h2 { font-size: 1.75rem; }
    
    /* Hero section */
    #hero {
        padding: 4rem 0;
    }
    
    /* Navigation */
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem !important;
    }
    
    /* Cards maintain good proportions */
    .card-img-top {
        height: 180px;
    }
    
    /* Statistics layout */
    .stat-number {
        font-size: 2.5rem;
    }
    
    /* Team section */
    .team-member img {
        width: 140px;
        height: 140px;
    }
    
    /* Contact section layout */
    .contact-info {
        margin-top: 2rem;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Standard desktop optimizations */
    .container {
        max-width: 960px;
    }
    
    /* Hero full effect */
    #hero {
        padding: 5rem 0;
    }
    
    /* Team section layout optimization */
    .team-member {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    /* Maximum container optimization */
    .container {
        max-width: 1140px;
    }
    
    /* Enhanced spacing for large screens */
    section {
        padding: 6rem 0;
    }
    
    /* Gallery improvements for large screens */
    #gallery .col-md-4 {
        padding: 0.25rem;
    }
    
    /* Enhanced hover effects for desktop */
    .card:hover {
        transform: translateY(-8px);
    }
    
    .impact-stat:hover,
    .certification-card:hover,
    .goal-card:hover,
    .program-card:hover,
    .supply-step:hover,
    .innovation-card:hover {
        transform: translateY(-5px);
    }
}

/* Height-based media queries for better vertical spacing */
@media (max-height: 600px) and (orientation: landscape) {
    #hero {
        min-height: 80vh;
        padding: 2rem 0;
    }
    
    section {
        padding: 3rem 0;
    }
}

/* Print styles */
@media print {
    /* Hide navigation and interactive elements */
    .navbar,
    .btn,
    #footer {
        display: none !important;
    }
    
    /* Optimize for print */
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000 !important;
        background: white !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #000 !important;
        page-break-after: avoid;
    }
    
    /* Remove background images and colors for print */
    * {
        background: transparent !important;
        box-shadow: none !important;
    }
}

/* Accessibility enhancements */
@media (prefers-reduced-motion: reduce) {
    /* Remove all animations and transitions */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-contrast: high) {
    /* Enhanced contrast for accessibility */
    :root {
        --primary-green: #2d4a35;
        --text-forest: #000;
        --neutral-cream: #fff;
    }
    
    .card {
        border: 2px solid #000 !important;
    }
    
    .btn {
        border: 2px solid currentColor !important;
    }
}

/* Dark mode support */