/* assets/css/style.css */
/* النظام التصميمي الفاخر لمنصة BioFlow - تصميم زجاجي عصري (Glassmorphism Theme) */

:root {
    --bg-dark: #0b0714;
    --bg-darker: #06040a;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.18);
    --secondary: #a855f7;
    --secondary-hover: #9333ea;
    --secondary-glow: rgba(168, 85, 247, 0.18);
    --gold: #f59e0b;
    --gold-glow: rgba(245, 158, 11, 0.2);
    --danger: #ef4444;
    --success: #10b981;
    
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-hover: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-focus: rgba(99, 102, 241, 0.4);
    
    --text-white: #ffffff;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --font-cairo: 'Cairo', sans-serif;
    --font-outfit: 'Outfit', sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 16px;
    --border-radius-lg: 24px;
}

/* 1. التنسيق الأساسي للموقع */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-cairo), var(--font-outfit), sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.1) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(6, 4, 10, 1) 0px, transparent 100%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* شريط التمرير (Scrollbar) */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* 2. الهيكل الرئيسي والتخطيط (Layout) */
.navbar {
    background: rgba(11, 7, 20, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text-white);
}

.nav-links a.active {
    color: var(--primary);
}

/* 3. البطاقات الزجاجية (Glassmorphism Cards) */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    transition: var(--transition);
}

.glass-card:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

/* 4. نماذج الإدخال (Inputs) */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-white);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(255, 255, 255, 0.05);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

select.form-input {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    background-size: 16px;
}

select.form-input option {
    background-color: #0f0b1e;
    color: #ffffff;
}

/* 5. الأزرار (Buttons) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-white);
}

.btn-secondary:hover {
    background: var(--glass-bg-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.btn-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    box-shadow: 0 4px 15px var(--gold-glow);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

/* 6. لوحة التحكم المقسمة (Dashboard Grid) */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
    padding: 32px 24px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
}

@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    padding-left: 8px;
}

.control-panel::-webkit-scrollbar {
    width: 6px;
}
.control-panel::-webkit-scrollbar-track {
    background: transparent;
}
.control-panel::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}
.control-panel::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.tab-nav {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 700;
    padding: 8px 16px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab-btn.active {
    color: var(--text-white);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -13px;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
}

/* 7. محاكي الهاتف التفاعلي (Phone Simulator) */
.simulator-container {
    position: sticky;
    top: 100px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.smartphone {
    position: relative;
    width: 330px;
    height: 640px;
    border-radius: 40px;
    border: 12px solid #1a1a2e;
    box-shadow: 
        0 25px 50px -12px rgba(0,0,0,0.5),
        0 0 0 1px rgba(255,255,255,0.05),
        inset 0 0 20px rgba(0,0,0,0.8);
    background: #121212;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* الكاميرا الأمامية (Notch) */
.smartphone::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 22px;
    background: #1a1a2e;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    z-index: 10;
}

/* محتوى الهاتف الداخلي */
.phone-screen {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    padding: 36px 18px 24px;
    /* شريط التمرير الداخلي خفي */
    scrollbar-width: none;
}
.phone-screen::-webkit-scrollbar {
    display: none;
}

/* 8. قائمة الروابط في لوحة التحكم (Drag & Drop Links) */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.link-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: grab;
    transition: var(--transition);
    position: relative;
}

.link-item:active {
    cursor: grabbing;
}

.link-item.dragging {
    opacity: 0.5;
    background: var(--glass-bg-hover);
    border-color: var(--primary);
}

.drag-handle {
    color: var(--text-muted);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.link-details {
    flex: 1;
}

.link-actions {
    display: flex;
    gap: 8px;
}

/* 9. الإعلانات (Advertisements) */
.ad-banner {
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* نافذة إعلان منبثق (Popup Modal Ads) */
.ad-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.ad-popup-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.ad-popup {
    background: #0f0b1e;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ad-popup-overlay.show .ad-popup {
    transform: scale(1);
}

.ad-close-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: var(--transition);
}

.ad-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}

.ad-close-timer {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 16px;
}

/* 10. صفحة الهبوط الفاخرة (Landing Page Sections) */
.hero-section {
    text-align: center;
    padding: 80px 24px;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 54px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #fff 30%, #a855f7 70%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 38px;
    }
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 36px;
}

