/* ============================================================================
   RESPONSIVE DESIGN SYSTEM - DEVICE-AGNOSTIC UI
   ============================================================================

   BREAKPOINT STRATEGY:
   📱 Mobile Extra Small: 320px  (iPhone SE, older Android)
   📱 Mobile Small:       375px  (iPhone 12/13/14, most phones)
   📱 Mobile Large:       425px  (iPhone Pro Max, large phones)
   📱 Tablet Portrait:    768px  (iPad, Android tablets)
   💻 Tablet Landscape:   1024px (iPad Pro, small laptops)
   🖥️ Desktop:            1440px (Standard monitors)
   🖥️ Large Desktop:      1920px (Full HD monitors)
   🖥️ 4K/Retina:          2560px (4K, 5K displays)

   ============================================================================ */

/* ============================================================================
   UTILITY CLASSES - ALWAYS AVAILABLE
   ============================================================================ */

/* Text Alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Text Colors */
.text-primary { color: var(--primary-green); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-white { color: var(--text-white); }

/* Background Colors */
.bg-primary { background-color: var(--primary-green); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-white { background-color: var(--white); }
.bg-dark { background-color: var(--bg-dark); }

/* Border Radius */
.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadows */
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-green { box-shadow: var(--shadow-green); }

/* Transitions */
.transition { transition: all var(--transition-normal); }
.transition-fast { transition: all var(--transition-fast); }
.transition-slow { transition: all var(--transition-slow); }

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Grid Utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Display Utilities */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Spacing Utilities */
.m-0 { margin: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }

/* Touch-Friendly Utilities */
.touch-target {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.no-tap-highlight {
    -webkit-tap-highlight-color: transparent;
}

/* Responsive Visibility Utilities */
.hide-mobile { display: block; }
.show-mobile { display: none; }
.hide-tablet { display: block; }
.show-tablet { display: none; }
.hide-desktop { display: block; }
.show-desktop { display: none; }

/* ============================================================================
   MOBILE EXTRA SMALL - 320px (iPhone SE, older Android)
   ============================================================================ */

@media (max-width: 320px) {
    .container {
        padding: 0 var(--space-sm);
    }

    /* Ensure minimum touch targets */
    button, a, input, select, textarea {
        min-height: 44px;
    }

    /* Reduce font sizes slightly for very small screens */
    h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
    h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
    h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
}

/* ============================================================================
   MOBILE SMALL - 375px (iPhone 12/13/14, most phones)
   ============================================================================ */

@media (max-width: 375px) {
    .container {
        padding: 0 var(--space-md);
    }

    /* Optimize grid layouts for small phones */
    .grid-cols-2 { grid-template-columns: 1fr; }
    .grid-cols-3 { grid-template-columns: 1fr; }
    .grid-cols-4 { grid-template-columns: 1fr; }
}

/* ============================================================================
   MOBILE LARGE - 425px (iPhone Pro Max, large phones)
   ============================================================================ */

@media (max-width: 425px) {
    /* Allow 2-column grids on larger phones */
    .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================================
   TABLET PORTRAIT - 768px (iPad, Android tablets)
   ============================================================================ */

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-md);
    }

    .about-section-modern .container {
        max-width: 100% !important;
        padding: 0 1rem !important;
    }

    /* Responsive visibility */
    .hide-mobile { display: none; }
    .show-mobile { display: block; }

    /* Grid adjustments */
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================================
   TABLET LANDSCAPE - 1024px (iPad Pro, small laptops)
   ============================================================================ */

@media (max-width: 1024px) {
    /* Responsive visibility */
    .hide-tablet { display: none; }
    .show-tablet { display: block; }

    /* Grid adjustments */
    .grid-cols-4 { grid-template-columns: repeat(3, 1fr); }
    .header-content-enhanced {
        gap: 1.5rem;
    }

    .nav-menu-enhanced {
        gap: 0.75rem; /* Better spacing on tablet */
        flex-direction: row; /* Ensure horizontal on tablet */
    }

    .nav-menu-enhanced a {
        padding: 0.75rem 1.25rem;
        font-size: 1rem; /* Maintain readable size */
    }

    .header-actions-enhanced {
        gap: 0.75rem;
    }

    .search-panel {
        width: 380px;
        right: 0;
    }

    .search-toggle {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }

    .search-text {
        display: none;
    }

    .logo-main {
        font-size: 1.6rem;
    }

    .logo-sub {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .menu-toggle-enhanced {
        display: flex;
        position: relative;
        z-index: 1002;
    }

    .menu-toggle-enhanced .line {
        background: #fff;
    }

    .site-header-world-class.scrolled .menu-toggle-enhanced .line {
        background: #1e293b;
    }

    .menu-toggle-enhanced .menu-text {
        color: #fff;
    }

    .site-header-world-class.scrolled .menu-toggle-enhanced .menu-text {
        color: #1e293b;
    }

    /* Mobile Navigation Overlay */
    .main-nav-enhanced {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        background: linear-gradient(135deg,
            #ffffff 0%,
            #f8fafc 100%);
        display: flex;
        flex-direction: column;
        padding: 0;
        z-index: 1001;
        box-shadow: -10px 0 50px rgba(0, 0, 0, 0.3);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }

    .main-nav-enhanced.active {
        right: 0;
    }

    /* Mobile Menu Header - Show on mobile only */
    .mobile-menu-header {
        display: flex !important;
        align-items: center;
@media (max-width: 480px) {
    .site-header-world-class {
        padding: 0.75rem 0;
    }

    .header-content-enhanced {
        gap: 1rem;
    }

    .logo-image-enhanced {
        width: 40px;
        height: 40px;
    }

    .logo-main {
        font-size: 1.125rem;
    }

    .logo-sub {
        font-size: 0.8rem;
    }

    .header-settings {
        display: none;
    }

    .search-panel {
        width: calc(100vw - 2rem);
        right: 0;
        left: 1rem;
        padding: 1rem;
    }

    .search-toggle {
        padding: 0.5rem;
        border-radius: 50%;
        width: 44px;
        height: 44px;
        justify-content: center;
    }

    .search-text {
        display: none;
    }

    .search-icon {
        font-size: 1.2rem;
    }

    .search-input-container {
        margin-bottom: 1rem;
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid rgba(34, 197, 94, 0.1);
        box-shadow: var(--shadow-lg);
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }

    .main-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: var(--space-lg);
    }

    .main-nav li {
        width: 100%;
    }

    .main-nav a {
        width: 100%;
        padding: 1rem 1.25rem;
        border-radius: var(--radius-md);
        justify-content: flex-start;
    }

    .main-nav a::before {
        display: none;
    }

    .main-nav a:hover,
    .main-nav a.active {
@media (max-width: 768px) {

    .locations-interactive-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .partner-hub-3d {
        width: 300px;
        height: 300px;
    }

    .partner-node-3d {
        width: 60px;
        height: 60px;
    }

    .ai-metrics-display {
        flex-direction: column;
        align-items: center;
    }

    .network-overlay {
        padding: 1rem;
    }

    .network-stats {
        flex-direction: row;
        gap: 0.5rem;
    }

    .stat-node {
        min-width: 80px;
        padding: 0.5rem;
    }
}

/* Contact info icons styling */
.footer-contact p:first-child {
    border-left-color: #f59e0b; /* Orange for email */
    background: rgba(245, 158, 11, 0.05);
}

.footer-contact p:first-child:hover {
    background: rgba(245, 158, 11, 0.1);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.footer-contact p:nth-child(2) {
    border-left-color: #3b82f6; /* Blue for phone */
    background: rgba(59, 130, 246, 0.05);
@media (min-width: 1600px) {
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr 1.3fr;
        gap: 2.5rem;
    }
}

@media (max-width: 1200px) {
    .footer-content {
        grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
        gap: 1.5rem;
    }
}

@media (max-width: 1000px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 1200px) {
    .footer-content {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 900px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .site-footer {
        padding: 2.5rem 0 0;
        margin-top: 3rem;
    }

    /* Footer Content - 4 Columns in One Row */
    .footer-content {
        display: grid !important;
        grid-template-columns: 1.2fr 1fr 1fr 0.8fr !important;
        gap: 0.5rem;
        margin-bottom: 2rem;
        padding: 0 1rem;
        overflow-x: hidden;
    }

    .footer-section {
        min-width: 0;
        padding: 0;
        overflow: hidden;
    }

    /* Section Headings */
    .footer-section h3,
    .footer-section h4 {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
        font-weight: 700;
        color: var(--white);
        line-height: 1.2;
    }

    .footer-section h3 {
        font-size: 0.9rem;
        color: var(--primary-green);
    }

    /* Hide long description text */
    .footer-logo p {
        display: none;
    }

    /* Social Icons - Vertical Stack */
    .footer-social {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem;
        margin-top: 0.75rem;
        align-items: flex-start;
    }

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-color);
        padding: 1rem;
    }
    
    .main-nav.active {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }
    
    .main-nav a {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .header-content {
        position: relative;
    }
    
    .hero-content h2 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .donation-amounts {
        flex-direction: column;
        align-items: center;
    }
    
    .donation-btn {
        width: 200px;
    }
    
@media (max-width: 480px) {
    .hero {
        padding: 4rem 1rem;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .content-section {
        padding: 2rem 1rem;
    }
    
    .section-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced Hero Styles */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation-delay: 0s;
}

/* Removed duplicate .badge-icon - using global definition */

.hero-particles {
    position: absolute;
@media (max-width: 768px) {
    .hero-controls {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        justify-content: center;
        padding: 0.5rem 1rem;
    }

    .hero-control {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }

    .hero-indicator {
        width: 0.625rem;
        height: 0.625rem;
    }
}

.btn-icon {
    font-size: 1.1em;
    margin-right: 0.5rem;
}

/* Counter Animation */
.counter {
    display: inline-block;
    transition: all var(--transition-slow);
}

/* Section Headers */
.section-header {
    margin-bottom: 4rem;
}

.section-badge {
    display: inline-block;
    background: var(--primary-green-pale);
    color: var(--primary-green-dark);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

/* Services Grid */
@media (max-width: 768px) {
    .hero-stats {
        flex-direction: column;
        gap: 2rem;
        margin-top: 3rem;
    }

    .hero-stat {
        text-align: center;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .impact-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }

    .section-header {
        margin-bottom: 2.5rem;
    }

    .impact-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .impact-grid {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .hero-stat-number {
        font-size: 2rem;
    }

    .impact-number {
        font-size: 2.5rem;
    }
}

/* Particle Effects */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: particleFloat 15s linear infinite;
    pointer-events: none;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Enhanced Loading States */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
@media print {
    .hero,
    .site-header,
    .site-footer {
        display: none;
    }

    .content-section {
        padding: 1rem 0;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-green: #006400;
        --primary-green-dark: #004d00;
        --text-primary: #000000;
        --text-secondary: #333333;
    }

    .btn {
        border: 2px solid currentColor;
    }

    .card {
        border: 2px solid var(--gray-400);
    }
}

/* Reduced Motion Support */
@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;
    }

    .hero::before,
    .hero::after,
    .particle {
        animation: none;
    }

    .gradient-animate {
        animation: none;
        background: var(--primary-green);
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: var(--gray-900);
        --bg-secondary: var(--gray-800);
        --text-primary: var(--white);
        --text-secondary: var(--gray-300);
        --text-muted: var(--gray-400);
    }

    .card {
        background: var(--gray-800);
        border-color: var(--gray-700);
    }

    .site-header {
        background: rgba(31, 41, 55, 0.95);
        border-bottom-color: rgba(34, 197, 94, 0.2);
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

/* Additional Utility Classes */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Enhanced Accessibility Styles */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    z-index: 999999;
    color: var(--white);
    background: var(--primary-green);
    text-decoration: none;
@media (prefers-contrast: high) {
    :root {
        --primary-green: #000000;
        --secondary-green: #333333;
        --gray-900: #000000;
        --gray-600: #333333;
        --white: #ffffff;
    }

    .hero-section,
    .floating-header,
    .footer {
        border: 2px solid var(--gray-900);
    }

    .btn {
        border: 2px solid currentColor;
    }

    .card {
        border: 2px solid var(--gray-400);
    }
}

/* Reduced Motion Support */
@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;
    }

    .floating-header {
        transform: none !important;
    }

    .hero-content {
        animation: none !important;
    }

    .hero::before,
    .hero::after,
    .particle {
        animation: none;
    }

    .gradient-animate {
        animation: none;
        background: var(--primary-green);
    }
}

/* Print Styles */
@media print {
    .floating-header,
    .floating-actions,
    .search-dropdown,
    .hero-video,
    .social-links,
    .hero,
    .cta-section,
    .site-header {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    .hero-section {
        background: none !important;
        color: #000 !important;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }

    .footer-contact a[href]:after {
        content: "";
    }

    .content-section {
        padding: 1rem 0;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}
