/* Explain: Global theme design tokens and dark mode overrides for consistent UI. */
:root {
    --primary-color: #1E3A8A;
    --primary-hover: #1E40AF;
    --secondary-color: #3B82F6;
    --secondary-hover: #2563EB;
    --accent-color: #F59E0B;
    --background-color: #F8FAFC;
    --surface-color: #FFFFFF;
    --ivory-color: #FFFBF0;
    --text-color: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 6px rgba(0, 0, 0, 0.05);
    --font-heading: 'Cairo', sans-serif;
    --font-body: 'Cairo', sans-serif;
    --font-kufi: 'Noto Kufi Arabic', sans-serif;
    --font-farsi: 'Aref Ruqaa', serif;
    --font-diwani: 'Amiri', serif;
    --brand-bar-bg: #082B55;
    --brand-bar-border-top: #00ACC1;
    --brand-bar-border-bottom: #F59E0B;
    --brand-bar-border-width: 13px;
}

/* Dark Mode Overrides */
html.dark-mode {
    --background-color: #0f172a !important;
    --surface-color: #1e293b !important;
    --ivory-color: #0f172a !important;
    --text-color: #e2e8f0 !important;
    --text-muted: #94a3b8 !important;
    --border-color: #334155 !important;
}

html.dark-mode body {
    background-color: var(--background-color) !important;
    color: var(--text-color) !important;
}

