/* ═══════════════════════════════════════════════════════════════════════════════
   Custom Fonts — Arabic & English (Performance Optimized)
   ═══════════════════════════════════════════════════════════════════════════════ */

/* English Font — Open Sans Condensed Bold (loaded by default) */
@font-face {
    font-family: "EnglishFont";
    src: url('../fonts/OpenSans_Condensed-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Arabic Font — Noto Sans Arabic Extra Condensed Black (loaded on demand) */
@font-face {
    font-family: "ArabicFont";
    src: url('../fonts/NotoSansArabic_ExtraCondensed-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+0660-0669;
}

/* Default Font — Use English font as default */
@font-face {
    font-family: "DefaultFont";
    src: url('../fonts/OpenSans_Condensed-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Apply English font by default (better performance) */
body {
    font-family: "DefaultFont", "EnglishFont", Arial, sans-serif !important;
    font-size: large;
}

/* Apply Arabic font only for RTL/Arabic content (lazy loading) */
html[dir="rtl"],
html[dir="rtl"] body,
html[dir="rtl"] .ui-widget,
[lang="ar"],
.arabic-text,
.text-arabic {
    font-family: "ArabicFont", "DefaultFont", Arial, sans-serif !important;
}

/* UI widgets and components inherit from parent */
.ui-widget,
.form-control,
.form-select,
.btn,
.card,
.table,
.navbar,
.modal,
.alert {
    font-family: inherit !important;
}

/* Performance: Don't load Arabic font unless needed */
@media not (min-resolution: 96dpi) {
    /* For high-DPI displays, ensure Arabic font is available */
    html[dir="rtl"],
    html[dir="rtl"] body,
    [lang="ar"],
    .arabic-text,
    .text-arabic {
        font-family: "ArabicFont", "DefaultFont", Arial, sans-serif !important;
    }
}
