/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Responsive Breakpoints */
    --breakpoint-mobile: 360px;
    --breakpoint-tablet: 768px;
    --breakpoint-desktop: 1280px;
    --breakpoint-wide: 1920px;

    /* Colors */
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --primary-400: #818cf8;
    --primary-500: #6366f1;
    --success-500: #22c55e;
    --warning-500: #f59e0b;
    --error-500: #ef4444;
    --error-600: #dc2626;
    --info-500: #06b6d4;
    --dark-bg: #0f172a;
    --dark-bg-secondary: #1a1f35;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: rgba(226, 232, 240, 0.72);
    --text-muted: rgba(226, 232, 240, 0.6);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --border-color: #334155;
    --border-light: rgba(255, 255, 255, 0.08);
    --bg-secondary: rgba(255, 255, 255, 0.03);
    --bg-tertiary: rgba(255, 255, 255, 0.06);
    --surface-elevated: rgba(255, 255, 255, 0.04);

    /* Gradients */
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-2: linear-gradient(135deg, #ec4899 0%, #f97316 100%);
    --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #6366f1 60%, #7c3aed 100%);
    --gradient-secondary: linear-gradient(135deg, #f97316 0%, #fb7185 50%, #ec4899 100%);
    --gradient-success: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    --gradient-hero-bg: radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --shadow-primary: 0 10px 30px rgba(99, 102, 241, 0.35);
    --shadow-secondary: 0 10px 30px rgba(236, 72, 153, 0.35);
    --shadow-success: 0 10px 30px rgba(16, 185, 129, 0.35);

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
    --space-16: 64px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 22px;
    --radius-2xl: 28px;
    --radius-full: 999px;

    /* Typography */
    --font-xs: 0.75rem;
    --font-sm: 0.875rem;
    --font-base: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;
    --font-3xl: 1.875rem;
    --font-4xl: 2.25rem;
    --font-5xl: 3rem;
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Transitions */
    --transition-all: all 0.25s ease;
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.4s ease;

    /* Z-index layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-tooltip: 1070;


    /* Navbar height helpers */
    --navbar-height: 72px;
    --navbar-height-mobile: 64px;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

html, html {
    overflow-x: hidden;
    width: 100%;
}

body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    font-size: 16px;
}

/* ===== Accessibility - Focus States ===== */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
}

.skip-to-main:focus {
    left: 1rem;
    top: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }
}

@media (min-width: 1280px) {
    .container {
        padding: 0 32px;
    }
}

/* ===== Navigation ===== */
.navbar {
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    padding: 0.75rem 0;
    padding-top: calc(0.75rem + env(safe-area-inset-top));
    position: fixed;
    /* Helps positioning the mobile dropdown */
    min-height: var(--navbar-height);
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    overflow: visible; /* للسماح للقائمة المنسدلة بالظهور خارج الهيدر */
}

.nav-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
    flex-wrap: nowrap; /* منع الالتفاف */
    max-width: 100%;
    overflow: visible;
}
.lang-switch select {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    margin-inline-start: 0.5rem;
    height: 42px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 0;
}

.brand-logo {
    height: 44px;
    max-height: 48px;
    width: auto;
    display: none;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.18));
}

/* في الشاشات الكبيرة */
@media (min-width: 769px) {
    .nav-brand {
        flex: 0 0 auto;
    }
    
    .brand-logo {
        height: 48px;
        max-height: 52px;
    }
}
.brand-ar { display: block; }
.brand-animated {
    background: linear-gradient(120deg, #8b5cf6, #4f46e5, #ec4899, #4f46e5);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 5s linear infinite, glow 2.8s ease-in-out infinite;
    display: inline-block;
}

.nav-links {
        /* Mobile sidebar menu */
        display: flex;
        position: fixed;
        top: 0;
        left: 0; /* Sidebar من اليسار في LTR */
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        flex-direction: column;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        padding: calc(env(safe-area-inset-top) + 80px) 1.5rem 2rem;
        border-right: 1px solid var(--border-color);
        gap: 0.85rem;
        z-index: 999; /* أقل من z-index الهيدر */

        /* Smooth slide from left (LTR) - انزلاق من اليسار للإنجليزي */
        transform: translateX(-100%);
        pointer-events: none;
        transition: transform 350ms cubic-bezier(0.4, 0, 0.2, 1);

        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
}

/* Sidebar من اليمين للعربي RTL */
[dir="rtl"] .nav-links {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border-color);
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
}

