/* Responsive Design - Mobile First Approach */

/* Tablet Styles */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .programs-grid,
    .news-grid,
    .involvement-options {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    /* Navigation */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 1rem 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Hero Section */
    .hero {
        height: 90vh;
        padding: 0 20px;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* Typography */
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    /* Sections */
    section {
        padding: 3rem 0;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stat-item {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    /* Program Cards */
    .programs-grid,
    .news-grid,
    .involvement-options {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .program-card,
    .news-card,
    .involvement-card {
        padding: 1.5rem;
    }
    
    /* About Section */
    .about-mission,
    .about-vision,
    .about-values {
        padding: 1.5rem;
    }
    
    /* Contact Section */
    .contact-content {
        gap: 2rem;
    }
    
    .contact-info {
        gap: 1.5rem;
    }
    
    .form {
        padding: 1.5rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .footer-bottom-links {
        justify-content: center;
    }
    
    /* Modal */
    .modal-content {
        margin: 20% auto;
        width: 95%;
    }
    
    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }
    
    .donation-amounts {
        grid-template-columns: 1fr;
    }
}

/* Small Mobile Styles */
@media screen and (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    section {
        padding: 2rem 0;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .program-icon,
    .involvement-icon {
        font-size: 2.5rem;
    }
    
    .modal-content {
        margin: 30% auto;
    }
    
    .nav-container {
        padding: 0.75rem 10px;
    }
    
    .logo-img {
        height: 35px;
    }
    
    .logo-text {
        font-size: 1.3rem;
    }
}

/* Large Desktop Styles */
@media screen and (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 5rem;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    .programs-grid,
    .involvement-options {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* High DPI Displays */
@media screen and (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-img,
    .footer-logo-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: -webkit-crisp-edges;
        image-rendering: crisp-edges;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .hero-scroll,
    .modal,
    .hamburger {
        display: none;
    }
    
    .hero {
        height: auto;
        padding: 2rem 0;
        background: white;
        color: black;
    }
    
    .hero-title,
    .hero-subtitle {
        color: black;
    }
    
    section {
        padding: 1rem 0;
    }
    
    .btn {
        border: 1px solid black;
        color: black;
        background: white;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero-scroll {
        animation: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #ffffff;
        --secondary-text: #b3b3b3;
    }
    
    /* Only apply if user hasn't explicitly chosen light mode */
    @supports not (color-scheme: light dark) {
        body {
            background-color: var(--bg-color);
            color: var(--text-color);
        }
        
        .navbar {
            background-color: rgba(26, 26, 26, 0.95);
        }
        
        .nav-link {
            color: var(--text-color);
        }
        
        .impact-stats {
            background-color: #2a2a2a;
        }
        
        .stat-item {
            background-color: #333;
            color: var(--text-color);
        }
        
        .about-mission,
        .about-vision,
        .about-values {
            background-color: #2a2a2a;
            color: var(--text-color);
        }
        
        .programs {
            background-color: #2a2a2a;
        }
        
        .program-card {
            background-color: #333;
            color: var(--text-color);
        }
        
        .news-card {
            background-color: #333;
            color: var(--text-color);
        }
        
        .get-involved {
            background-color: #2a2a2a;
        }
        
        .involvement-card {
            background-color: #333;
            color: var(--text-color);
        }
        
        .form {
            background-color: #333;
        }
        
        .form-group input,
        .form-group select,
        .form-group textarea {
            background-color: #444;
            border-color: #555;
            color: var(--text-color);
        }
        
        .modal-content {
            background-color: #333;
            color: var(--text-color);
        }
    }
}

/* Accessibility Improvements */
@media (prefers-contrast: high) {
    .btn-primary {
        background-color: #000;
        border-color: #000;
    }
    
    .btn-outline {
        border-width: 3px;
    }
    
    .nav-link::after {
        height: 3px;
    }
}

/* Focus Styles for Keyboard Navigation */
.nav-link:focus,
.btn:focus,
.social-link:focus,
input:focus,
select:focus,
textarea:focus,
.donation-btn:focus {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

/* Skip to Content Link for Screen Readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #2563eb;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 9999;
    border-radius: 4px;
}

.skip-link:focus {
    top: 6px;
}

/* Screen Reader Only Content */
.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;
}