
/* Modern CSS Reset & Variables */
:root {
    /* Light Theme - Refined for crispness and warmth */
    --light-bg: #fdfdfe; /* Slightly warmer off-white */
    --light-surface: #ffffff;
    --light-text: #1e293b; /* Slate 800 - softer than pure black */
    --light-text-secondary: #64748b; /* Slate 500 */
    --light-primary: #2563eb; /* Royal Blue - stronger pop */
    --light-primary-hover: #1d4ed8;
    --light-accent: #7c3aed; /* Violet 600 */
    --light-border: rgba(148, 163, 184, 0.15);
    --light-glass: rgba(255, 255, 255, 0.9);
    --light-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    --light-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);

    /* Dark Theme - Deep, rich, and high contrast */
    --dark-bg: #030712; /* Gray 950 - darker, richer black */
    --dark-surface: #0f172a; /* Slate 900 */
    --dark-text: #f1f5f9; /* Slate 100 */
    --dark-text-secondary: #94a3b8; /* Slate 400 */
    --dark-primary: #3b82f6; /* Blue 500 - glowing blue */
    --dark-primary-hover: #60a5fa;
    --dark-accent: #8b5cf6; /* Violet 500 */
    --dark-border: rgba(255, 255, 255, 0.08);
    --dark-glass: rgba(3, 7, 18, 0.7);
    --dark-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6);
    --dark-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.7);

    /* Shared */
    --transition-base: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --border-radius: 12px;
    --container-width: 1280px;
    --nav-height: 80px;
    
    /* Z-Index Layers */
    --z-mega-menu: 998;
    --z-navbar: 1000;
    --z-dropdown: 1002;
    --z-mobile-menu: 1005;
    --z-backdrop: 1004;
}

[data-theme="light"] {
    --bg: var(--light-bg);
    --surface: var(--light-surface);
    --text: var(--light-text);
    --text-secondary: var(--light-text-secondary);
    --primary: var(--light-primary);
    --primary-hover: var(--light-primary-hover);
    --accent: var(--light-accent);
    --border: var(--light-border);
    --glass: var(--light-glass);
    --shadow: var(--light-shadow);
    --shadow-lg: var(--light-shadow-lg);
}

[data-theme="dark"] {
    --bg: var(--dark-bg);
    --surface: var(--dark-surface);
    --text: var(--dark-text);
    --text-secondary: var(--dark-text-secondary);
    --primary: var(--dark-primary);
    --primary-hover: var(--dark-primary-hover);
    --accent: var(--dark-accent);
    --border: var(--dark-border);
    --glass: var(--dark-glass);
    --shadow: var(--dark-shadow);
    --shadow-lg: var(--dark-shadow-lg);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 14px;
}

@media (max-width: 768px) {
    html {
        font-size: 11px; /* ~20-30% smaller for mobile as requested */
    }
}

html.app-loading body {
    visibility: hidden;
    opacity: 0;
}

:root {
    /* Fonts Defaults (English) */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Manrope', system-ui, -apple-system, sans-serif;
}

/* Language Overrides */
:lang(he) {
    --font-heading: 'Rubik', sans-serif;
    --font-body: 'Heebo', sans-serif;
}

:lang(ar) {
    --font-heading: 'Readex Pro', sans-serif;
    --font-body: 'Almarai', sans-serif;
}

:lang(ru) {
    --font-heading: 'Rubik', sans-serif;
    --font-body: 'Manrope', sans-serif;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text);
    transition: background-color var(--transition-base), color var(--transition-base);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Utility Classes */
.text-center { text-align: center !important; }
.d-flex { display: flex !important; }
.justify-content-center { justify-content: center !important; }
.flex-wrap { flex-wrap: wrap !important; }
.gap-3 { gap: 1rem !important; }
.mt-5 { margin-top: 3rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }

/* Accessibility Focus Styles */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; color: var(--text-secondary); }

