/* ==================================================================
   MOBILE HEADER REDESIGN - CENTERED LAYOUT
   Redesigned header for mobile with centered elements and fixed view
   Version: 1.0 - Mobile Header Redesign
================================================================== */

/* ==================================================================
   1. MOBILE HEADER REDESIGN (768px and below)
================================================================== */

@media (max-width: 768px) {
    
    /* ==================================================================
       HEADER CONTAINER - FULLY CENTERED DESIGN
    ================================================================== */
    
    .header {
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
        border-bottom: 2px solid #e2e8f0 !important;
        padding: 1rem 0 !important;
        position: relative !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    }
    
    .header-container {
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 0 1rem !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 1rem !important;
        position: relative !important;
    }
    
    /* ==================================================================
       LOGO SECTION - CENTERED WITH FIXED SIZING
    ================================================================== */
    
    .logo-section {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.75rem !important;
        width: 100% !important;
        order: 1 !important;
    }
    
    .logo {
        width: 80px !important; /* Increased from 60px */
        height: 80px !important; /* Increased from 60px */
        border-radius: 14px !important; /* Increased from 12px */
        object-fit: contain !important;
        background: linear-gradient(135deg, #f8fafc, #e2e8f0) !important;
        border: 2px solid rgba(16, 185, 129, 0.1) !important;
        padding: 0.5rem !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important; /* Enhanced shadow */
        margin: 0 auto !important;
        display: block !important;
    }
    
    /* ==================================================================
       ORGANIZATION INFO - CENTERED WITH FIXED VIEW
    ================================================================== */
    
    .org-info {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
        padding: 0 0.5rem !important;
        order: 2 !important;
    }
    
    .org-info h1,
    .org-name {
        font-size: 1.4rem !important;
        font-weight: 700 !important;
        color: #1e293b !important;
        margin: 0 0 0.25rem 0 !important;
        line-height: 1.2 !important;
        text-align: center !important;
        background: linear-gradient(135deg, #1e293b, #475569) !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        background-clip: text !important;
    }
    
    .org-subtitle {
        font-size: 0.95rem !important;
        font-weight: 500 !important;
        color: #64748b !important;
        margin: 0 !important;
        line-height: 1.3 !important;
        text-align: center !important;
        opacity: 0.8 !important;
    }
    
    /* ==================================================================
       CAMPAIGN TITLE - CENTERED SUBTITLE
    ================================================================== */
    
    .campaign-title {
        font-size: 1.1rem !important;
        font-weight: 600 !important;
        color: #059669 !important;
        margin: 0.5rem 0 0 0 !important;
        line-height: 1.3 !important;
        text-align: center !important;
        order: 3 !important;
    }
    
    /* ==================================================================
       MOBILE LANGUAGE SWITCHER - CENTERED BELOW SUBTITLE
    ================================================================== */
    
    /* DISABLED - Language switcher styles moved to language-switcher-consolidated.css
    .mobile-language-switcher-container {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        margin: 1rem auto 0.5rem auto !important;
        order: 4 !important;
        padding: 0 1rem !important;
        position: relative !important;
        will-change: transform !important;
        transform: translate3d(0, 0, 0) !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
        z-index: 1000 !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    .mobile-language-switcher-container .language-switcher {
        position: relative !important;
        z-index: 1001 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 0 auto !important;
        width: auto !important;
        max-width: 200px !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        bottom: auto !important;
        will-change: transform !important;
        transform: translate3d(0, 0, 0) !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
        z-index: 1001 !important;
    }
    */
    
    /* DISABLED - Language switcher styles moved to language-switcher-consolidated.css
    .mobile-language-switcher-container .language-toggle {
        background: #ffffff !important;
        color: #374151 !important;
        border: 2px solid #d1d5db !important;
        border-radius: 8px !important;
        font-weight: 600 !important;
        min-width: 120px !important;
        padding: 0.6rem 0.8rem !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
        transition: all 0.2s ease !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
        filter: none !important;
        transform: translate3d(0, 0, 0) !important;
        backface-visibility: hidden !important;
        perspective: 1000px !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
        pointer-events: auto !important;
        user-select: none !important;
    }
    */
    
    /* DISABLED - Language switcher styles moved to language-switcher-consolidated.css
    .mobile-language-switcher-container .language-toggle:hover,
    .mobile-language-switcher-container .language-toggle:focus,
    .mobile-language-switcher-container .language-toggle.active {
        background: #ffffff !important;
        border-color: #10b981 !important;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
        transform: translate3d(0, -1px, 0) !important;
    }
    
    .mobile-language-switcher-container .language-toggle .flag {
        font-size: 1rem !important;
        margin-right: 0.4rem !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
    }
    
    .mobile-language-switcher-container .language-toggle .lang-code {
        font-weight: 600 !important;
        font-size: 0.8rem !important;
        color: #374151 !important;
        flex: 1 !important;
        text-align: left !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
    }
    
    .mobile-language-switcher-container .language-toggle .fa-chevron-down {
        font-size: 0.7rem !important;
        color: #6b7280 !important;
        transition: transform 0.2s ease !important;
    }
    
    .mobile-language-switcher-container .language-toggle.active .fa-chevron-down {
        transform: rotate(180deg) !important;
    }
    */
    
    /* DISABLED - Language switcher styles moved to language-switcher-consolidated.css
    .mobile-language-switcher-container .language-dropdown {
        position: absolute !important;
        top: calc(100% + 0.5rem) !important;
        left: 50% !important;
        transform: translateX(-50%) translateY(-8px) scale(0.95) !important;
        background: #ffffff !important;
        border: 2px solid #e5e7eb !important;
        border-radius: 12px !important;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
        z-index: 1003 !important;
        overflow: hidden !important;
        min-width: 200px !important;
        max-width: 280px !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
        filter: none !important;
        backface-visibility: hidden !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
        display: block !important;
    }
    
    .mobile-language-switcher-container .language-dropdown.active {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translateX(-50%) translateY(0) scale(1) !important;
    }
    
    .mobile-language-switcher-container .language-option {
        padding: 0.875rem 1rem !important;
        font-size: 0.95rem !important;
        color: #374151 !important;
        background: #ffffff !important;
        border-bottom: 1px solid #f3f4f6 !important;
        cursor: pointer !important;
        transition: all 0.15s ease !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        min-height: 48px !important;
        -webkit-tap-highlight-color: transparent !important;
        touch-action: manipulation !important;
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
        filter: none !important;
        transform: translate3d(0, 0, 0) !important;
        pointer-events: auto !important;
        user-select: none !important;
    }
    
    .mobile-language-switcher-container .language-option:last-child {
        border-bottom: none !important;
    }
    
    .mobile-language-switcher-container .language-option:hover,
    .mobile-language-switcher-container .language-option:focus {
        background: #f8fafc !important;
        color: #10b981 !important;
    }
    
    .mobile-language-switcher-container .language-option .flag {
        font-size: 1.1rem !important;
        width: 1.5rem !important;
        text-align: center !important;
    }
    */
    
    /* DISABLED - Language switcher styles moved to language-switcher-consolidated.css
    @media (max-width: 768px) {
        .desktop-language-switcher {
            display: none !important;
        }
    }
    
    @media (min-width: 769px) {
        .desktop-language-switcher {
            display: flex !important;
        }
        
        .mobile-language-switcher-container {
            display: none !important;
        }
        
        .desktop-language-switcher .flag {
            display: inline !important;
        }
        
        .desktop-language-switcher .lang-code {
            display: inline !important;
        }
    }
    
    @media (max-width: 768px) {
        .language-dropdown {
            position: fixed !important;
            top: 60px !important;
            left: 50% !important;
            transform: translateX(-50%) !important;
            width: 90% !important;
            max-width: 300px !important;
            z-index: 1003 !important;
        }
    }
    */
    
    /* Mobile language dropdown overlay - DISABLED */
    /* Overlay removed to prevent page blur */
    
    /* Enhanced mobile language switcher animations */
    .mobile-language-switcher-container .language-toggle {
        transform: translateY(0) !important;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    .mobile-language-switcher-container .language-toggle:active {
        transform: translateY(1px) scale(0.98) !important;
    }
    
    /* Mobile accessibility improvements */
    .mobile-language-switcher-container .language-option {
        position: relative !important;
    }
    
    .mobile-language-switcher-container .language-option::after {
        content: '' !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(16, 185, 129, 0.1) !important;
        opacity: 0 !important;
        transition: opacity 0.15s ease !important;
        pointer-events: none !important;
    }
    
    .mobile-language-switcher-container .language-option:active::after {
        opacity: 1 !important;
    }
    
    /* ==================================================================
       HEADER ACTIONS - HIDDEN ON MOBILE
    ================================================================== */
    
    .header-actions {
        display: none !important; /* Hide on mobile - language switcher is separate */
    }
    
    /* ==================================================================
       TRUST BADGE - HIDDEN ON MOBILE
    ================================================================== */
    
    .trust-badge {
        display: none !important;
    }
    
    /* ==================================================================
       MODE INDICATOR - HIDDEN ON MOBILE
    ================================================================== */
    
    .mode-indicator {
        display: none !important;
    }
    
    .mode-badge {
        display: none !important;
    }
    
    /* ==================================================================
       CAMPAIGN TITLE AND MAIN CONTENT CENTERING
    ================================================================== */
    
    .campaign-header {
        text-align: center !important;
        padding: 0 1rem !important;
    }
    
    .campaign-title {
        font-size: 1.5rem !important;
        font-weight: 700 !important;
        color: #059669 !important;
        margin: 1.5rem 0 1rem 0 !important;
        line-height: 1.3 !important;
        text-align: center !important;
        /* Improve text rendering */
        -webkit-font-smoothing: antialiased !important;
        -moz-osx-font-smoothing: grayscale !important;
    }
    
    .campaign-description {
        font-size: 1rem !important;
        color: #64748b !important;
        text-align: center !important;
        line-height: 1.6 !important;
        margin: 0 auto 2rem auto !important;
        max-width: 90% !important;
    }
    
    .donation-header {
        text-align: center !important;
    }
    
    .donation-header h2 {
        text-align: center !important;
        margin: 0 auto !important;
    }
}

/* ==================================================================
   2. SMALL MOBILE OPTIMIZATION (480px and below)
================================================================== */

@media (max-width: 480px) {
    
    .header-container {
        padding: 0 0.75rem !important;
        gap: 0.75rem !important;
    }
    
    .logo {
        width: 70px !important; /* Reduced from 80px for very small screens */
        height: 70px !important; /* Reduced from 80px for very small screens */
        border-radius: 12px !important; /* Reduced from 14px */
    }
    
    .org-info h1,
    .org-name {
        font-size: 1.2rem !important;
    }
    
    .org-subtitle {
        font-size: 0.85rem !important;
    }
    
    .campaign-title {
        font-size: 1rem !important;
    }
    
    .language-toggle {
        padding: 0.5rem 0.7rem !important; /* Reduced from 0.6rem 0.8rem */
        font-size: 0.75rem !important; /* Reduced from 0.8rem */
        min-width: 100px !important; /* Reduced from 120px */
    }
    
    .language-toggle .flag {
        font-size: 0.9rem !important; /* Reduced from 1rem */
    }
    
    .language-toggle .lang-code {
        font-size: 0.75rem !important; /* Reduced from 0.8rem */
    }
}

/* ==================================================================
   3. RTL SUPPORT FOR MOBILE HEADER
================================================================== */

@media (max-width: 768px) {
    
    html[dir="rtl"] .header-container {
        direction: rtl !important;
    }
    
    html[dir="rtl"] .logo-section {
        direction: rtl !important;
    }
    
    html[dir="rtl"] .org-info {
        direction: rtl !important;
    }
    
    html[dir="rtl"] .language-toggle {
        direction: ltr !important; /* Keep language codes LTR */
    }
    
    html[dir="rtl"] .language-toggle .flag {
        margin-right: 0.25rem !important;
        margin-left: 0 !important;
    }
    
    html[dir="rtl"] .language-toggle .lang-code {
        margin-right: 0.25rem !important;
        margin-left: 0 !important;
    }
    
    html[dir="rtl"] .language-toggle .fa-chevron-down {
        margin-left: 0.25rem !important;
        margin-right: 0 !important;
    }
}