html.dark-mode .bg-white,
html.dark-mode .bg-slate-50,
html.dark-mode .bg-slate-100,
html.dark-mode .bg-\[\#F8FAFC\],
html.dark-mode .bg-\[\#EEF6F8\],
html.dark-mode .bg-\[\#E8F1F5\],
html.dark-mode .bg-\[\#F6EEFA\] {
    background-color: var(--surface-color) !important;
}

html.dark-mode .bg-white\/95,
html.dark-mode .bg-white\/90,
html.dark-mode .bg-slate-50\/50,
html.dark-mode .bg-blue-50\/80,
html.dark-mode .bg-blue-50\/50,
html.dark-mode .bg-blue-50,
html.dark-mode .bg-amber-50,
html.dark-mode .bg-green-50,
html.dark-mode .bg-red-50,
html.dark-mode .bg-cyan-50 {
    background-color: rgba(30, 41, 59, 0.8) !important;
}

/* الوضع الليلي — خلفيات البطاقات الفاتحة (بمختلف ألوانها) تصبح داكنة مع بقاء النص مقروءاً */
html.dark-mode .bg-emerald-100,
html.dark-mode .bg-amber-100,
html.dark-mode .bg-purple-100,
html.dark-mode .bg-blue-100,
html.dark-mode .bg-rose-100,
html.dark-mode .bg-cyan-100,
html.dark-mode .bg-pink-100,
html.dark-mode .bg-indigo-100,
html.dark-mode .bg-teal-100,
html.dark-mode .bg-orange-100,
html.dark-mode .bg-yellow-100,
html.dark-mode .bg-green-100,
html.dark-mode .bg-lime-100,
html.dark-mode .bg-sky-100,
html.dark-mode .bg-violet-100,
html.dark-mode .bg-fuchsia-100 {
    background-color: var(--surface-color) !important;
}

/* الوضع الليلي — تفتيح عناوين الأكاديمية الفيروزية والأزرق ليبقى النص واضحاً على الخلفية الداكنة */
html.dark-mode .text-\[\#0A8CA6\] {
    color: #22d3ee !important;
}
html.dark-mode .text-\[\#2643D5\] {
    color: #93c5fd !important;
}
html.dark-mode .text-\[\#0A6E86\] {
    color: #67e8f9 !important;
}

html.dark-mode .text-slate-800,
html.dark-mode .text-slate-700,
html.dark-mode .text-slate-600,
html.dark-mode .text-\[\#102450\],
html.dark-mode .text-\[\#082B55\],
html.dark-mode .text-\[\#4E342E\],
html.dark-mode .text-\[\#1E3A8A\] {
    color: var(--text-color) !important;
}

html.dark-mode .text-slate-500,
html.dark-mode .text-slate-400 {
    color: var(--text-muted) !important;
}

/* الوضع الليلي — النصوص السوداء والرمادية الداكنة (مثل قوائم مميزات العضويات) تصبح فاتحة واضحة */
html.dark-mode .text-black,
html.dark-mode .text-gray-900,
html.dark-mode .text-gray-800,
html.dark-mode .text-gray-700,
html.dark-mode .text-gray-600 {
    color: var(--text-color) !important;
}
html.dark-mode .text-gray-500 {
    color: var(--text-muted) !important;
}

html.dark-mode .border-slate-100,
html.dark-mode .border-slate-200,
html.dark-mode .border-white\/50,
html.dark-mode .border-blue-50,
html.dark-mode .border-blue-100,
html.dark-mode .border-amber-200 {
    border-color: var(--border-color) !important;
}

html.dark-mode .dropdown-content {
    background-color: var(--surface-color) !important;
    border-color: var(--border-color) !important;
}

html.dark-mode .modal-box {
    background-color: var(--surface-color) !important;
}

html.dark-mode .bg-gradient-to-b.from-white\/95,
html.dark-mode .bg-gradient-to-b.from-white {
    background: var(--surface-color) !important;
}

html.dark-mode .input,
html.dark-mode .select,
html.dark-mode .textarea {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}
html.dark-mode .input:focus,
html.dark-mode .select:focus,
html.dark-mode .textarea:focus {
    background-color: #1e293b !important;
}

/* الوضع الليلي — ضمان قراءة النصوص العريضة والملوّنة بوضوح على الخلفية الداكنة */
html.dark-mode strong,
html.dark-mode b {
    color: inherit !important;
}

/* الوضع الليلي — عناوين الكهرماني والأحمر الفاتحة: تفتيح لضمان التباين على الخلفية الداكنة */
html.dark-mode .text-amber-600 { color: #fbbf24 !important; }
html.dark-mode .text-amber-500 { color: #fcd34d !important; }
html.dark-mode .text-rose-600 { color: #fb7185 !important; }
html.dark-mode .text-red-600 { color: #f87171 !important; }
html.dark-mode .text-emerald-600 { color: #34d399 !important; }
html.dark-mode .text-green-600 { color: #4ade80 !important; }
html.dark-mode .text-blue-600 { color: #60a5fa !important; }
html.dark-mode .text-purple-600 { color: #c084fc !important; }
html.dark-mode .text-indigo-600 { color: #818cf8 !important; }
html.dark-mode .text-teal-600 { color: #2dd4bf !important; }
html.dark-mode .text-cyan-600 { color: #22d3ee !important; }

html.dark-mode .text-amber-700 { color: #fbbf24 !important; }
html.dark-mode .text-yellow-700 { color: #facc15 !important; }
html.dark-mode .text-cyan-700 { color: #22d3ee !important; }
html.dark-mode .text-blue-700 { color: #60a5fa !important; }
html.dark-mode .text-rose-700 { color: #fb7185 !important; }
html.dark-mode .text-emerald-700 { color: #34d399 !important; }
html.dark-mode .text-purple-700 { color: #c084fc !important; }
html.dark-mode .text-sky-700 { color: #38bdf8 !important; }
html.dark-mode .text-teal-700 { color: #2dd4bf !important; }
html.dark-mode .text-indigo-700 { color: #818cf8 !important; }
html.dark-mode .text-orange-700 { color: #fb923c !important; }

/* الوضع الليلي — خلفيات البطاقات البيضاء القديمة والنصوص الداكنة داخلها */
html.dark-mode .text-\[\#1E3A8A\],
html.dark-mode .text-\[\#102450\],
html.dark-mode .text-\[\#082B55\],
html.dark-mode .text-\[\#4E342E\] {
    color: var(--text-color) !important;
}

/* الوضع الليلي — قائمة الجوال وبطاقات القوائم المنسدلة: خلفية داكنة ونص فاتح واضح */
html.dark-mode .menu.dropdown-content,
html.dark-mode .dropdown-content.menu {
    background-image: none !important;
    background-color: var(--surface-color) !important;
    border-color: var(--border-color) !important;
    color: var(--text-color) !important;
}
html.dark-mode .menu.dropdown-content > li > a {
    color: var(--text-color) !important;
}
html.dark-mode .menu.dropdown-content > li > a:hover {
    background-color: rgba(148, 163, 184, 0.18) !important;
    color: #93c5fd !important;
}
html.dark-mode .menu.dropdown-content .divider {
    background-color: var(--border-color) !important;
    opacity: 0.6;
}
html.dark-mode .menu.dropdown-content details > summary {
    color: #fbbf24 !important;
}