/* إصلاح شامل لمشكلة الأيقونات في Font Awesome */

/* تحميل Font Awesome من مصادر مسموحة فقط */
@import url('https://use.fontawesome.com/releases/v6.4.0/css/all.css');

/* إصلاح أساسي للأيقونات */
.fas, .far, .fab, .fa, .fal, .fad, .fat, .fass {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands", "Font Awesome 5 Free", "Font Awesome 5 Pro", "Font Awesome 5 Brands" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    display: inline-block !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* إصلاح خاص للأيقونات العادية */
.fa {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
}

/* إصلاح خاص للأيقونات الصلبة */
.fas {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

/* إصلاح خاص للأيقونات العادية */
.far {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
}

/* إصلاح خاص للأيقونات التجارية */
.fab {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

/* تعريف رموز الأيقونات يدوياً لضمان الظهور */
.fa-home::before { content: "\f015"; }
.fa-tachometer-alt::before { content: "\f3f4"; }
.fa-file-invoice::before { content: "\f570"; }
.fa-money-bill-wave::before { content: "\f53a"; }
.fa-handshake::before { content: "\f2b5"; }
.fa-chart-bar::before { content: "\f080"; }
.fa-building::before { content: "\f1ad"; }
.fa-users::before { content: "\f0c0"; }
.fa-percentage::before { content: "\f295"; }
.fa-cogs::before { content: "\f085"; }
.fa-cog::before { content: "\f013"; }
.fa-database::before { content: "\f1c0"; }
.fa-shield-alt::before { content: "\f3ed"; }
.fa-check-circle::before { content: "\f058"; }
.fa-user::before { content: "\f007"; }
.fa-bell::before { content: "\f0f3"; }
.fa-sign-out-alt::before { content: "\f2f5"; }
.fa-university::before { content: "\f19c"; }
.fa-tools::before { content: "\f7d9"; }
.fa-user-check::before { content: "\f4fc"; }
.fa-hdd::before { content: "\f0a0"; }
.fa-info-circle::before { content: "\f05a"; }
.fa-bolt::before { content: "\f0e7"; }
.fa-history::before { content: "\f1da"; }
.fa-ban::before { content: "\f05e"; }
.fa-file-archive::before { content: "\f1c6"; }
.fa-download::before { content: "\f019"; }
.fa-undo::before { content: "\f0e2"; }
.fa-info::before { content: "\f129"; }
.fa-trash::before { content: "\f1f8"; }
.fa-plus::before { content: "\f067"; }
.fa-sync-alt::before { content: "\f2f1"; }
.fa-calendar-check::before { content: "\f274"; }
.fa-exclamation-triangle::before { content: "\f071"; }
.fa-times::before { content: "\f00d"; }
.fa-close::before { content: "\f00d"; }

/* إصلاح خاص لأيقونة العلامة المئوية */
.fa-percent::before { content: "\0025"; }

/* تحسين عرض الأيقونات */
i[class*="fa-"] {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    display: inline-block !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* إصلاح مشكلة المستطيلات الصغيرة */
.fas:before, .far:before, .fab:before, .fa:before {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    display: inline-block !important;
    text-rendering: auto !important;
    line-height: 1 !important;
}

/* تحسين الأيقونات في الأزرار */
.btn i {
    margin-left: 0.5rem;
    font-size: inherit;
}

/* تحسين الأيقونات في القوائم */
.nav-link i {
    margin-left: 0.75rem;
    width: 1.25rem;
    text-align: center;
}

/* تحسين الأيقونات في البطاقات */
.card i {
    font-size: 1.25rem;
}

/* تحسين الأيقونات الكبيرة */
.fa-lg { font-size: 1.33333em; }
.fa-xl { font-size: 1.5em; }
.fa-2x { font-size: 2em; }
.fa-3x { font-size: 3em; }

/* إصلاح خاص للأيقونات في الهيدر */
.page-header i {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
}

/* إصلاح خاص للأيقونات في الأفاتار */
.avatar i {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
    font-size: 1rem;
}

/* إصلاح خاص للأيقونات في الشريط الجانبي */
.sidebar i {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
}

/* تحسين التباين والوضوح */
i[class*="fa-"] {
    color: inherit;
    opacity: 1;
    visibility: visible;
}

/* إصلاح مشكلة عدم ظهور الأيقونات على الإطلاق */
@font-face {
    font-family: 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 900;
    font-display: block;
    src: url('https://use.fontawesome.com/releases/v6.4.0/webfonts/fa-solid-900.woff2') format('woff2');
}

@font-face {
    font-family: 'Font Awesome 6 Free';
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url('https://use.fontawesome.com/releases/v6.4.0/webfonts/fa-regular-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Font Awesome 6 Brands';
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url('https://use.fontawesome.com/releases/v6.4.0/webfonts/fa-brands-400.woff2') format('woff2');
}

/* إصلاح نهائي لضمان ظهور جميع الأيقونات */
[class^="fa-"], [class*=" fa-"] {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    display: inline-block !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* تحسين خاص للأيقونات في البيئة العربية - معطل لتجنب التكرار */
/* [dir="rtl"] i[class*="fa-"] {
    transform: scaleX(-1);
} */

[dir="rtl"] .fa-home,
[dir="rtl"] .fa-cog,
[dir="rtl"] .fa-cogs,
[dir="rtl"] .fa-user,
[dir="rtl"] .fa-users,
[dir="rtl"] .fa-database,
[dir="rtl"] .fa-chart-bar,
[dir="rtl"] .fa-percentage,
[dir="rtl"] .fa-bell,
[dir="rtl"] .fa-shield-alt {
    transform: none;
}