/* Custom Fonts */
@font-face {
    font-family: 'Tokyo';
    src: url('../fonts/tokyo/Tokyo.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --header-height: 150px;
    --nav-height: 50px;

    
/* Color Palette */
    --primary: #2a5f6e; /* Deep Teal */
    --primary-light: #3d8699;
    --primary-dark: #1d4249;
    --secondary: #02866d; /* Sea Green */
    --secondary-light: #3aad6d;
    --secondary-dark: #216b41;
    --accent: #ffb347; /* Warm Orange */
    --accent-light: #ffd580;
    --notice: #e95159; /* Warm Red */
    --notice-light: #f08080;

    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Typography */
    --font-primary: 'Inter', 'Lato', sans-serif;
    --font-secondary: 'Inter', 'Lato', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-vs: 0.15rem;
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.12);
    --shadow-xxl: 0 20px 48px rgba(0, 0, 0, 0.18);

    /* Transitions */
    --transition-base: all 0.3s ease;

    /* RGB vars for overlays */
    --primary-rgb: 41, 128, 185;
    --secondary-rgb: 46, 204, 113;
    --accent-rgb: 255, 179, 71;
    --notice-rgb: 233, 81, 89;
    --success-rgb: 76, 175, 80;

    /* Z-Index Scale */
    --z-header: 1000;
    --z-nav-scrolled: 1001;
    --z-mega-menu: 999;
    --z-mobile-toggle: 1001;

    /* Highlights */
    --highlight-icon-size: 56px;
    --highlight-icon-gap: var(--spacing-xs);
    --highlight-text-shift: 14px;
    --highlight-title-gap: var(--spacing-sm);
    --highlight-separator-gap: 0.5rem;
    --highlight-separator-color: rgba(255,255,255,0.12);
}
html[dir="rtl"] {
    direction: rtl;
    /* Arabic font stack for RTL */
    --font-primary: 'Tajawal', 'IBM Plex Sans Arabic', 'Noto Sans Arabic', sans-serif;
    --font-secondary: 'Tajawal', 'IBM Plex Sans Arabic', 'Noto Sans Arabic', sans-serif;
    font-family: 'Tajawal', 'IBM Plex Sans Arabic', 'Noto Sans Arabic', sans-serif;
}

/* Ensure RTL fonts apply to key elements */
html[dir="rtl"] body {
    font-family: 'Tajawal', 'IBM Plex Sans Arabic', 'Noto Sans Arabic', sans-serif;
}



html[dir="rtl"] .logo-text h1,
html[dir="rtl"] .logo-text p,
html[dir="rtl"] .main-nav a,
html[dir="rtl"] .dropdown-toggle,
html[dir="rtl"] .mega-menu-text h4,
html[dir="rtl"] .mega-menu-text p,
html[dir="rtl"] .mega-menu-header,
html[dir="rtl"] .action-buttons a,
html[dir="rtl"] .language-switcher a,
html[dir="rtl"] .mobile-nav a,
html[dir="rtl"] .nav-action-buttons a,
html[dir="rtl"] .mega-menu-cta-content h3,
html[dir="rtl"] .mega-menu-cta-content p {
    font-family: 'Tajawal', 'IBM Plex Sans Arabic', 'Noto Sans Arabic', sans-serif !important;
}

/* RTL/LTR Direction Support */
html[dir="ltr"], html:not([dir]) {
    direction: ltr;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    color: var(--gray-800);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.site-header {
    background: var(--gray-50);
    box-shadow: var(--shadow-md);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: var(--z-header);
    height: var(--header-height);
    transition: all 0.3s ease;
}

/* Scrolled state - hide header content, show only nav */
.site-header.scrolled {
    height: var(--nav-height);
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.site-header.scrolled .header-container {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    transition: all 0.3s ease;
}

.site-header.scrolled .nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    border-top: none;
    z-index: 1001;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 0.5rem 0.5rem;
    height: calc(var(--header-height) - var(--nav-height));
}

main {
    margin-top: var(--header-height);
    position: relative;
}

/* Adjust main content margin when header is scrolled */
body.header-scrolled main,
body.header-scrolled .swiper-main {
    margin-top: var(--nav-height);
}

/* ===== LOGO STYLES ===== */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 0.7rem;
    transition: all 0.3s ease;
}


