/* ====================================================
   Arabic Font Styling - Bold Support
   ==================================================== */

/* Import Google Fonts for Arabic - Multiple Options */

/* Option 1: Cairo - Modern, clean, excellent for UI */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

/* Option 2: Tajawal - Clean and professional */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

/* Option 3: Amiri - Traditional, elegant serif */
@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&display=swap');

/* ====================================================
   Font Application for Arabic Language
   ==================================================== */

/* Apply Cairo as primary Arabic font (recommended for UI) */
html[lang="ar"],
html[dir="rtl"],
html[lang="ar"] body,
html[dir="rtl"] body {
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, sans-serif !important;
    font-weight: 600; /* Make all Arabic text slightly bolder by default */
}

/* All text elements in Arabic */
html[lang="ar"] *,
html[dir="rtl"] * {
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, sans-serif !important;
}

/* ====================================================
   MudBlazor Component Specific Overrides
   ==================================================== */

/* MudText components */
html[lang="ar"] .mud-typography,
html[dir="rtl"] .mud-typography {
    font-family: 'Cairo', 'Tajawal', sans-serif !important;
    font-weight: 600;
}

/* Headers - Extra bold for Arabic */
html[lang="ar"] .mud-typography-h1,
html[lang="ar"] .mud-typography-h2,
html[lang="ar"] .mud-typography-h3,
html[lang="ar"] .mud-typography-h4,
html[lang="ar"] .mud-typography-h5,
html[lang="ar"] .mud-typography-h6,
html[dir="rtl"] .mud-typography-h1,
html[dir="rtl"] .mud-typography-h2,
html[dir="rtl"] .mud-typography-h3,
html[dir="rtl"] .mud-typography-h4,
html[dir="rtl"] .mud-typography-h5,
html[dir="rtl"] .mud-typography-h6 {
    font-family: 'Cairo', sans-serif !important;
    font-weight: 800 !important; /* Extra bold for headers */
}

/* Buttons */
html[lang="ar"] .mud-button,
html[lang="ar"] .mud-button-root,
html[dir="rtl"] .mud-button,
html[dir="rtl"] .mud-button-root {
    font-family: 'Cairo', sans-serif !important;
    font-weight: 700 !important; /* Bold for buttons */
}

/* Navigation Menu */
html[lang="ar"] .mud-nav-link,
html[lang="ar"] .mud-navmenu,
html[dir="rtl"] .mud-nav-link,
html[dir="rtl"] .mud-navmenu {
    font-family: 'Cairo', sans-serif !important;
    font-weight: 600 !important;
}

/* Table Headers */
html[lang="ar"] .mud-table-head .mud-typography,
html[lang="ar"] .mud-table th,
html[dir="rtl"] .mud-table-head .mud-typography,
html[dir="rtl"] .mud-table th {
    font-family: 'Cairo', sans-serif !important;
    font-weight: 700 !important; /* Bold for table headers */
}

/* Table Body - Semi-bold */
html[lang="ar"] .mud-table-body .mud-typography,
html[lang="ar"] .mud-table td,
html[dir="rtl"] .mud-table-body .mud-typography,
html[dir="rtl"] .mud-table td {
    font-family: 'Cairo', sans-serif !important;
    font-weight: 600 !important;
}

/* Chips */
html[lang="ar"] .mud-chip,
html[dir="rtl"] .mud-chip {
    font-family: 'Cairo', sans-serif !important;
    font-weight: 700 !important; /* Bold for chips */
}

/* Cards */
html[lang="ar"] .mud-card-header,
html[lang="ar"] .mud-card-content,
html[dir="rtl"] .mud-card-header,
html[dir="rtl"] .mud-card-content {
    font-family: 'Cairo', sans-serif !important;
}

html[lang="ar"] .mud-card-header .mud-typography,
html[dir="rtl"] .mud-card-header .mud-typography {
    font-weight: 700 !important; /* Bold for card headers */
}

/* Form Labels */
html[lang="ar"] .mud-input-label,
html[lang="ar"] .mud-form-label,
html[dir="rtl"] .mud-input-label,
html[dir="rtl"] .mud-form-label {
    font-family: 'Cairo', sans-serif !important;
    font-weight: 600 !important;
}

/* Dialog Titles */
html[lang="ar"] .mud-dialog-title,
html[dir="rtl"] .mud-dialog-title {
    font-family: 'Cairo', sans-serif !important;
    font-weight: 800 !important; /* Extra bold for dialog titles */
}

/* Snackbar Messages */
html[lang="ar"] .mud-snackbar-content-message,
html[dir="rtl"] .mud-snackbar-content-message {
    font-family: 'Cairo', sans-serif !important;
    font-weight: 600 !important;
}

/* Tooltips */
html[lang="ar"] .mud-tooltip,
html[dir="rtl"] .mud-tooltip {
    font-family: 'Cairo', sans-serif !important;
    font-weight: 600 !important;
}

/* Drawer */
html[lang="ar"] .mud-drawer,
html[dir="rtl"] .mud-drawer {
    font-family: 'Cairo', sans-serif !important;
}

/* AppBar */
html[lang="ar"] .mud-appbar,
html[dir="rtl"] .mud-appbar {
    font-family: 'Cairo', sans-serif !important;
    font-weight: 700 !important;
}

/* ====================================================
   Utility Classes for Manual Control
   ==================================================== */

/* Force bold */
.arabic-bold {
    font-weight: 700 !important;
}

/* Force extra bold */
.arabic-extra-bold {
    font-weight: 800 !important;
}

/* Force semi-bold */
.arabic-semi-bold {
    font-weight: 600 !important;
}

/* Force regular */
.arabic-regular {
    font-weight: 400 !important;
}

/* Alternative font - Tajawal */
.arabic-font-tajawal {
    font-family: 'Tajawal', sans-serif !important;
}

/* Alternative font - Amiri (for elegant/formal content) */
.arabic-font-amiri {
    font-family: 'Amiri', serif !important;
}

/* ====================================================
   English Text - Keep Default Fonts
   ==================================================== */

html[lang="en"],
html[lang="en"] body,
html:not([lang="ar"]):not([dir="rtl"]) {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif !important;
}

/* ====================================================
   Print Styles for Arabic
   ==================================================== */

@media print {
    html[lang="ar"] *,
    html[dir="rtl"] * {
        font-family: 'Cairo', 'Tajawal', sans-serif !important;
        font-weight: 600 !important;
    }
}

/* ====================================================
   Accessibility - Ensure readability
   ==================================================== */

html[lang="ar"] {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ====================================================
   RTL Specific Adjustments
   ==================================================== */

html[dir="rtl"] {
    text-align: right;
}

/* Fix for icon + text alignment in RTL */
html[dir="rtl"] .mud-button-root .mud-button-icon-start {
    margin-right: 0;
    margin-left: 8px;
}

html[dir="rtl"] .mud-button-root .mud-button-icon-end {
    margin-left: 0;
    margin-right: 8px;
}