/* باقات الأسعار في صفحة الهبوط */
.pricing-section {
    padding: 60px 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.pricing-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 40px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

@media (max-width: 800px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

.price-card {
    position: relative;
    overflow: hidden;
}

.price-card.featured {
    border-color: var(--primary);
    box-shadow: 0 8px 32px 0 rgba(99, 102, 241, 0.15);
}

.price-card.featured::before {
    content: 'الأكثر شعبية';
    position: absolute;
    top: 20px;
    left: -35px;
    transform: rotate(-45deg);
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    padding: 4px 35px;
    text-align: center;
}

.price-amount {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-white);
    margin: 20px 0;
}

.features-list {
    list-style: none;
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-main);
}

.features-list li.disabled {
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.6;
}

/* 11. الإشعارات والمنبثقات العامة */
.toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: rgba(15, 11, 30, 0.9);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 14px 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success { border-right: 4px solid var(--success); }
.toast-error { border-right: 4px solid var(--danger); }
.toast-info { border-right: 4px solid var(--primary); }

/* محاكي الخلفية المتحركة */
.video-bg, .iframe-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    pointer-events: none;
    border: none;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.video-bg.loaded, .iframe-bg.loaded {
    opacity: 1;
}

.iframe-bg {
    transform: scale(1.3);
    transform-origin: center;
}

/* تخصيص زر السحب في المحاكي */
.phone-link-btn {
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 12px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    display: block;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
    border: 1px solid rgba(255,255,255,0.1);
}

.phone-link-btn:hover {
    transform: scale(1.03);
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 2px solid rgba(255,255,255,0.2);
}

.sim-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    transition: filter 0.3s ease, transform 0.3s ease;
}


/* ==========================================================================
   Light Mode Theme Overrides (الوضع المضيء)
   ========================================================================== */
html[data-theme="light"] {
    --bg-dark: #f8fafc;
    --bg-darker: #f1f5f9;
    --text-white: #0f172a;
    --text-main: #334155;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-bg-hover: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-border-focus: rgba(99, 102, 241, 0.5);
    --primary-glow: rgba(99, 102, 241, 0.08);
    --secondary-glow: rgba(168, 85, 247, 0.08);
}

html[data-theme="light"] body {
    background-color: #f8fafc;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.06) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.05) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(248, 250, 252, 1) 0px, transparent 100%);
}

