/* Global Font Settings for ElMashreqy System */
/* Setting Noto Sans Arabic as the default font across the entire application */

/* Use font-display: swap to prevent invisible text during font load */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@300;400;500;600;700&display=swap');

/* Preload font to reduce FOUT */
@font-face {
    font-family: 'Noto Sans Arabic';
    font-display: swap;
}

/* Universal font reset - applies to all elements (excluding icon fonts) */
*:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]) {
    font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

/* Body and HTML specific settings */
html, body {
    font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif !important;
    font-weight: 400;
    line-height: 1.6;
    /* Prevent font-size changes during loading */
    font-size: 16px !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Consistent navigation font sizing */
.navbar, .navbar * {
    font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif !important;
    /* Don't override specific nav sizes, just ensure font family */
}

/* Prevent font size jumping in navigation specifically */
.navbar-nav .nav-link,
.navbar-text,
.navbar-text strong,
.navbar-text small {
    font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif !important;
    /* Maintain original sizes from nav-styles.css */
}

/* Ensure all text elements use the correct font (excluding icon fonts) */
h1, h2, h3, h4, h5, h6,
p, div, span, a, li, td, th,
input, select, textarea, button,
label, small, strong, em, b {
    font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}
/* Exclude icon fonts from font-family override */
i:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not([class*="fa-"]) {
    font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

/* Table elements */
.table, table, td, th {
    font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

/* Bootstrap components */
.navbar, .nav-link, .navbar-text,
.btn, .form-control, .form-select,
.alert, .badge, .card, .modal {
    font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

/* Dropdown menus */
.dropdown-menu, .dropdown-item {
    font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

/* Code blocks should use monospace */
code, pre, .monospace, kbd, samp {
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace !important;
}

/* Override any inline Tahoma declarations */
body[style*="font-family:tahoma"],
div[style*="font-family:tahoma"],
table[style*="font-family:tahoma"] {
    font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

/* Specific overrides for legacy styles */
body[style*="tahoma"] {
    font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}