/* ===================================
   Icon Fix CSS
   Fix Font Awesome icons after font override
   =================================== */

/* Font Awesome 6 & 5 Protection */
.fas, .far, .fal, .fat, .fad, .fab,
.fa, i[class^="fa-"], i[class*=" fa-"],
[data-fa-i2svg] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands", "Font Awesome 5 Free", "Font Awesome 5 Pro", "FontAwesome" !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Font weights for different FA styles */
.fas, .fa-solid {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
}

.far, .fa-regular {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
    font-weight: 400 !important;
}

.fab, .fa-brands {
    font-family: "Font Awesome 6 Brands", "Font Awesome 5 Brands" !important;
    font-weight: 400 !important;
}

.fal, .fa-light {
    font-family: "Font Awesome 6 Pro" !important;
    font-weight: 300 !important;
}

.fat, .fa-thin {
    font-family: "Font Awesome 6 Pro" !important;
    font-weight: 100 !important;
}

.fad, .fa-duotone {
    font-family: "Font Awesome 6 Duotone" !important;
    font-weight: 900 !important;
}

/* Before pseudo-elements */
.fas::before, .far::before, .fab::before, 
.fal::before, .fat::before, .fad::before,
.fa::before, [class^="fa-"]::before, [class*=" fa-"]::before {
    font-family: inherit !important;
    font-weight: inherit !important;
}

/* Common containers with icons */
.btn .fas, .btn .far, .btn .fab,
.nav .fas, .nav .far, .nav .fab,
.navbar .fas, .navbar .far, .navbar .fab,
.sidebar .fas, .sidebar .far, .sidebar .fab,
.card .fas, .card .far, .card .fab,
.modal .fas, .modal .far, .modal .fab,
.alert .fas, .alert .far, .alert .fab,
.badge .fas, .badge .far, .badge .fab,
.breadcrumb .fas, .breadcrumb .far, .breadcrumb .fab,
.dropdown .fas, .dropdown .far, .dropdown .fab,
.table .fas, .table .far, .table .fab,
.form-control .fas, .form-control .far, .form-control .fab,
.input-group .fas, .input-group .far, .input-group .fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands", "Font Awesome 5 Free", "Font Awesome 5 Pro" !important;
}

/* Text color classes with icons */
.text-primary .fas, .text-primary .far, .text-primary .fab,
.text-secondary .fas, .text-secondary .far, .text-secondary .fab,
.text-success .fas, .text-success .far, .text-success .fab,
.text-danger .fas, .text-danger .far, .text-danger .fab,
.text-warning .fas, .text-warning .far, .text-warning .fab,
.text-info .fas, .text-info .far, .text-info .fab,
.text-light .fas, .text-light .far, .text-light .fab,
.text-dark .fas, .text-dark .far, .text-dark .fab,
.text-muted .fas, .text-muted .far, .text-muted .fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands" !important;
}

/* SVG icons (for FontAwesome 6 with SVG mode) */
svg.svg-inline--fa {
    display: inline-block !important;
    font-size: inherit !important;
    height: 1em !important;
    overflow: visible !important;
    vertical-align: -0.125em !important;
}

/* Bootstrap Icons (if used) */
.bi, [class^="bi-"], [class*=" bi-"] {
    font-family: "bootstrap-icons" !important;
    font-style: normal !important;
    font-variant: normal !important;
    font-weight: normal !important;
    line-height: 1 !important;
    text-rendering: auto !important;
}

/* Material Icons (if used) */
.material-icons, .material-icons-outlined,
.material-icons-two-tone, .material-icons-round,
.material-icons-sharp {
    font-family: 'Material Icons', 'Material Icons Outlined', 'Material Icons Two Tone', 'Material Icons Round', 'Material Icons Sharp' !important;
    font-weight: normal !important;
    font-style: normal !important;
    font-size: 24px !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    display: inline-block !important;
    white-space: nowrap !important;
    word-wrap: normal !important;
    direction: ltr !important;
    -webkit-font-smoothing: antialiased !important;
    text-rendering: optimizeLegibility !important;
}

/* Additional protection for nested icon elements */
* .fas, * .far, * .fab, * .fal, * .fat, * .fad,
* i[class^="fa-"], * i[class*=" fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands", "Font Awesome 5 Free", "Font Awesome 5 Pro" !important;
}

/* Specific protection for commonly used selectors */
span .fas, span .far, span .fab,
div .fas, div .far, div .fab,
p .fas, p .far, p .fab,
h1 .fas, h1 .far, h1 .fab,
h2 .fas, h2 .far, h2 .fab,
h3 .fas, h3 .far, h3 .fab,
h4 .fas, h4 .far, h4 .fab,
h5 .fas, h5 .far, h5 .fab,
h6 .fas, h6 .far, h6 .fab {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands" !important;
}