html[data-theme="light"] .glass-card {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .glass-card:hover {
    border-color: rgba(99, 102, 241, 0.2);
}

html[data-theme="light"] .form-input {
    background-color: rgba(15, 23, 42, 0.02);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .form-input:focus {
    background-color: #ffffff;
    color: #0f172a;
}

html[data-theme="light"] .form-input option {
    background-color: #ffffff;
    color: #0f172a;
}

html[data-theme="light"] select.form-input {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

html[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.7);
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .smartphone {
    background: #cbd5e1;
    border-color: #94a3b8;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .smartphone::before {
    background: #94a3b8;
}

html[data-theme="light"] .phone-screen {
    background: #f8fafc;
}

html[data-theme="light"] .tab-btn {
    color: #64748b;
}

html[data-theme="light"] .tab-btn.active {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.06);
}

html[data-theme="light"] .toast {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}


/* Additional contrast fixes for Light Mode */
html[data-theme="light"] .hero-title {
    background: linear-gradient(135deg, #0f172a 30%, #a855f7 70%, #6366f1 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

html[data-theme="light"] .lang-toggle-btn {
    background: rgba(15, 23, 42, 0.04) !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
    color: #0f172a !important;
}

html[data-theme="light"] .lang-toggle-btn:hover {
    background: rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .currency-switcher {
    background: rgba(15, 23, 42, 0.04) !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .currency-toggle-btn {
    color: #64748b !important;
}

html[data-theme="light"] .currency-toggle-btn.active {
    color: #ffffff !important;
}

html[data-theme="light"] .btn-secondary {
    background: rgba(15, 23, 42, 0.04) !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
    color: #0f172a !important;
}

html[data-theme="light"] .btn-secondary:hover {
    background: rgba(15, 23, 42, 0.08) !important;
}

/* Custom Saudi Riyal Symbol Image Styling */
.riyal-symbol-img {
    height: 0.9em;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    margin: 0 2px;
}
html[data-theme="dark"] .riyal-symbol-img {
    filter: invert(1) brightness(1.5);
}
html[data-theme="dark"] .pricing-card-currency .riyal-symbol-img,
html[data-theme="dark"] .price-amount .riyal-symbol-img {
    filter: invert(1) brightness(100); /* ensure it's pure white for price displays */
}

/* ==========================================
   12. الهيدر المتجاوب وقائمة الجوال (Responsive Navbar & Hamburger Menu)
   ========================================== */

/* أزرار الهيدر اليمنى (تضم زر تسجيل الدخول وزر الهمبرغر بالجوال) */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1001;
}

/* زر الهمبرغر للجوال */
.menu-toggle-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: var(--transition);
    z-index: 1001;
    align-items: center;
    justify-content: center;
}

.menu-toggle-btn:hover {
    transform: scale(1.05);
    color: var(--primary);
}

html[data-theme="light"] .menu-toggle-btn {
    color: #0f172a;
}

html[data-theme="light"] .menu-toggle-btn:hover {
    color: var(--primary);
}

/* حاوية الترويسة الافتراضية على الكمبيوتر */
.nav-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* تنسيق قائمة اختيار اللغات المنسدلة */
.lang-select-wrapper {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 8px 14px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.lang-select-wrapper::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    transition: var(--transition);
}

html[dir="rtl"] .lang-select-wrapper::after {
    left: 14px;
    right: auto;
}

html[dir="ltr"] .lang-select-wrapper::after {
    right: 14px;
    left: auto;
}

.lang-select-wrapper:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

.lang-select {
    background: none;
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    font-family: inherit;
    padding: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
}

html[dir="rtl"] .lang-select {
    padding-left: 20px;
    padding-right: 0;
}

html[dir="ltr"] .lang-select {
    padding-right: 20px;
    padding-left: 0;
}

.lang-select option {
    background-color: #0b0714;
    color: #ffffff;
}

html[data-theme="light"] .lang-select-wrapper {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

html[data-theme="light"] .lang-select-wrapper::after {
    color: rgba(15, 23, 42, 0.5);
}

html[data-theme="light"] .lang-select-wrapper:hover {
    background: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .lang-select {
    color: #0f172a;
}

html[data-theme="light"] .lang-select option {
    background-color: #ffffff;
    color: #0f172a;
}

/* غطاء الخلفية المعتم للقائمة الجانبية بالجوال */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 4, 10, 0.5) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* زر إغلاق القائمة الجانبية (X) */
.drawer-close-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-white);
    font-size: 24px;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 12px;
    transition: var(--transition);
}

.drawer-close-btn:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

html[data-theme="light"] .drawer-close-btn {
    color: #0f172a;
}

html[data-theme="light"] .drawer-close-btn:hover {
    color: var(--primary);
}

/* التجاوب على مقاسات الشاشات الكبيرة (الكمبيوتر) */
@media (min-width: 1025px) {
    .navbar {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    .navbar .logo {
        order: 1 !important;
    }
    
    .navbar .nav-container {
        order: 2 !important;
        flex-grow: 1 !important;
        display: flex !important;
        align-items: center !important;
        margin: 0 40px !important;
    }
    
    .navbar .nav-links {
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    .navbar .header-right {
        order: 3 !important;
        display: flex !important;
        align-items: center !important;
    }
}

/* التجاوب على مقاسات الشاشات المتوسطة والصغيرة */
@media (max-width: 1024px) {
    .navbar.menu-open,
    .navbar:has(.nav-container.active) {
        position: relative !important;
        z-index: auto !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(11, 7, 20, 0.95) !important;
    }

    html[data-theme="light"] .navbar.menu-open,
    html[data-theme="light"] .navbar:has(.nav-container.active) {
        background: rgba(255, 255, 255, 0.95) !important;
    }

    .navbar.menu-open .header-right,
    .navbar:has(.nav-container.active) .header-right {
        z-index: 1000 !important;
    }

    .navbar.menu-open .menu-toggle-btn,
    .navbar:has(.nav-container.active) .menu-toggle-btn {
        z-index: 1000 !important;
    }

    .menu-toggle-btn {
        display: inline-flex;
    }

    .drawer-close-btn {
        display: block;
        align-self: flex-end; /* Align close button to the left corner in RTL */
        color: #ffffff !important; /* Force white color in dark mode */
    }

    /* تحويل الترويسة إلى قائمة جانبية تنزلق من اليمين */
    .nav-container {
        position: fixed;
        top: 0;
        right: -320px; /* مخفي خارج الشاشة يميناً */
        bottom: 0;
        width: 300px;
        height: 100vh;
        background: rgba(11, 7, 20, 0.8) !important; /* Glass transparent background */
        backdrop-filter: blur(25px) !important;
        -webkit-backdrop-filter: blur(25px) !important;
        border: none;
        border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-top-left-radius: 24px;
        border-bottom-left-radius: 24px;
        padding: 32px 24px;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 24px;
        z-index: 1002;
        box-shadow: -15px 0 40px rgba(0, 0, 0, 0.6) !important; /* Premium shadow */
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex; /* لضمان تخطيط الفليكس */
        color: #ffffff !important;
    }

    /* عندما تنشط القائمة تسحب لليمين */
    .nav-container.active {
        right: 0 !important;
    }

    /* التنسيق للوضع المضيء */
    html[data-theme="light"] .nav-container {
        background: rgba(255, 255, 255, 0.8) !important; /* Glass transparent background for light mode */
        backdrop-filter: blur(25px) !important;
        -webkit-backdrop-filter: blur(25px) !important;
        border-color: rgba(15, 23, 42, 0.08) !important;
        box-shadow: -15px 0 40px rgba(15, 23, 42, 0.1) !important;
        color: #0f172a !important;
    }

    /* تنسيق قائمة الروابط في صفحة الهبوط بالجوال */
    .nav-container .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .nav-container .nav-links li {
        width: 100%;
    }

    .nav-container .nav-links li a,
    .nav-container .nav-links li button {
        display: block;
        width: 100%;
        text-align: center;
        padding: 14px !important;
        font-size: 15px !important;
        color: #e2e8f0 !important; /* Force readable light grey text in dark mode */
        background: rgba(255, 255, 255, 0.03) !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        border-radius: 12px !important;
        transition: all 0.3s ease;
    }

    .nav-container .nav-links li a:hover,
    .nav-container .nav-links li button:hover {
        background: rgba(255, 255, 255, 0.08) !important;
        border-color: rgba(99, 102, 241, 0.3) !important;
        color: #ffffff !important;
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.1);
    }

    /* تخصيص زر المعاينة المميز داخل الجوال */
    .nav-container .nav-links li a.btn-secondary {
        background: rgba(255, 255, 255, 0.08) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-radius: 12px !important;
        color: #ffffff !important;
    }

    html[data-theme="light"] .nav-container .nav-links li a.btn-secondary {
        background: rgba(15, 23, 42, 0.05) !important;
        border: 1px solid rgba(15, 23, 42, 0.1) !important;
        color: #0f172a !important;
    }

    /* تباين المضيء للروابط وزر الإغلاق */
    html[data-theme="light"] .nav-container .nav-links li a {
        color: #334155 !important;
        background: rgba(15, 23, 42, 0.03) !important;
        border: 1px solid rgba(15, 23, 42, 0.05) !important;
    }
    html[data-theme="light"] .nav-container .nav-links li a:hover {
        color: #0f172a !important;
        background: rgba(15, 23, 42, 0.06) !important;
        border-color: rgba(99, 102, 241, 0.2) !important;
    }
    html[data-theme="light"] .nav-container .drawer-close-btn {
        color: #0f172a !important;
    }

    /* تنسيق أزرار التحكم (اللغة، الوضع، العملة) */
    .nav-container .header-controls {
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .nav-container .header-controls .lang-select-wrapper,
    .nav-container .header-controls .lang-toggle-btn,
    .nav-container .header-controls .currency-switcher {
        width: 100%;
        justify-content: center;
    }

    .nav-container .header-controls .lang-select-wrapper {
        color: #ffffff !important;
    }
    html[data-theme="light"] .nav-container .header-controls .lang-select-wrapper {
        color: #0f172a !important;
    }

    .nav-container .header-controls .lang-select {
        flex-grow: 1;
        text-align: center;
        color: #ffffff !important;
    }
    html[data-theme="light"] .nav-container .header-controls .lang-select {
        color: #0f172a !important;
    }

    /* تنسيق أزرار العملة بالجوال */
    .nav-container .currency-switcher .currency-toggle-btn {
        color: #94a3b8 !important;
    }
    .nav-container .currency-switcher .currency-toggle-btn.active {
        color: #ffffff !important;
    }
    html[data-theme="light"] .nav-container .currency-switcher .currency-toggle-btn {
        color: #64748b !important;
    }
    html[data-theme="light"] .nav-container .currency-switcher .currency-toggle-btn.active {
        color: #ffffff !important;
    }

    /* تنسيق عناصر لوحة التحكم في الجوال */
    .nav-container #user-greeting {
        width: 100%;
        text-align: center;
        padding: 8px 0 16px;
        border-bottom: 1px solid var(--glass-border);
        font-size: 15px !important;
    }

    html[data-theme="light"] .nav-container #user-greeting {
        border-bottom-color: rgba(15, 23, 42, 0.08);
    }

    .nav-container .logout-btn {
        width: 100%;
        padding: 12px !important;
        text-align: center;
        font-size: 14px !important;
    }

    /* ضبط عرض محاكي الهواتف الذكية على شاشات الجوال الضيقة */
    .smartphone {
        max-width: 100%;
    }
}