a { color: var(--text); text-decoration: none; transition: color var(--transition-base); }
a:hover { color: var(--primary); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    font-size: 0.95rem;
    gap: 8px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
    filter: brightness(1.1);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

/* Glassmorphism Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all var(--transition-smooth);
    height: 100%;
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.05);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: var(--z-navbar);
    transition: background-color 0.3s ease, padding 0.3s ease, border-color 0.3s ease;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid transparent;
    /* Use flex column to allow wrapper to expand height naturally */
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: var(--nav-height);
    padding: 0; /* Padding moved to container or handled by flex gap */
}

[data-theme="light"] .navbar {
    background: transparent;
}

.navbar.scrolled,
.navbar.mega-open {
    background: var(--surface); /* Full opaque background */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.navbar.scrolled {
    min-height: 70px; /* Slight shrink on scroll */
}

[data-theme="light"] .navbar.scrolled,
[data-theme="light"] .navbar.mega-open {
    background: #ffffff;
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Order 1 ensures it stays at top */
    order: 1;
    width: 100%;
    height: var(--nav-height);
    position: relative;
    z-index: 1001; 
    flex-shrink: 0; /* Prevent shrinking when menu opens */
    flex-direction: row; /* Standard LTR: Logo Left, Controls Right */
}

/* RTL: Logo Right (Start), Controls Left (End) - Standard Flex Behavior */
[dir="rtl"] .nav-container {
    flex-direction: row;
}

.navbar.scrolled .nav-container {
    height: 70px;
}

.nav-links {
    display: flex;
    gap: 2.5rem; /* Increased gap */
    align-items: center;
}

.nav-right-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    background: none;
    border: none;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text);
    opacity: 0.9;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all var(--transition-base);
    font-family: inherit;
}

.nav-link:hover, .nav-link.active {
    opacity: 1;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.nav-link i {
    font-size: 0.8em;
    transition: transform var(--transition-base);
}

.nav-link.mega-trigger.active i {
    transform: rotate(180deg);
}

/* Mega Menu Wrapper - Extends the Navbar */
.mega-menu-wrapper {
    /* Flow naturally in flex container */
    order: 2;
    position: relative;
    width: 100%;
    
    /* Animation: Expand height */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s ease;
    
    /* Transparent: uses navbar background */
    background: transparent;
    border-top: 1px solid rgba(148, 163, 184, 0.1); /* Subtle divider */
}

.mega-menu-wrapper.active {
    max-height: 80vh; /* Allow expansion */
    opacity: 1;
    visibility: visible;
}

/* Menu Content */
.mega-menu-content, 
[data-theme="light"] .mega-menu-content,
.mega-menu-content.glass-card,
[data-theme="light"] .mega-menu-content.glass-card {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0.5rem 0 2rem; /* Reduced top padding to bring buttons closer */
    transform: none;
    transition: none;
    max-height: none;
    overflow-y: visible;
}

/* Revert Container behavior */
.mega-menu-content .container {
    width: 100%;
    padding: 0 2.5rem;
    margin: 0 auto;
    max-width: var(--container-width);
}

.mega-section {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.mega-section.active {
    display: block;
}

.mega-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.mega-col h4.mega-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.mega-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    transition: all var(--transition-base);
    text-decoration: none;
    color: var(--text);
    border: 1px solid transparent;
}

.mega-item:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.1);
    transform: translateX(5px);
}

.mega-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    transition: all var(--transition-base);
}

.mega-item:hover .mega-icon {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.mega-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mega-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

.mega-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Lang Dropdown */
.lang-dropdown-container {
    position: relative;
    z-index: var(--z-dropdown);
}

.lang-dropdown-trigger {
    background: transparent;
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    transition: all var(--transition-base);
}

.lang-dropdown-trigger:hover, .lang-dropdown-trigger[aria-expanded="true"] {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: var(--z-dropdown);
    height: auto !important; /* Override glass-card */
    overflow: visible !important; /* Override glass-card */
}

.lang-dropdown-trigger[aria-expanded="true"] + .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-base);
    color: var(--text);
}

.language-option:hover, .language-option:focus {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    outline: none;
}

/* Mobile Menu & Hamburger */
.menu-btn { 
    display: none; 
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1006; /* Always on top */
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color var(--transition-base);
}

.menu-btn:hover {
    background: rgba(59, 130, 246, 0.1);
}

.hamburger-box {
    width: 24px;
    height: 20px;
    display: inline-block;
    position: relative;
    vertical-align: middle;
}