/* عندما تكون القائمة مفتوحة */
.nav-links.open {
    transform: translateX(0);
    pointer-events: auto;
}

/* Overlay خلف الـ sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 769px) {
    .sidebar-overlay {
        display: none !important;
    }
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* زر إغلاق الـ sidebar */
.sidebar-close {
    position: absolute;
    top: calc(env(safe-area-inset-top) + 20px);
    right: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1001;
}

@media (min-width: 769px) {
    .sidebar-close {
        display: none !important;
    }
}

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

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
    transform: rotate(90deg);
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 600;
    font-size: 0.98rem;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        margin-inline-start: auto;
        flex-shrink: 0; /* منع الزر من التقلص */
}

.menu-toggle:hover { background: rgba(255,255,255,0.05); }

/* إظهار القائمة في الشاشات الكبيرة */
@media (min-width: 769px) {
    .navbar {
        padding: 0.875rem 0;
    }
    
    .nav-inner {
        gap: 1.5rem;
    }
    
    .nav-links {
        display: flex !important;
        position: static;
        flex-direction: row;
        background: transparent;
        padding: 0;
        border: none;
        border-right: none !important;
        border-left: none !important;
        gap: 1.75rem;
        width: auto;
        max-width: none;
        height: auto;
        transform: none !important;
        opacity: 1;
        pointer-events: auto;
        max-height: none;
        overflow: visible;
        box-shadow: none !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        flex: 1 1 auto;
        justify-content: center;
    }
    
    /* إخفاء زر الإغلاق في الديسكتوب */
    .sidebar-close {
        display: none !important;
    }
    
    /* إخفاء الـ overlay في الديسكتوب */
    .sidebar-overlay {
        display: none !important;
    }
    
    /* إخفاء أزرار الموبايل في الديسكتوب */
    .mobile-nav-actions {
        display: none !important;
    }
    
    .nav-links a {
        font-size: 0.95rem;
        padding: 0.5rem 0;
        position: relative;
        transition: color 0.3s ease;
    }
    
    .nav-links a::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: var(--primary-color);
        transform: scaleX(0);
        transition: transform 0.3s ease;
    }
    
    .nav-links a:hover::after {
        transform: scaleX(1);
    }
    
    .menu-toggle {
        display: none;
    }
    
    .nav-actions {
        flex-wrap: nowrap;
        max-width: none;
        justify-content: flex-end;
        flex: 0 0 auto;
        gap: 0.75rem;
    }
    
    /* إظهار جميع الأزرار في الديسكتوب */
    .nav-actions #userButtons,
    .nav-actions #guestButtons {
        display: flex !important;
    }
    
    .nav-actions #guestButtons .nav-cta span {
        display: inline !important; /* إظهار النص في الديسكتوب */
    }
    
    .navbar .btn.nav-cta {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
        min-height: 42px;
    }
    
    .navbar .btn.nav-cta span {
        display: inline;
    }
    
    #userButtons, #guestButtons {
        gap: 0.75rem;
        flex-wrap: nowrap;
    }
    
    .user-credits {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .auth-buttons {
        gap: 0.75rem;
        flex-direction: row;
    }
    
    .lang-switch select {
        padding: 0.6rem 0.9rem;
        height: 42px;
        font-size: 0.95rem;
    }
}

.nav-actions {
        gap: 0.5rem;
        min-width: 0;
        flex: 1 1 auto;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end; /* تحريك الأزرار لليسار في RTL */
        align-items: center;
        max-width: calc(100% - 60px); /* ترك مساحة لزر القائمة */
}

.nav-cta {
    padding: 9px 14px;
    font-size: 0.95rem;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}
/* ===== Hero Section ===== */
.hero {
    padding: 120px 0 90px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 10%, rgba(139, 92, 246, 0.1) 0%, transparent 40%);
    z-index: -1;
    animation: heroGradientShift 15s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.4) 100%);
    z-index: -1;
    pointer-events: none;
}

@keyframes heroGradientShift {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    animation: fadeInUp 1s ease-out;
}

