/* Responsive CSS - Mobile First Approach */

/* Base Mobile Styles (320px+) */
body {
    font-size: var(--font-sm);
    line-height: var(--leading-relaxed);
}

.container {
    padding: 0 var(--space-4);
}

/* Hero CTA buttons mobile centering */
@media (max-width: 639px) {
    .hero-ctas {
        width: 100%;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: var(--space-4);
        margin: 0 auto;
        padding: 0 var(--space-4);
    }

    .hero-ctas .btn {
        width: 100% !important;
        max-width: 280px !important;
        text-align: center !important;
        justify-content: center !important;
        margin: 0 auto !important;
        display: flex !important;
        align-items: center !important;
    }
}

/* Additional mobile centering - General rules */
.hero-ctas {
    margin-left: auto !important;
    margin-right: auto !important;
}

.hero-ctas .btn {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Ensure buttons are centered on all mobile devices */

/* Hero section mobile text improvements */
.hero-title {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9), 0px 0px 8px rgba(0, 0, 0, 0.7);
}

.hero-subtitle {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8), 0px 0px 6px rgba(0, 0, 0, 0.6);
}

/* Small Mobile (375px+) */
@media (min-width: 375px) {
    body {
        font-size: var(--font-base);
    }
}

/* Large Mobile (480px+) */
@media (min-width: 480px) {
    .hero-title {
        font-size: var(--font-3xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-lg);
    }
    
    .section-title {
        font-size: var(--font-2xl);
    }
    
    .container {
        padding: 0 var(--space-5);
    }
}