.hamburger-inner {
    display: block;
    top: 50%;
    margin-top: -1.5px;
    width: 24px;
    height: 2px;
    background-color: var(--text);
    border-radius: 2px;
    position: absolute;
    transition: transform 0.15s cubic-bezier(0.645, 0.045, 0.355, 1), background-color 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.hamburger-inner::before, .hamburger-inner::after {
    content: "";
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text);
    border-radius: 2px;
    position: absolute;
    transition: transform 0.15s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.hamburger-inner::before { top: -8px; }
.hamburger-inner::after { bottom: -8px; }

.menu-btn.active .hamburger-inner {
    background-color: transparent !important;
}

.menu-btn.active .hamburger-inner::before {
    transform: translateY(8px) rotate(45deg);
}

.menu-btn.active .hamburger-inner::after {
    transform: translateY(-8px) rotate(-45deg);
}

/* Redesigned Mobile Menu - Slide In Drawer */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0; /* LTR: Drawer opens from Right (same side as Hamburger) */
    left: auto;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    height: 100dvh;
    background: var(--surface);
    z-index: 1005;
    display: flex;
    flex-direction: column;
    transform: translateX(100%); /* Hidden to Right */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 25px rgba(0,0,0,0.5);
    overflow-y: auto;
    overflow-x: hidden;
    border-left: 1px solid var(--border);
    border-right: none;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
    padding-bottom: env(safe-area-inset-bottom); /* handle iPhone home bar */
}

[data-theme="light"] .mobile-menu {
    background: #ffffff;
    box-shadow: 5px 0 25px rgba(0,0,0,0.1);
}

.mobile-menu.active {
    transform: translateX(0);
}

/* Mobile Header */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface); /* Opaque background for sticky behavior */
    position: sticky;
    top: 0;
    z-index: 10;
}

[data-theme="light"] .mobile-menu-header {
    background: #ffffff;
}

.mobile-brand-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-brand-title img {
    height: 30px;
    width: auto;
}

.close-menu-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.close-menu-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

/* Mobile Links Container */
.mobile-nav-links {
    padding: 1.5rem 1.5rem 4rem 1.5rem; /* Extra bottom padding */
    flex: 1 0 auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: max-content; /* Ensure it takes up space */
}

/* Accordion Items */
.mobile-nav-item {
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    transition: background 0.2s ease;
}

.mobile-nav-item.active {
    background: rgba(59, 130, 246, 0.05);
}

.mobile-nav-link-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.mobile-nav-link-header i {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.mobile-nav-item.active .mobile-nav-link-header {
    color: var(--primary);
}

.mobile-nav-item.active .mobile-nav-link-header i {
    transform: rotate(180deg);
    color: var(--primary);
}

/* Submenu */
.mobile-nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
}

.mobile-nav-item.active .mobile-nav-submenu {
    max-height: 400px;
    opacity: 1;
    padding-bottom: 0.5rem;
}

.mobile-sub-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 10px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    margin-left: 16px;
}

[dir="rtl"] .mobile-sub-link {
    padding: 10px 24px 10px 16px;
    border-left: none;
    border-right: 2px solid transparent;
    margin-left: 0;
    margin-right: 16px;
}

.mobile-sub-link:hover {
    color: var(--text);
    border-color: var(--primary);
    background: rgba(255,255,255,0.02);
}

.mobile-sub-icon {
    font-size: 1rem;
    color: var(--primary);
    width: 20px;
    display: flex;
    justify-content: center;
}

/* Simple Link */
.mobile-link-simple {
    padding: 14px 16px;
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.mobile-link-simple:hover {
    background: rgba(59, 130, 246, 0.05);
    color: var(--primary);
}

/* Footer Actions */
.mobile-menu-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    background: rgba(var(--surface), 0.5);
    flex-shrink: 0;
}

[data-theme="light"] .mobile-menu-footer {
    background: #f8f9fa;
}

.mobile-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mobile-auth-buttons .btn {
    width: 100%;
    justify-content: center;
    font-size: 1rem;
}

/* Mobile Settings (Lang/Theme) */
.mobile-settings {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding-top: 0.5rem;
}