.hero-title {
    font-size: clamp(2.1rem, 3vw + 1rem, 3.1rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(0.98rem, 1.8vw + 0.5rem, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 2rem;
}
.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.4);
}
.hero-bullets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.bullet {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.bullet i {
    color: var(--primary-color);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.hero-hint {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.trust-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.metric {
    padding: 1rem;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
}
.metric strong {
    display: block;
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}
.metric span {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* (Removed duplicate .btn styles to avoid overriding components.css) */
.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.hero-image {
    position: relative;
    height: 500px;
}

.floating-card {
    position: absolute;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
    animation: float 3s ease-in-out infinite;
}

.floating-card i {
    font-size: 2rem;
    color: var(--primary-color);
}

.card-1 {
    top: 10%;
    right: 10%;
    animation-delay: 0s;
}

.card-2 {
    top: 40%;
    left: 10%;
    animation-delay: 0.5s;
}

.card-3 {
    bottom: 30%;
    right: 20%;
    animation-delay: 1s;
}

.card-4 {
    bottom: 10%;
    left: 20%;
    animation-delay: 1.5s;
}

/* ===== Features Section ===== */
.features {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--dark-bg) 0%, #1a1f35 100%);
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 2vw + 1.2rem, 3rem);
    margin-bottom: 3rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    max-width: 760px;
    margin: -1.2rem auto 2rem;
    line-height: 1.8;
}

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-icon i {
    font-size: 2.5rem;
    color: white;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ===== Tools Section ===== */
.tools {
    padding: 100px 0;
    background: var(--dark-bg);
}

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

.tool-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tool-visual {
    width: 100%;
    /* Responsive preview size (prevents the video from becoming "hero-sized") */
    height: clamp(110px, 16vw, 160px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #0b0f1a;
    margin-bottom: 0.5rem;
    position: relative;
}

.tool-visual img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    transition: transform 0.3s ease;
}



.tool-visual video {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: cover; /* fill the preview box without distortion */
    display: block;
    transform: scale(1.01);
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-visual video {
    transform: scale(1.05);
}
.tool-card:hover .tool-visual img {
    transform: scale(1.05);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

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

.tool-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient-1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.tool-icon i {
    font-size: 2rem;
    color: white;
}

.tool-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.tool-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.tool-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--success-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===== About Section ===== */
.about {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--dark-bg) 0%, #1a1f35 100%);
}

.about-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-list {
    list-style: none;
}

.about-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.about-list i {
    color: var(--success-color);
    font-size: 1.2rem;
}

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

.stat-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.stat-card h4 {
    font-size: 3rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--text-secondary);
}

/* ===== Footer ===== */
.footer {
    background: var(--card-bg);
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h4 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.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;
}

.social-links a {
    width: 45px;
    height: 45px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.social-links a:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

/* ===== Social Proof ===== */
.social-proof {
    padding: 50px 0 30px;
    background: var(--dark-bg);
}
.social-proof-title {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    font-weight: 600;
}
.social-proof-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    color: var(--text-primary);
}
.social-proof-logos span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card-bg);
    margin: 3% auto;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 1000px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

.close {
    color: var(--text-secondary);
    float: left;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--error-color);
}

/* Tool Modal Styles */
.tool-interface {
    margin-top: 2rem;
}

.tool-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tool-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-header p {
    color: var(--text-secondary);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 1rem;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-group textarea {
    min-height: 150px;
    resize: vertical;
}

.file-upload {
    border: 2px dashed var(--border-color);
    padding: 2rem;
    text-align: center;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.file-upload i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.result-box {
    background: var(--dark-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-top: 2rem;
    min-height: 200px;
}

.result-box h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

/* ===== Experience Steps ===== */
.experience {
    padding: 90px 0;
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
}
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
    margin-top: 2rem;
}
.step-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}
.step-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(236, 72, 153, 0.08));
    opacity: 0;
    transition: opacity 0.3s;
}
.step-card:hover::after { opacity: 1; }
.step-number {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--gradient-1);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 1rem;
}
.step-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}
.step-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== Pricing ===== */
.pricing {
    padding: 90px 0;
    background: var(--dark-bg);
}
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.pricing-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.pricing-card.highlight {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-xl);
}
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.85rem;
}
.badge.muted {
    background: rgba(203, 213, 225, 0.12);
    color: var(--text-secondary);
}
.price {
    font-size: 2.4rem;
    font-weight: 800;
    margin: 0.2rem 0;
    color: var(--text-primary);
}
.benefits {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    color: var(--text-secondary);
    padding: 0;
    margin: 0;
}
.benefits i {
    color: var(--success-color);
    margin-inline-start: 0.3rem;
}