.logo img {
    height: 90px;
    width: auto;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease;
    opacity: 0.6;
}

.logo:hover img {
    transform: scale(1.1);
    opacity: 0.8;
}

.logo-text {
    opacity: 0.9;
}

.logo-text h1 {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 400;
    color: var(--primary);
    margin: 0;
    line-height: 1.1;
}

.logo-text h1.chrome-text {
    font-family: 'Tokyo', var(--font-primary);
    font-size: 2.2rem; 
    position: relative;
    background: linear-gradient(180deg,#ffffff 0%,#d9d9d9 30%,#a6a6a6 45%,#ffffff 50%,#7d7d7d 65%,#ffffff 95%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-shadow: 1px 1px 0px #2a5f6e, 2px 2px 0px #000000, 3px 3px 0px #2a5f6e, 4px 4px 6px rgba(0,0,0,0.35);
    -webkit-font-smoothing: antialiased;
    margin: 0;
    line-height: 1.05;
    white-space: nowrap;
}

/* Arabic (RTL) adjustments */
html[dir="rtl"] .logo-text h1.chrome-text { 
    letter-spacing: 0.04em;
    font-size: 1.7rem;
    font-family: 'Alkalami', 'Tajawal', 'IBM Plex Sans Arabic', 'Noto Sans Arabic', sans-serif !important;
}

.logo-text h1.chrome-text::before {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, transparent 6%, rgba(255,255,255,0.85) 7.5%, transparent 9%, transparent 100%);
    -webkit-background-clip: text;
    background-clip: text;
    animation: chrome-shine 9s ease-in-out infinite;
    background-size: 200% 100%;
    background-position: 0 0;
    color: transparent;
    pointer-events: none;
}

@keyframes chrome-shine { 0% { background-position: -100% 0; } 100% { background-position: 300% 0; } }

/* Smaller tagline spacing with metallic title */
.logo-text p { margin-top: .35rem; }

/* Scroll state scaling */
.site-header.scrolled .logo-text h1.chrome-text {
    font-size: 1.8rem;
    transition: font-size .35s ease;
}



.logo-text p {
    font-family: var(--font-secondary);
    font-size: 1.1rem;
    color: #666;
    margin: 0.3rem 0 0;
}

/* RTL text alignment */
html[dir="rtl"] .logo-text {
    text-align: right;
}

/* ===== MEGA MENU STYLES ===== */
.nav-bar {
    background: rgba(255,255,255,0.95);
    border-top: 1px solid #eee;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    position: absolute;
    bottom: 0;
    transition: all 0.3s ease;
}