.mobile-setting-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-setting-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--nav-height);
    overflow: hidden;
    text-align: center;
}

/* Global Animated Background */
.hero-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
    will-change: transform;
}

.blob-1 { top: -20%; left: -10%; width: 50vw; height: 50vw; background: var(--primary); animation-delay: 0s; }
.blob-2 { bottom: -20%; right: -10%; width: 50vw; height: 50vw; background: var(--accent); animation-delay: -5s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.brand-main-title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.05em;
    line-height: 1.2;
    direction: ltr !important; /* Always LTR */
    unicode-bidi: isolate;
}

[data-theme="light"] .brand-main-title {
    background: linear-gradient(135deg, var(--primary), var(--text));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-title {
    margin-bottom: 1.5rem;
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem); /* Slightly smaller to balance hierarchy */
    font-weight: 800;
    letter-spacing: -0.03em;
    direction: ltr !important; /* Always LTR */
    unicode-bidi: isolate;
}

.hero-title .hero-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block; /* Ensure gradient works properly */
}

/* Creative Word Animation */
.hero-word {
    display: inline-block;
    opacity: 0;
    transform-origin: bottom center;
    animation: creativeFadeIn 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    will-change: transform, opacity, filter;
}

.hero-word:nth-child(1) { animation-delay: 0.2s; }
.hero-word:nth-child(2) { animation-delay: 0.4s; }
.hero-word:nth-child(3) { animation-delay: 0.6s; }
.hero-word:nth-child(4) { animation-delay: 0.8s; }
.hero-word:nth-child(5) { animation-delay: 1.0s; }

@keyframes creativeFadeIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.9) rotate(3deg);
        filter: blur(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
        filter: blur(0);
    }
}

/* Sections & Grids */
.section { padding: 6rem 0; scroll-margin-top: 100px; }
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 1.5rem; }
@media (min-width: 768px) {
    .container { padding: 0 2.5rem; }
}
.section-header { margin-bottom: 4rem; }
.section-header h2 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}
.section-divider {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    margin: 1.5rem auto 0;
    border-radius: 2px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-icon, .service-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-card {
    position: relative;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: var(--text);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    color: var(--text);
    text-decoration: none;
    transform: translateY(-5px);
}

.service-card::after {
    content: "→";
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.service-card:hover::after {
    opacity: 1;
    transform: translateX(0);
}

[dir="rtl"] .service-card::after {
    content: "←";
    right: auto;
    left: 20px;
    transform: translateX(10px);
}

[dir="rtl"] .service-card:hover::after {
    transform: translateX(0);
}

/* Pricing */
.pricing { background: rgba(0,0,0,0.02); }

.pricing-header {
    text-align: center;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.pricing-header h2 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.pricing-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
    background: var(--surface);
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid var(--border);
}

.pricing-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; }
.pricing-card { flex: 1 1 300px; max-width: 350px; display: flex; flex-direction: column; }
.features-list { margin-bottom: 2rem; }
.pricing-card .btn { margin-top: auto; }

.price { font-size: 2.5rem; font-weight: 800; margin: 1.5rem 0; color: var(--text); }
.price span { font-size: 1rem; color: var(--text-secondary); font-weight: 500; }
.features-list { list-style: none; margin: 2rem 0; flex-grow: 1; }
.features-list li { margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.75rem; color: var(--text-secondary); }
.check-icon { color: var(--primary); }

/* Switch Toggle */
.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border); transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(22px); }

/* FAQ */
.faq-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.faq-item {
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.faq-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

.faq-question { 
    padding: 1.5rem; 
    cursor: pointer; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-weight: 600;
    font-size: 1.1rem;
}

.faq-answer { 
    padding: 0 1.5rem 1.5rem; 
    color: var(--text-secondary); 
    line-height: 1.7;
}

.faq-question i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
    color: var(--primary);
}

/* Footer */
footer { padding: 4rem 0 2rem; border-top: 1px solid var(--border); text-align: center; background: var(--surface); }
.footer-links { display: flex; justify-content: center; gap: 2rem; margin-bottom: 2rem; flex-wrap: wrap; }