/* ===== CTA Banner ===== */
.cta-banner {
    padding: 70px 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(236, 72, 153, 0.12));
}
.cta-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.cta-content h3 {
    font-size: 1.9rem;
    margin-bottom: 0.5rem;
}
.cta-content p {
    color: var(--text-secondary);
}
.cta-actions {
    display: flex;
    gap: 0.8rem;
}

/* ===== Branded Prompt ===== */
.ui-prompt {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    z-index: 3000;
    padding: 1rem;
    backdrop-filter: blur(6px);
}
.ui-prompt__dialog {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    width: min(420px, 90vw);
    box-shadow: var(--shadow-xl);
    text-align: center;
}
.ui-prompt__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-color);
    display: grid;
    place-items: center;
    font-size: 1.4rem;
}
.ui-prompt__message {
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.6;
    font-weight: 600;
}
.ui-prompt__actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}
.ui-prompt__actions .btn {
    flex: 1;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes glow {
    0% { text-shadow: 0 0 6px rgba(99,102,241,0.4), 0 0 14px rgba(236,72,153,0.3); }
    100% { text-shadow: 0 0 10px rgba(99,102,241,0.7), 0 0 20px rgba(236,72,153,0.6); }
}


/* ===== Mobile Navbar Fixes (prevent overflow + improve layout) ===== */
.navbar, .navbar * { min-width: 0; }
.nav-actions, .auth-buttons, #userButtons, #guestButtons { min-width: 0; }
.user-credits { max-width: 100%; }

/* Avoid accidental horizontal scroll from wide media/cards */
img, video, svg, canvas { max-width: 100%; height: auto; }

/* Make header items readable and not oversized */
.navbar .btn.nav-cta { line-height: 1.15; }

@media (max-width: 420px) {
    .navbar .btn.nav-cta { padding: 0.5rem 0.75rem; font-size: 0.9rem; }
    .user-credits { font-size: 0.85rem; }
    .nav-actions { gap: 0.4rem; }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    /* Tool preview sizing */
    .tool-visual { height: clamp(105px, 30vw, 140px); }

    .nav-inner {
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
    }
    .nav-links {
        display: none;
        position: fixed;
        inset: 70px 0 auto 0;
        width: 100%;
        max-width: 100vw;
        flex-direction: column;
        background: rgba(15, 23, 42, 0.98);
        padding: 1.2rem 1.5rem 2rem;
        border-bottom: 1px solid var(--border-color);
        gap: 1rem;
        z-index: 999;
    }
    .nav-links.open { display: flex; opacity: 1; transform: translateY(0); pointer-events: auto; }
    .navbar .container {
        align-items: center;
        gap: 0.5rem;
    }
    .nav-brand {
        font-size: 1.2rem;
        line-height: 1.2;
    }
    .nav-actions {
        gap: 0.4rem;
        min-width: auto;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .auth-buttons {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    .lang-switch select {
        margin-inline-start: 0.5rem;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: clamp(2.1rem, 5vw + 1rem, 2.8rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 4vw + 0.5rem, 1.2rem);
    }
    
    .hero-image {
        display: none;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    .hero-bullets {
        justify-content: center;
    }
    .trust-metrics {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    .features-grid,
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 2rem;
    }
    .section-subtitle {
        margin: 0 auto 2rem;
    }
    
    .modal-content {
        width: 95%;
        padding: 1rem;
        margin: 10% auto;
    }
    .cta-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .btn {
        padding: 0.85rem 1.4rem;
        font-size: 1rem;
    }


    /* Mobile navbar button sizing (prevents overflow) */
    .navbar .btn.nav-cta {
        padding: 0.45rem 0.75rem;
        font-size: 0.85rem;
        min-height: 38px;
        line-height: 1.1;
        border-radius: var(--radius-full);
        max-width: 100%;
        white-space: nowrap;
    }
    
    .navbar .btn.nav-cta i {
        font-size: 0.8rem;
    }
    
    #userButtons, #guestButtons {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        flex-wrap: nowrap; /* منع الالتفاف للحفاظ على الأزرار في صف واحد */
        width: auto;
        max-width: 100%;
    }
    
    .user-credits {
        padding: 0.45rem 0.75rem;
        font-size: 0.8rem;
        max-width: 100%;
        white-space: nowrap;
        border-radius: var(--radius-full);
    }
    
    .user-credits i {
        font-size: 0.75rem;
    }
    
    /* تقليل حجم النصوص في الأزرار للموبايل */
    .navbar .btn.nav-cta span {
        display: none; /* إخفاء النص والإبقاء على الأيقونات فقط في الموبايل */
    }
    
    /* عرض النص فقط في الشاشات الأكبر */
    @media (min-width: 480px) {
        .navbar .btn.nav-cta span {
            display: inline;
        }
        
        .navbar .btn.nav-cta {
            padding: 0.55rem 0.85rem;
            font-size: 0.95rem;
        }
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ===== Auth Buttons في Navbar ===== */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0 15px;
}

.user-credits {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* أزرار القائمة المنسدلة في الموبايل */
.mobile-nav-actions {
    display: none;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    /* إخفاء أزرار الـ nav-actions الأصلية في الموبايل EXCEPT زر الدخول */
    .nav-actions #userButtons {
        display: none !important;
    }
    
    /* إظهار زر الدخول في الهيدر للموبايل */
    .nav-actions #guestButtons {
        display: flex !important;
    }
    
    /* تصغير زر الدخول في الموبايل */
    .nav-actions #guestButtons .nav-cta {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .nav-actions #guestButtons .nav-cta span {
        display: none; /* إخفاء النص وإبقاء الأيقونة فقط */
    }
    
    /* إظهار الأزرار داخل القائمة المنسدلة */
    .mobile-nav-actions {
        display: flex;
    }
    
    .mobile-nav-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }
    
    .mobile-credits {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        margin-bottom: 0.5rem;
    }
    
    #guestButtonsMobile,
    #userButtonsMobile {
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
        width: 100%;
    }
}