/* Small Tablet (640px+) */
@media (min-width: 640px) {
    .container {
        padding: 0 var(--space-6);
    }
    
    .hero-title {
        font-size: var(--font-4xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-xl);
    }
    
    .section-title {
        font-size: var(--font-3xl);
    }
    
    /* Grid Adjustments */
    .activities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .leadership-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-8);
    }
    
    /* Navigation */
    .nav-container {
        padding: 0 var(--space-6);
    }
    
    /* Footer */
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet (768px+) */
@media (min-width: 768px) {
    body {
        font-size: var(--font-base);
    }
    
    .container {
        max-width: var(--container-md);
    }
    
    .hero-title {
        font-size: var(--font-5xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-2xl);
    }
    
    .section-title {
        font-size: var(--font-4xl);
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .stat-number {
        font-size: var(--font-5xl);
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Navigation */
    .nav-menu {
        display: flex;
    }
    
    .nav-toggle {
        display: none;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr 2fr;
    }
    
    .footer-links {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-brand {
        text-align: left;
    }
    
    .footer-logo {
        margin: 0 0 var(--space-4);
    }
    
    /* Sections */
    section {
        padding: var(--space-20) 0;
    }
}

/* Large Tablet / Small Desktop (1024px+) */
@media (min-width: 1024px) {
    .container {
        max-width: var(--container-lg);
        padding: 0 var(--space-8);
    }
    
    .hero-title {
        font-size: var(--font-6xl);
    }
    
    /* Activities */
    .activities-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Leadership */
    .leadership-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* About */
    .about-content {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Sections */
    section {
        padding: var(--space-24) 0;
    }
    
    /* Navigation */
    .nav-container {
        padding: var(--space-5) var(--space-8);
    }
}

/* Desktop (1280px+) */
@media (min-width: 1280px) {
    .container {
        max-width: var(--container-xl);
    }
    
    .hero-title {
        font-size: var(--font-7xl);
    }
}

/* Large Desktop (1536px+) */
@media (min-width: 1536px) {
    .container {
        max-width: var(--container-2xl);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-image,
    .activity-image,
    .about-img,
    .leadership-img {
        image-rendering: crisp-edges;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 500px;
        height: 100vh;
    }
    
    .hero-title {
        font-size: var(--font-3xl);
        margin-bottom: var(--space-4);
    }
    
    .hero-subtitle {
        font-size: var(--font-lg);
        margin-bottom: var(--space-6);
    }
    
    .nav-container {
        padding: 0 var(--space-3);
    }
    
    .nav-logo {
        height: calc(var(--nav-height-mobile) - 6px);
        max-width: 160px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 48px;
        padding: var(--space-1) var(--space-2);
    }
    
    .nav-link {
        padding: var(--space-1) var(--space-2);
    }
    
    .dot {
        width: 16px;
        height: 16px;
    }
    
    /* Remove hover effects on touch devices */
    .hover-lift:hover,
    .hover-scale:hover,
    .hover-rotate:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .navbar,
    .hero,
    .btn,
    .footer {
        display: none !important;
    }
    
    .section-title {
        page-break-after: avoid;
    }
    
    .activity-card,
    .testimonial-card {
        page-break-inside: avoid;
    }
}

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

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --secondary-color: #ffffff;
        --light-gray: #cccccc;
        --dark-gray: #666666;
    }
    
    body {
        /* background-color: #1a1a1a; */
        color: #181818;
    }
    
    .navbar {
        background: rgba(255, 255, 255, 0.95);
        border-bottom: 2px solid rgba(236, 38, 143, 0.15);
        backdrop-filter: blur(15px) saturate(180%);
        -webkit-backdrop-filter: blur(15px) saturate(180%);
    }
    
    .navbar.scrolled {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px) saturate(200%);
        -webkit-backdrop-filter: blur(20px) saturate(200%);
    }
    
    .card,
    .activity-card,
    .testimonial-card,
    .leader-card,
    .partner-item {
        background: #FFFFFF;
        color: var(--secondary-color);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #ff0066;
        --secondary-color: #000000;
        --white: #ffffff;
    }
    
    .btn-outline {
        border-width: 3px;
    }
    
    /* Enhance visibility in high contrast mode */
    .nav-logo {
        background-color: var(--white) !important;
        border: 2px solid var(--primary-color);
        box-shadow: 0 0 0 2px var(--secondary-color);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    
    .nav-link::after {
        height: 3px;
    }
}

/* Performance Optimizations for Mobile */
@media (max-width: 767px) {
    .hero-background {
        transform: translateZ(0);
        will-change: transform;
    }
    
    .animate-fade-in,
    .animate-slide-up {
        animation-duration: 0.6s;
    }
    
    /* Reduce shadow complexity on mobile */
    .card,
    .btn {
        box-shadow: var(--shadow-base);
    }
    
    .card:hover,
    .btn:hover {
        box-shadow: var(--shadow-md);
    }
    
    /* Testimonials section mobile adjustments */
    .testimonials-section {
        padding: var(--space-12) 0;
    }
    
    .testimonial-card {
        padding: var(--space-6);
    }
    
    .testimonial-content p {
        font-size: var(--font-base);
        margin-left: var(--space-6);
    }
    
    .testimonial-author strong {
        font-size: var(--font-base);
    }
    
    /* Leadership section mobile improvements */
    .leadership-section {
        padding: var(--space-16) 0;
    }
    
    .leadership-section .section-title {
        font-size: var(--font-3xl);
    }
    
    .leadership-section .section-subtitle {
        font-size: var(--font-base);
        padding: 0 var(--space-4);
    }
    
    .leader-card {
        padding: var(--space-6);
    }
    
    .leader-info h3 {
        font-size: var(--font-lg);
    }
    
    .leader-info p {
        font-size: var(--font-base);
    }
    
    .leader-info span {
        font-size: var(--font-sm);
    }
}

/* Mobile-specific enhancements for CTA section */
@media (max-width: 768px) {
    .cta-section {
        padding: var(--space-20) 0;
    }
    
    .cta-content {
        padding: var(--space-12) var(--space-6);
        margin: 0 var(--space-4);
        max-width: none;
    }
    
    .cta-content h2 {
        font-size: var(--font-3xl);
        margin-bottom: var(--space-6);
        line-height: var(--leading-tight);
    }
    
    .cta-content p {
        font-size: var(--font-lg);
        margin-bottom: var(--space-8);
        line-height: var(--leading-relaxed);
    }
    
    .cta-content .btn {
        padding: var(--space-4) var(--space-8);
        font-size: var(--font-lg);
        min-height: 64px;
    }
    
    .cta-content .trust-indicator {
        font-size: var(--font-sm);
        margin-top: var(--space-5);
    }
    
    /* Optimize animations for mobile performance */
    .cta-content::after,
    .cta-section::after {
        animation-duration: 30s; /* Slow down particle animations on mobile */
    }
    
    .cta-content .btn {
        animation: ultra-shimmer 4s infinite linear; /* Reduce animation complexity */
    }
    
    /* Reduce intensity of glow effects on mobile */
    .cta-content h2::after {
        filter: blur(2px);
    }
    
    /* Better touch target */
    .cta-content .btn {
        width: 100%;
        max-width: 320px;
        padding: var(--space-4) var(--space-6);
    }
}

/* Small mobile optimization */
@media (max-width: 480px) {
    .cta-content {
        border-radius: var(--radius-2xl);
        padding: var(--space-10) var(--space-4);
    }
    
    .cta-content h2 {
        font-size: var(--font-2xl);
        margin-bottom: var(--space-4);
    }
    
    .cta-content p {
        font-size: var(--font-base);
        margin-bottom: var(--space-6);
    }
    
    .cta-content .btn {
        padding: var(--space-4) var(--space-6);
        font-size: var(--font-base);
        min-height: 56px;
    }
    
    /* Further optimize animations for small screens */
    @media (prefers-reduced-motion) {
        .cta-content::before,
        .cta-content::after,
        .cta-section::before,
        .cta-section::after {
            animation: none;
        }
        
        .cta-content .btn,
        .cta-content h2 {
            animation: none;
        }
        
        .cta-content .trust-indicator,
        .cta-content .trust-indicator::before,
        .cta-content .trust-indicator::after {
            animation: none;
        }
    }
}