/* Contact Form */
.form-group input, .form-group textarea {
    width: 100%;
    padding: 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 12px;
    transition: all var(--transition-base);
    font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Custom Radio Buttons */
.custom-control {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    padding-left: 1.5rem;
}

.custom-control-input {
    position: absolute;
    left: 0;
    z-index: -1;
    width: 1rem;
    height: 1.25rem;
    opacity: 0;
}

.custom-control-label {
    position: relative;
    margin-bottom: 0;
    vertical-align: top;
    cursor: pointer;
    color: var(--text);
    font-size: 0.95rem;
}

.custom-control-label::before {
    position: absolute;
    top: 0.15rem;
    left: -1.5rem;
    display: block;
    width: 1rem;
    height: 1rem;
    pointer-events: none;
    content: "";
    background-color: rgba(255,255,255,0.1);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.custom-control-label::after {
    position: absolute;
    top: 0.15rem;
    left: -1.5rem;
    display: block;
    width: 1rem;
    height: 1rem;
    content: "";
    background: no-repeat 50% / 50% 50%;
}

.custom-radio .custom-control-label::before {
    border-radius: 50%;
}

.custom-control-input:checked ~ .custom-control-label::before {
    color: #fff;
    border-color: var(--primary);
    background-color: var(--primary);
}

.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

.custom-control-input:checked ~ .custom-control-label::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
}

[data-theme="light"] .custom-control-label::before {
    background-color: #fff;
}

/* Form Validation Styles */
.is-invalid {
    border-color: #ff6b6b !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23ff6b6b' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ff6b6b' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.is-valid {
    border-color: #28a745 !important;
}

/* Promo Banner */
.promo-banner {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 10px 0;
    text-align: center;
    font-weight: 500;
}
.promo-banner.hidden { display: none; }

/* Responsive */
@media (max-width: 1024px) {
    .nav-links { display: none; }
    .menu-btn { display: block; }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    .hero-content { padding: 0 1.5rem; }
    .mega-grid { grid-template-columns: 1fr; gap: 2rem; }
    
    /* Center Pricing Cards on Mobile */
    .pricing-cards {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    .pricing-card {
        width: 100%;
        max-width: 350px;
        flex: 0 1 auto; /* Fix vertical stretching */
    }

    /* Smaller Language Selection in Mobile Menu */
    .mobile-lang-item {
        min-width: 60px;
        padding: 6px;
    }
    .mobile-lang-flag {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }
    .mobile-lang-name {
        font-size: 0.75rem;
    }
    .mobile-lang-scroll {
        padding: 0 2rem 2rem; /* Position at bottom with padding */
        margin-bottom: 0;
    }

    /* Improved Contact Form on Mobile */
    .contact-type-group {
        display: grid !important; /* Force grid over flex */
        grid-template-columns: 1fr 1fr;
        gap: 1rem !important;
        justify-items: start;
    }

    .glass-card {
        padding: 1.5rem; /* Reduce padding on mobile */
    }

    .section {
        padding: 4rem 0; /* Consistent spacing */
    }
}

/* Security Diagram Animation */
.security-diagram-container {
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    border: 1px solid var(--border);
    margin: 4rem auto;
    max-width: 900px;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    overflow-x: auto;
}

.flow-track {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 0 20px;
    min-width: 700px; /* Prevent squashing on mobile */
}

.flow-node {
    width: 90px;
    height: 90px;
    background: var(--surface);
    border: 2px solid var(--primary);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    position: relative;
    z-index: 2;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.flow-node:hover {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.5);
    border-color: var(--accent);
    color: var(--accent);
}

.flow-label {
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    color: var(--text);
    opacity: 0.9;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.flow-connection {
    flex-grow: 1;
    position: relative;
    margin: 0 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.line-label {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 600;
}

.flow-line {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.flow-particle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
    animation: flowMove 2s infinite linear;
    filter: blur(2px);
    opacity: 0.7;
}

@keyframes flowMove {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Animations */
.animate-on-scroll { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.animate-in { opacity: 1; transform: translateY(0); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* RTL Support */
[dir="rtl"] { text-align: right; }
/* RTL Mobile Menu: Left Side (matching Hamburger on Left) */
[dir="rtl"] .mobile-menu { 
    left: 0; 
    right: auto; 
    transform: translateX(-100%); /* Hidden to Left */
    border-right: 1px solid var(--border); 
    border-left: none;
    box-shadow: 5px 0 25px rgba(0,0,0,0.5);
}
[dir="rtl"] .mobile-menu.active { transform: translateX(0); }
/* [dir="rtl"] .close-menu-btn { float: left; } Removed float, handled by flex */
[dir="rtl"] .mega-item:hover { transform: translateX(-5px); }
/* [dir="rtl"] .mobile-nav-links a:hover { padding-left: 1rem; padding-right: 1.5rem; } Removed specific padding override */
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }


/* Accessibility Widget */
#a11y-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 1003; /* Below mobile menu (1005) */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

#a11y-toggle:hover {
    transform: scale(1.1);
}

#a11y-toggle.active {
    transform: rotate(45deg);
    background: var(--primary);
    color: white;
}

.a11y-toggle-close {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
    cursor: pointer;
    transition: transform 0.2s;
}

.a11y-toggle-close:hover {
    transform: scale(1.1);
}

#a11y-menu {
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: 300px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 1003; /* Below mobile menu (1005) */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#a11y-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.a11y-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.a11y-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.a11y-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
}

.a11y-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.a11y-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: rgba(0,0,0,0.05);
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text);
    transition: all 0.2s;
}

.a11y-option:hover {
    background: var(--primary);
    color: white;
}

.a11y-option i {
    font-size: 1.2rem;
}

/* Accessibility Modes */
html.a11y-grayscale { filter: grayscale(100%); }
html.a11y-high-contrast { filter: contrast(150%); }
html.a11y-grayscale.a11y-high-contrast { filter: grayscale(100%) contrast(150%); }

/* Enhanced Light Background Mode - Strict Overrides */
html.a11y-light-bg,
html.a11y-light-bg body,
html.a11y-light-bg [data-theme="dark"],
html.a11y-light-bg footer,
html.a11y-light-bg section,
html.a11y-light-bg .page-content {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Containers reset to white with visible borders */
html.a11y-light-bg .navbar,
html.a11y-light-bg .navbar.scrolled,
html.a11y-light-bg .glass-card,
html.a11y-light-bg .pricing,
html.a11y-light-bg .pricing-toggle,
html.a11y-light-bg .hero-bg,
html.a11y-light-bg .mobile-menu,
html.a11y-light-bg .mega-menu-content,
html.a11y-light-bg #a11y-menu,
html.a11y-light-bg .legal-content,
html.a11y-light-bg .lang-dropdown,
html.a11y-light-bg .form-control,
html.a11y-light-bg input,
html.a11y-light-bg textarea,
html.a11y-light-bg footer,
html.a11y-light-bg .faq-answer {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid #000000 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    color: #000000 !important;
}

/* Force text visibility and remove gradients */
html.a11y-light-bg * {
    color: #000000 !important;
    text-shadow: none !important;
    -webkit-text-fill-color: currentColor !important;
    background-image: none !important; /* Removes gradients */
}

/* Buttons in light mode */
html.a11y-light-bg .btn {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    color: #000000 !important;
    box-shadow: none !important;
}

html.a11y-light-bg .btn-primary {
    background: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #000000 !important;
}

html.a11y-light-bg .btn-primary:hover {
    background: #333333 !important;
}

html.a11y-light-bg a {
    color: #0000EE !important;
    text-decoration: underline;
}

html.a11y-light-bg .feature-icon,
html.a11y-light-bg .service-icon,
html.a11y-light-bg i {
    color: #000000 !important;
    background: transparent !important;
}

/* Fix Accessibility Menu Items */
html.a11y-light-bg .a11y-option {
    border: 1px solid #000000 !important;
    background: #f0f0f0 !important;
}
html.a11y-light-bg .a11y-option:hover {
    background: #000000 !important;
    color: #ffffff !important;
}
html.a11y-light-bg .a11y-option:hover * {
    color: #ffffff !important;
}

html.a11y-links-underline a { text-decoration: underline !important; }
html.a11y-readable-font * { font-family: Arial, Helvetica, sans-serif !important; letter-spacing: 0.05em; }
html.a11y-readable-font i, 
html.a11y-readable-font [class^="ti-"], 
html.a11y-readable-font [class*=" ti-"] { 
    font-family: 'themify' !important; 
}
html.font-small { font-size: 90%; }
html.font-xsmall { font-size: 80%; }
html.font-large { font-size: 110%; }
html.font-huge { font-size: 120%; }

/* Modern Link Pill Style */
.link-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s ease;
    border: 1px solid rgba(59, 130, 246, 0.2);
    margin: 0 4px;
    text-decoration: none !important; /* Force no underline */
}

.link-pill:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    border-color: var(--primary);
}