/* (Removed duplicate .btn-outline styles; use components.css) */
@media (max-width: 768px) {
    .auth-buttons {
        flex-direction: column;
        width: 100%;
        margin: 10px 0;
    }
}

/* ===== Static Content Pages ===== */
.page-hero {
    position: relative;
    padding: 140px 0 80px;
    background: radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.14), transparent 45%),
                radial-gradient(circle at 80% 10%, rgba(236, 72, 153, 0.14), transparent 40%),
                rgba(15, 23, 42, 0.7);
    overflow: hidden;
}

.page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.6) 100%);
    pointer-events: none;
}

.page-hero__content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.page-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 14px;
    backdrop-filter: blur(8px);
}

.page-hero__title {
    font-size: clamp(2.2rem, 3vw + 1rem, 3.2rem);
    font-weight: 800;
    margin-bottom: 16px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-hero__subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 26px;
}

.page-hero__meta {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.page-hero__meta .badge {
    background: rgba(99, 102, 241, 0.16);
    border: 1px solid rgba(99, 102, 241, 0.4);
}

.page-section {
    padding: 60px 0;
}

.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.page-grid--wide {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.page-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 22px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.page-card h3 {
    font-size: 1.2rem;
    font-weight: 800;
}

.page-card p {
    color: var(--text-secondary);
}

.page-card__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--text-secondary);
    padding: 0;
    margin: 0;
}

.page-card__list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.page-card__list i {
    color: var(--success-color);
    margin-top: 4px;
}

.page-card--bordered {
    border: 1px solid rgba(99, 102, 241, 0.4);
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.meta-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.meta-pill strong {
    color: var(--text-primary);
}

.policy-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 18px;
}

.policy-block h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.policy-block p {
    margin: 0;
    color: var(--text-secondary);
}

.policy-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.policy-list li {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .page-hero {
        padding: 120px 0 60px;
    }

    .page-breadcrumb {
        width: 100%;
        justify-content: center;
    }

    .page-grid {
        grid-template-columns: 1fr;
    }
}



@media (max-width: 480px) {
    .tool-visual { height: 110px; }
}
/* ===============================
   MOBILE HEADER FIX (Safari-safe)
   =============================== */

header,
.navbar {
  max-width: 100%;
}

.navbar-inner,
.navbar-content,
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow: visible;
}

/* أزرار الهيدر */
.navbar .btn,
.navbar .nav-cta {
  white-space: nowrap;
  max-width: 100%;
  flex-shrink: 0;
}