/* Enhanced nav bar when scrolled */
.site-header.scrolled .nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    border-top: none;
    z-index: var(--z-nav-scrolled);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.main-nav {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-nav ul {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    height: 100%;
}

.main-nav ul li {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    margin: 0;
}

/* Ensure dropdown positioning doesn't interfere with fixed mega menu */
.dropdown {
    position: static;
}

.main-nav ul li a,
.dropdown-toggle {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    height: 100%;
    color: var(--gray-600);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.main-nav ul li a:hover,
.dropdown-toggle:hover {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.dropdown-toggle {
    gap: 0.5rem;
    cursor: pointer;
}

.dropdown-toggle i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

/* Mega Menu Styles */
.mega-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    width: 100vw;
    background: linear-gradient(135deg, var(--gray-50) 0%, #ffffff 100%);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: var(--z-mega-menu);
    padding: 1.5rem 0;
    margin-top: 0;
    border-top: 3px solid var(--primary);
}

/* Adjust mega menu position when header is scrolled */
.site-header.scrolled .mega-menu {
    top: var(--nav-height);
}

.mega-menu-content {
    display: grid;
    grid-template-columns: 320px auto 320px;
    gap: 2rem;
    margin-bottom: 1rem;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 2rem;
}

/* Vertical Get Involved mega menu layout (CLEANED) */
/* Replaces previous scattered styles for involved menu */
.mega-menu-content--involved {
    grid-template-columns: 260px 300px; /* compact banner + items */
    align-items: stretch;
}
.mega-menu-cta-vertical {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: 1px solid rgba(37,99,235,0.35);
    border-radius: 8px;
    position: relative;
    display: flex;
    overflow: hidden;
    box-shadow: 0 6px 18px -4px rgba(37,99,235,0.35);
}
.mega-menu-cta-vertical::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 25% 20%, rgba(255,255,255,0.22), transparent 60%),
                linear-gradient(125deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 65%);
    pointer-events: none;
}
.mega-menu-cta-vertical .mega-menu-cta-inner {
    padding: 1.6rem 1.2rem 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
}
.mega-menu-cta-vertical h3 { margin: 0; font-size: 1.05rem; letter-spacing: .5px; font-weight: 700; color: rgba(43, 39, 39, 0.9);}
.mega-menu-cta-vertical p { margin: 0; font-size: .78rem; line-height: 1.5; color: rgba(43, 39, 39, 0.9); }
.mega-menu-cta-vertical .mega-menu-cta-button { border: none; }
.mega-menu-cta-vertical .vertical-btn,
.mega-menu-cta-vertical .vertical-donate-btn {
    width: 100%;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .65rem 1rem;
    border-radius: 30px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    transition: all .3s ease;
    box-shadow: 0 3px 10px -2px rgba(0,0,0,0.25);
}
.mega-menu-cta-vertical .vertical-btn { background: #fff; color: var(--primary); }
.mega-menu-cta-vertical .vertical-btn:hover { color: var(--primary-dark); transform: translateY(-2px); }
.mega-menu-cta-vertical .vertical-donate-btn { background: linear-gradient(135deg, var(--notice) 0%, var(--notice-light) 100%); color: #fff; margin-top: .55rem; box-shadow: 0 4px 12px -2px rgba(245,158,11,0.5); }
.mega-menu-cta-vertical .vertical-donate-btn:hover { filter: brightness(1.06); transform: translateY(-2px); }
.mega-menu-cta-vertical .vertical-donate-btn i { font-size: .7rem; }
/* Items column uses standard mega menu item styling; remove custom peach overrides */
.mega-menu-involved-items { background: #ffffff; }
.mega-menu-involved-items .mega-menu-item { background: var(--gray-50); }
/* Responsive */
@media (max-width: 1024px) {
  .mega-menu-content--involved { grid-template-columns: 1fr; }
  .mega-menu-cta-vertical { order: 2; }
}

/* RTL mega menu adjustments */
html[dir="rtl"] .mega-menu-content {
    margin-right: auto;
    margin-left: auto;
}

.mega-menu-col {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 300px;
}

.mega-menu-col::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
}

.mega-menu-col:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.2);
}

.mega-menu-header {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
}

.mega-menu-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary);
}

/* RTL header underline positioning */
html[dir="rtl"] .mega-menu-header::after {
    left: auto;
    right: 0;
}

.mega-menu-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    transition: all 0.25s ease;
    text-decoration: none;
    color: var(--gray-800);
    width: 100%;
    margin-bottom: 0.5rem;
    background: var(--gray-50);
    border: 1px solid transparent;
}

.mega-menu-item:last-child {
    margin-bottom: 0;
}