[data-theme="light"] .link-pill {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

[data-theme="light"] .link-pill:hover {
    background: var(--primary);
    color: white;
}

/* Hide Accessibility Toggle when Mobile Menu is Open */
body.mobile-menu-open #a11y-toggle {
    transform: translateX(-200%);
    opacity: 0;
    pointer-events: none;
}

/* Custom API Icon */
.icon-api-text {
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: 900;
    font-size: 0.7em;
    letter-spacing: -0.05em;
    line-height: 1;
}

/* Ensure icons container can handle text centering nicely */
.mega-icon, .mobile-sub-icon {
    font-style: normal; /* Ensure text isn't italicized if it leaks */
}

/* Themed Alerts for Contact Form */
.themed-alert {
    position: relative;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.themed-alert-heading {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.themed-alert hr {
    border-top-color: rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
}

.themed-alert-success {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.2);
}

.themed-alert-error {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.2);
}

.themed-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: inherit;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}

.themed-close:hover {
    opacity: 1;
}

[dir="rtl"] .themed-close {
    right: auto;
    left: 1rem;
}

/* --- Fix Mobile Menu Background Scroll --- */
html.mobile-menu-open,
body.mobile-menu-open {
    overflow: hidden !important;
    position: fixed; /* Lock position */
    width: 100%;
    height: 100%;
}