/* تحسينات إضافية للموبايل */
@media (max-width: 768px) {
  .navbar .nav-cta {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .nav-brand {
    flex-shrink: 0;
    max-width: 40%;
  }
  
  .brand-logo {
    max-height: 40px;
  }
}
/* ===============================
   STOP HORIZONTAL SCROLL
   =============================== */

html,
body {
  max-width: 100%;
  overflow-x: hidden !important;
  position: relative;
}

/* أي عنصر absolute ما يطلعش برا */
* {
  box-sizing: border-box;
}

/* منع الفيديوهات/الصور تكسر العرض */
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}
/* Safari backdrop-filter fix */
@supports (-webkit-backdrop-filter: blur(1px)) {
  .navbar,
  header {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}

/* ===============================
   إصلاحات إضافية للهيدر في الموبايل
   =============================== */

/* التأكد من أن القائمة المنسدلة لا تظهر عند التحميل */
.nav-links:not(.open) {
    display: none !important;
}

/* في الشاشات الكبيرة، إظهار القائمة دائماً */
@media (min-width: 769px) {
    .nav-links:not(.open) {
        display: flex !important;
    }
}

/* تحسين تجربة اللمس في iOS */
.navbar .btn.nav-cta {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.menu-toggle {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* منع تمدد الأزرار بشكل غير طبيعي */
@media (max-width: 768px) {
    .auth-buttons {
        flex-direction: row;
        width: auto;
        margin: 0;
        gap: 0.35rem;
        flex-wrap: nowrap;
    }
    
    .lang-switch {
        display: flex;
        align-items: center;
    }
    
    .lang-switch select {
        padding: 0.45rem 0.65rem;
        height: 38px;
        font-size: 0.85rem;
        margin-inline-start: 0;
    }
}

/* تحسين الظهور على أجهزة iPhone مع notch */
@supports (padding: max(0px)) {
    .navbar {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    
    .nav-links.open {
        padding-left: max(1.25rem, env(safe-area-inset-left));
        padding-right: max(1.25rem, env(safe-area-inset-right));
    }
}

/* ===============================
   تحسينات إضافية للديسكتوب
   =============================== */

@media (min-width: 769px) {
    /* تحسين توزيع العناصر في الديسكتوب */
    .nav-inner {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 2rem;
    }
    
    /* اللوجو في اليسار (RTL) */
    .nav-brand {
        grid-column: 1;
        justify-self: start;
    }
    
    /* القائمة في الوسط */
    .nav-links {
        grid-column: 2;
        justify-self: center;
    }
    
    /* الأزرار في اليمين (RTL) */
    .nav-actions {
        grid-column: 3;
        justify-self: end;
    }
    
    /* تحسين المسافات */
    .container {
        padding: 0 2rem;
    }
}

/* للشاشات الكبيرة جداً */
@media (min-width: 1280px) {
    .nav-links {
        gap: 2rem;
    }
    
    .nav-links a {
        font-size: 1rem;
    }
    
    .container {
        padding: 0 3rem;
    }
}

/* ===============================
   تحسينات إضافية للموبايل
   =============================== */

@media (max-width: 768px) {
    /* تحسين ترتيب العناصر في الموبايل */
    .nav-inner {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-areas: 
            "brand actions menu";
        align-items: center;
        gap: 0.5rem;
    }
    
    .nav-brand {
        grid-area: brand;
    }
    
    .nav-actions {
        grid-area: actions;
        justify-self: end;
    }
    
    .menu-toggle {
        grid-area: menu;
        margin-inline-start: 0;
    }
    
    /* تحسين عرض الأزرار */
    .auth-buttons {
        display: flex;
        flex-direction: row;
        gap: 0.35rem;
        align-items: center;
    }
    
    /* تحسين عرض اللغة */
    .lang-switch {
        order: -1; /* تظهر قبل الأزرار */
    }
    
    /* تحسين عرض الرصيد */
    .user-credits {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.4rem 0.65rem;
        font-size: 0.75rem;
    }
    
    .user-credits i {
        font-size: 0.7rem;
    }
    
    /* إخفاء "رصيد:" والإبقاء على الرقم فقط */
    .user-credits span:first-of-type {
        display: none;
    }
}

/* للموبايل الصغير جداً */
@media (max-width: 360px) {
    .nav-inner {
        gap: 0.35rem;
    }
    
    .navbar .btn.nav-cta {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
        min-height: 36px;
    }
    
    .user-credits {
        padding: 0.35rem 0.55rem;
        font-size: 0.7rem;
    }
    
    .lang-switch select {
        padding: 0.35rem 0.55rem;
        height: 36px;
        font-size: 0.8rem;
    }
}