.mega-menu-item:hover {
    background: rgba(37, 99, 235, 0.05);
    transform: translateX(4px);
    border-color: rgba(37, 99, 235, 0.15);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

/* RTL hover animation direction */
html[dir="rtl"] .mega-menu-item:hover {
    transform: translateX(-4px);
}

.mega-menu-icon {
    background: var(--gray-100);
    color: var(--gray-600);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s ease;
    margin-top: 2px;
    border: 1px solid var(--gray-100);
}

.mega-menu-icon i {
    font-size: 14px;
    transition: all 0.25s ease;
}

.mega-menu-item:hover .mega-menu-icon {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.02);
}

.mega-menu-item:hover .mega-menu-icon i {
    transform: scale(1.05);
}

.mega-menu-text {
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.mega-menu-text h4 {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: var(--gray-600);
    font-weight: 600;
    transition: color 0.25s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
    text-transform: uppercase;
}

.mega-menu-text p {
    font-size: 0.8rem;
    color: var(--gray-600);
    line-height: 1.4;
    transition: color 0.25s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    font-family: var(--font-secondary);
    margin: 0;
}

.mega-menu-item:hover .mega-menu-text h4 {
    color: var(--primary);
}

.mega-menu-item:hover .mega-menu-text p {
    color: var(--gray-700);
}

.mega-menu-cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    color: white;
    position: relative;
}

.mega-menu-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.mega-menu-cta:hover::before {
    transform: translateX(100%);
}

.mega-menu-cta-content h3 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: white;
    font-weight: 700;
}

.mega-menu-cta-content p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 500px;
    line-height: 1.5;
}