/* Nav Controls */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1006;
    margin-inline-start: auto; /* Push to right if needed, though flex parent handles it */
}

/* Ensure backdrop exists and blocks interactions */
.menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1004; /* Below menu (1005) but above navbar (1000) */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* --- New Globe Language Selector --- */
.lang-btn-globe {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.lang-btn-globe:hover, 
.lang-btn-globe[aria-expanded="true"] {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

.lang-btn-globe[aria-expanded="true"] {
    background: var(--primary);
    color: white;
}

/* Dropdown tweaks */
.lang-dropdown-container {
    position: relative;
    display: inline-block;
}

/* Drop Up Variant (for Footer) */
.lang-dropdown-container.drop-up .lang-dropdown {
    top: auto;
    bottom: calc(100% + 10px);
    transform: translateY(-10px);
}

.lang-dropdown-container.drop-up .lang-dropdown-trigger[aria-expanded="true"] + .lang-dropdown {
    transform: translateY(0);
}

/* Footer Language Menu - Mobile Fix */
@media (max-width: 768px) {
    .site-footer .lang-dropdown {
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(10px);
    }
    
    .site-footer .lang-dropdown-container.drop-up .lang-dropdown {
        transform: translateX(-50%) translateY(-10px);
    }

    .site-footer .lang-dropdown-container.drop-up .lang-dropdown-trigger[aria-expanded="true"] + .lang-dropdown {
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile Menu Globe Position */
.mobile-lang-globe-container {
    display: none; /* Hidden as it moved to header */
}

/* TOS Banner */
.tos-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #1f2937; /* Dark grey */
    color: white;
    padding: 12px 0;
    z-index: 1001; /* Above navbar (1000) but below a11y (1003) and mobile menu (1005) */
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    display: none;
    font-family: var(--font-body);
}

.tos-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.tos-text {
    font-size: 1rem;
    font-weight: 500;
}

.tos-link {
    color: #60a5fa; /* Blue 400 */
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.tos-link:hover {
    color: #93c5fd; /* Blue 300 */
    text-decoration: underline;
}

.tos-dismiss-btn {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tos-dismiss-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

@media (max-width: 768px) {
    .tos-container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