.mega-menu-cta-button {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    padding: 0.7rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.25s ease;
    font-size: 0.85rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.mega-menu-cta-button:hover {
    background: white;
    color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* CTA button icon transition */
.mega-menu-cta-button i { transition: transform .3s ease; }
/* RTL: rotate icon 90deg for natural direction */
html[dir="rtl"] .mega-menu-cta-button i { transform: rotate(180deg); }
/* Optional hover nudge while preserving rotation */
html[dir="rtl"] .mega-menu-cta-button:hover i { transform: rotate(180deg) translateX(-2px); }

/* Show mega menu when active */
.dropdown.show .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    animation: megaMenuReveal 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.dropdown.show .dropdown-toggle i {
    transform: rotate(180deg);
}

.dropdown.show .dropdown-toggle {
    color: var(--primary);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
}

/* Animation for mega menu */
@keyframes megaMenuReveal {
    0% {
        opacity: 0;
        transform: translateY(-15px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation for columns */
.dropdown.show .mega-menu-col {
    animation: columnSlideIn 0.5s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
    opacity: 0;
}

.dropdown.show .mega-menu-col:nth-child(1) { animation-delay: 0.1s; }
.dropdown.show .mega-menu-col:nth-child(2) { animation-delay: 0.2s; }
.dropdown.show .mega-menu-col:nth-child(3) { animation-delay: 0.3s; }

@keyframes columnSlideIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Add a pseudo-element to prevent hover gap issues */
.dropdown::after {
    content: '';
    position: absolute;
    height: 15px;
    width: 100%;
    bottom: -15px;
    left: 0;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    margin-left: auto;
}

/* RTL action buttons positioning */
html[dir="rtl"] .action-buttons {
    margin-left: 0;
    margin-right: auto;
}
.action-buttons a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.action-buttons a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.action-buttons a:hover::before {
    left: 100%;
}

.donate-btn {
    background: linear-gradient(135deg, var(--notice) 0%, var(--notice-light) 100%);
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.donate-btn:hover {
    background: linear-gradient(135deg, var(--notice-light) 0%, var(--notice) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.seek-help {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.seek-help:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.action-buttons a i {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.action-buttons a:hover i {
    transform: scale(1.1);
}

/* ===== LANGUAGE SWITCHER ===== */
.language-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(70px, auto));
    gap: 0.35rem;
    margin-left: 1.5rem;
    padding: 0.35rem;
    background: rgba(255,255,255,0.9);
    border-radius: 10px;
}

/* RTL language switcher positioning */
html[dir="rtl"] .language-switcher {
    margin-left: 0;
    margin-right: 1.5rem;
}

.language-switcher a {
    font-weight: 300;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.3rem 0.65rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.language-switcher a span[class^="flag-"] {
    font-size: 1em;
}

.language-option.active,
.language-switcher a.active {
    background: #ffb347;
    color: var(--primary-dark) !important;
    font-weight: 700;
    border: 1.5px solid #ffd580;
    box-shadow: 0 2px 6px rgba(255,179,71,0.12);
}

[class^="flag-"] {
    font-size: 1.2em;
    line-height: 1;
    margin-right: 0.4rem;
    display: inline-block;
    vertical-align: middle;
}

.flag-en:before {content:"🇬🇧";}
.flag-ar:before {content:"🇸🇦";}
.flag-es:before {content:"🇪🇸";}
.flag-fr:before {content:"🇫🇷";}

/* ===== MOBILE STYLES ===== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 1rem;
    z-index: var(--z-mobile-toggle);
}

/* RTL mobile menu positioning */
html[dir="rtl"] .mobile-menu-toggle {
    margin-left: auto;
    margin-right: 0;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #333;
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-top: 3px solid var(--primary);
    z-index: var(--z-mega-menu);
}

.mobile-nav.active {
    display: block;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav li {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav li:last-child {
    border-bottom: none;
}

.mobile-nav a {
    display: block;
    padding: 15px 20px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* RTL mobile nav text alignment */
html[dir="rtl"] .mobile-nav a {
    text-align: right;
}

/* Mobile menu toggle button states */
.mobile-menu-toggle.active {
    background: rgba(37, 99, 235, 0.1);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

@keyframes slideDown {
    from { 
        opacity: 0; 
        max-height: 0;
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        max-height: 100vh;
        transform: translateY(0); 
    }
}

.mobile-actions {
    padding: 12px 20px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mobile-actions a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-actions a i {
    font-size: 0.85rem;
}

.mobile-actions .seek-help {
    background: var(--notice);
    color: white;
}

.mobile-actions .donate-btn {
    background: var(--primary);
    color: white;
}

.mobile-lang-switcher {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    background: #f8f9fa;
    display: block;
}

.mobile-lang-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.mobile-lang-switcher .language-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.mobile-lang-switcher a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #666;
    background: white;
    transition: all 0.3s ease;
    min-width: 60px;
    justify-content: center;
}

.mobile-lang-switcher a span[class^="flag-"] {
    font-size: 1em;
}

.mobile-lang-switcher a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Mobile Dropdown Styles */
.mobile-dropdown {
    position: relative;
}

.mobile-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.mobile-dropdown-toggle i {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
    color: var(--primary);
}

.mobile-dropdown.active .mobile-dropdown-toggle i {
    transform: rotate(180deg);
}

.mobile-submenu {
    display: none !important; /* Force hide with !important */
    background: #f8f9fa;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mobile-dropdown.active .mobile-submenu {
    display: block !important; /* Show when active with !important */
}

.mobile-submenu li {
    border-bottom: none;
}

.mobile-submenu a {
    padding: 12px 20px 12px 40px;
    font-size: 0.9rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 10px;
}

html[dir="rtl"] .mobile-submenu a {
    padding: 12px 40px 12px 20px;
}

.mobile-submenu a i {
    color: var(--primary);
    font-size: 0.85rem;
    width: 20px;
}

.mobile-submenu a:hover {
    background: #e9ecef;
    color: var(--primary);
}

/* ===== NAV ACTION BUTTONS (revamped style) ===== */
.nav-action-buttons {
    display: none; /* hidden until scroll */
    gap: 0.65rem;
    align-items: center;
    margin-left: auto;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .35s ease, transform .35s ease;
}

html[dir="rtl"] .nav-action-buttons {
    margin-left: 0;
    margin-right: auto;
    flex-direction: row-reverse;
}

.site-header.scrolled .nav-action-buttons {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.nav-action-buttons a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.85rem;
    min-height: 32px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    line-height: 1;
    text-decoration: none;
    overflow: hidden;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.08);
    color: var(--gray-700);
    transition: background .4s ease, box-shadow .4s ease, transform .35s ease;
    isolation: isolate;
}

.nav-action-buttons a i {
    font-size: .75rem;
    transition: transform .35s ease;
}

/* Animated sheen */
.nav-action-buttons a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: translateX(-120%);
    transition: transform .8s ease;
    pointer-events: none;
    mix-blend-mode: screen;
}

.nav-action-buttons a:hover::before,
.nav-action-buttons a:focus-visible::before {
    transform: translateX(120%);
}

/* Focus ring */
.nav-action-buttons a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Variant: Seek Help */
.nav-action-buttons .nav-seek-help {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow: 0 4px 12px -2px rgba(37,99,235,0.35), 0 2px 4px rgba(0,0,0,0.08);
}

.nav-action-buttons .nav-seek-help:hover,
.nav-action-buttons .nav-seek-help:focus-visible {
    box-shadow: 0 6px 18px -3px rgba(37,99,235,0.5), 0 3px 6px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Variant: Donate */
.nav-action-buttons .nav-donate-btn {
    background: linear-gradient(135deg, var(--notice) 0%, var(--notice-light) 100%);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 4px 12px -2px rgba(245,158,11,0.35), 0 2px 4px rgba(0,0,0,0.08);
}

.nav-action-buttons .nav-donate-btn:hover,
.nav-action-buttons .nav-donate-btn:focus-visible {
    box-shadow: 0 6px 18px -3px rgba(245,158,11,0.55), 0 3px 6px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Icon lift on hover */
.nav-action-buttons a:hover i,
.nav-action-buttons a:focus-visible i {
    transform: translateY(-2px) scale(1.08);
}

/* Subtle pulse attention (only after scroll) */
.site-header.scrolled .nav-action-buttons .nav-donate-btn {
    animation: pulseAccent 4.5s ease-in-out 1.2s infinite;
}

@keyframes pulseAccent {
    0%, 60%, 100% {
        filter: brightness(1);
    }
    30% {
        filter: brightness(1.2);
    }
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 1024px) {
    .mega-menu-content {
        grid-template-columns: 300px 300px;
        gap: 2rem;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Smaller language switcher on tablets */
    .language-switcher {
        grid-template-columns: repeat(2, minmax(60px, auto));
        gap: 0.25rem;
        margin-left: 1rem;
        padding: 0.25rem;
    }
    
    html[dir="rtl"] .language-switcher {
        margin-right: 1rem;
    }
    
    .language-switcher a {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        gap: 0.25rem;
    }
    
    /* Smaller action buttons on tablets */
    .action-buttons {
        gap: 0.5rem;
    }
    
    .action-buttons a {
        padding: 0.45rem 0.75rem;
        font-size: 0.75rem;
        gap: 0.3rem;
    }
    
    .action-buttons a i {
        font-size: 0.8rem;
    }
    
    .nav-action-buttons a {
        padding: 0.5rem 0.75rem;
        font-size: 0.65rem;
        gap: 0.3rem;
        min-height: 30px;
    }
    
    .nav-action-buttons a i {
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    /* Mobile header height adjustment */
    :root { 
        --header-height: 120px; 
    }

    /* Hide desktop navigation elements on mobile */
    .main-nav,
    .language-switcher,
    .action-buttons,
    .nav-action-buttons,
    .nav-bar {
        display: none !important;
    }

    .mobile-menu-toggle {
        display: block;
    }

    /* Header container adjustments */
    .header-container {
        padding: 0.4rem 0.6rem 0.6rem;
        height: calc(var(--header-height));
    }

    /* Logo adjustments */
    .logo {
        flex-wrap: nowrap;
        align-items: flex-start;
    }

    .logo img {
        height: 75px;
        flex-shrink: 0;
    }

    /* Logo text styling */
    .logo-text {
        max-width: 100%;
    }

    .logo-text h1.chrome-text {
        font-size: clamp(1.15rem, 5.2vw, 1.55rem);
        white-space: normal;
        word-break: break-word;
        line-height: 1.15;
        text-align: left;
        max-width: 230px;
        letter-spacing: 0.05em;
        overflow: hidden;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .logo-text p {
        font-size: 0.9rem;
        line-height: 1.2;
        max-width: 230px;
        text-align: left;
    }

    /* Mobile scroll behavior - keep normal header behavior */
    .site-header.scrolled {
        height: var(--header-height);
        background: var(--gray-50);
        backdrop-filter: none;
        box-shadow: var(--shadow-md);
    }
    
    .site-header.scrolled .header-container {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .site-header.scrolled .logo-text h1.chrome-text {
        font-size: clamp(1.15rem, 5.2vw, 1.55rem);
    }
    
    .site-header.scrolled .mobile-menu-toggle {
        position: relative;
        top: auto;
        right: auto;
        opacity: 1;
        transform: none;
        z-index: var(--z-mobile-toggle);
        background: none;
        border-radius: 0;
        padding: 1rem;
    }
    
    /* Hide mega menu on mobile */
    .mega-menu {
        display: none !important;
    }
    
    /* Mobile action buttons */
    .mobile-actions {
        display: flex;
        gap: 1rem;
        margin: 1rem 0;
        justify-content: center;
        padding: 1rem;
        border-top: 1px solid #f0f0f0;
    }
    
    .mobile-actions a {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.8rem 1.5rem;
        border-radius: 25px;
        text-decoration: none;
        font-weight: 600;
        font-size: 0.9rem;
        transition: all 0.3s ease;
        flex: 1;
        justify-content: center;
        min-width: 140px;
    }
    
    .mobile-actions .seek-help {
        background: linear-gradient(135deg, var(--notice) 0%, var(--notice-light) 100%);
        color: white;
        box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
    }
    
    .mobile-actions .donate-btn {
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
        color: white;
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    }
    
    .mobile-actions .seek-help:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    }
    
    .mobile-actions .donate-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);  
    }
    
    /* RTL mobile adjustments */
    html[dir="rtl"] .header-container {
        flex-direction: row-reverse;
    }
    
    html[dir="rtl"] .logo {
        margin-left: auto;
        margin-right: 0;
    }
    
    html[dir="rtl"] .mobile-menu-toggle {
        margin-left: 0;
        margin-right: auto;
    }
    
    html[dir="rtl"] .mobile-actions {
        flex-direction: row-reverse;
    }
    
    html[dir="rtl"] .mobile-lang-switcher {
        direction: rtl;
        text-align: right;
    }

    html[dir="rtl"] .logo-text h1.chrome-text,
    html[dir="rtl"] .logo-text p {
        text-align: right;
    }
}



/* ===== RTL SPECIFIC ANIMATIONS ===== */
/* Shimmer effect for RTL */
html[dir="rtl"] .mega-menu-cta::before {
    background: linear-gradient(-45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(100%);
}

html[dir="rtl"] .mega-menu-cta:hover::before {
    transform: translateX(-100%);
}

/* RTL button hover effects */
html[dir="rtl"] .action-buttons a::before {
    left: 100%;
}

html[dir="rtl"] .action-buttons a:hover::before {
    left: -100%;
}

/* ===== ADDITIONAL RTL TYPOGRAPHY ===== */


html[dir="rtl"] .mega-menu-text h4,
html[dir="rtl"] .mega-menu-text p {
    text-align: right;
}

html[dir="rtl"] .mega-menu-header {
    text-align: right;
}

html[dir="rtl"] .mega-menu-cta-content {
    text-align: right;
}

/* RTL dropdown positioning */
html[dir="rtl"] .dropdown-toggle i {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* RTL flag positioning */
html[dir="rtl"] [class^="flag-"] {
    margin-right: 0;
    margin-left: 0.4rem;
}