/* ==========================================================================
   Camdemics Offline Icon Optimization & Universal Icon Mappings
   ========================================================================== */

/* Font display swap - Show fallback while font loads */
@font-face {
    font-family: 'FontAwesome';
    font-display: swap;
}
@font-face {
    font-family: 'Font Awesome 6 Free';
    font-display: swap;
}
@font-face {
    font-family: 'Font Awesome 6 Brands';
    font-display: swap;
}
@font-face {
    font-family: 'Font Awesome 5 Free';
    font-display: swap;
}
@font-face {
    font-family: 'Font Awesome 5 Brands';
    font-display: swap;
}

/* Ensure FontAwesome icons load instantly and look crisp */
.fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands,
[class^="fa-"], [class*=" fa-"] {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

.fa-solid, .fas,
i.fa-solid, i.fas,
span.fa-solid, span.fas {
    font-family: 'Font Awesome 6 Free', 'FontAwesome', sans-serif !important;
    font-weight: 900 !important;
}

.fa-regular, .far,
i.fa-regular, i.far,
span.fa-regular, span.far {
    font-family: 'Font Awesome 6 Free', 'FontAwesome', sans-serif !important;
    font-weight: 400 !important;
}

.fa-brands, .fab,
i.fa-brands, i.fab,
span.fa-brands, span.fab {
    font-family: 'Font Awesome 6 Brands', 'FontAwesome', sans-serif !important;
    font-weight: 400 !important;
}

.fa:not(.fa-solid):not(.fa-regular):not(.fa-brands):not(.fas):not(.far):not(.fab) {
    font-family: 'FontAwesome', 'Font Awesome 6 Free', sans-serif !important;
    font-weight: normal !important;
}

/* Explicit Cross-Version FontAwesome Fallbacks */
.fa-id-card:before, .fa-id-badge:before { content: "\f2c2" !important; }
.fa-id-card-o:before { content: "\f2c3" !important; }
.fa-credit-card:before { content: "\f09d" !important; }
.fa-credit-card-alt:before { content: "\f283" !important; }
.fa-tachometer:before, .fa-gauge:before, .fa-gauge-high:before { content: "\f0e4" !important; }
.fa-money:before, .fa-money-bill:before { content: "\f0d6" !important; }
.fa-building-columns:before, .fa-university:before, .fa-bank:before { content: "\f19c" !important; }
.fa-graduation-cap:before, .fa-mortar-board:before { content: "\f19d" !important; }
.fa-user-circle:before, .fa-circle-user:before { content: "\f2bd" !important; }
.fa-user-tie:before { content: "\f508" !important; }
.fa-shield:before, .fa-shield-halved:before, .fa-shield-alt:before { content: "\f3ed" !important; }
.fa-magic:before, .fa-wand-magic-sparkles:before { content: "\f0d0" !important; }
.fa-barcode:before { content: "\f02a" !important; }

/* ══════════════════════════════════════════════════════════
   LUCIDE SVG & SIDEBAR ICON RENDERING (CRITICAL FIX)
   ══════════════════════════════════════════════════════════ */

/* Eliminate legacy theme ::before pseudo-element collision on Lucide tags */
.sidebar .nav .nav-item .nav-link i.menu-arrow::before,
.sidebar .nav .nav-item .nav-link i.menu-arrow::after,
.sidebar .nav .nav-item .nav-link .menu-arrow::before,
.sidebar .nav .nav-item .nav-link .menu-arrow::after,
.menu-icon::before,
.menu-icon::after,
.submenu-icon::before,
.submenu-icon::after,
.menu-arrow::before,
.menu-arrow::after,
[data-lucide]::before,
[data-lucide]::after {
    content: none !important;
    display: none !important;
}

/* Sidebar nav-link flex layout fixes */
.sidebar .nav .nav-item .nav-link {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    position: relative !important;
    overflow: hidden !important;
}

.sidebar .nav .nav-item .nav-link .menu-title {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    padding: 0 !important;
    margin: 0 !important;
}

.sidebar .nav .nav-item .nav-link .menu-arrow,
.sidebar .nav .nav-item .nav-link i.menu-arrow,
.sidebar .nav .nav-item .nav-link svg.menu-arrow {
    position: static !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    right: auto !important;
    left: auto !important;
    top: auto !important;
    bottom: auto !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
}

.sidebar .nav .nav-item .nav-link .nav-badge,
.sidebar .nav .nav-item .nav-link .badge {
    flex-shrink: 0 !important;
    margin-left: auto !important;
    margin-right: 4px !important;
}

.sidebar .nav .nav-item .nav-link .nav-badge + .menu-arrow,
.sidebar .nav .nav-item .nav-link .badge + .menu-arrow {
    margin-left: 4px !important;
}

/* Optimize SVG & Lucide rendering */
svg.lucide, .lucide {
    display: inline-block !important;
    vertical-align: middle !important;
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2 !important;
    stroke-linecap: round !important;
    stroke-linejoin: round !important;
    flex-shrink: 0 !important;
}

.menu-icon > svg,
.menu-icon.lucide,
svg.menu-icon {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    stroke: currentColor !important;
    display: block !important;
}

.submenu-icon > svg,
.submenu-icon.lucide,
svg.submenu-icon {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    stroke: currentColor !important;
    display: block !important;
}

.menu-arrow > svg,
.menu-arrow.lucide,
svg.menu-arrow {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    stroke: currentColor !important;
    display: block !important;
}

/* Menu & Submenu Icon Container Alignment */
.menu-icon, .submenu-icon, .nav-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease !important;
}

/* ══════════════════════════════════════════════════════════
   MDI (Material Design Icons) Offline Fallbacks
   ══════════════════════════════════════════════════════════ */
.mdi {
    display: inline-block;
    font-family: "Font Awesome 6 Free", "FontAwesome", sans-serif;
    font-weight: 900;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mdi-bank::before { content: "\f19c"; } /* fa-university / landmark */
.mdi-file-document-outline::before { content: "\f15c"; } /* fa-file-text */
.mdi-cash-check::before { content: "\f058"; } /* fa-check-circle */
.mdi-alert-circle-outline::before { content: "\f06a"; } /* fa-exclamation-circle */
.mdi-account-check::before { content: "\f4fc"; } /* fa-user-check */
.mdi-cash::before { content: "\f0d6"; } /* fa-money-bill */
.mdi-format-list-bulleted::before { content: "\f03a"; } /* fa-list */
.mdi-tag-multiple::before { content: "\f02c"; } /* fa-tags */
.mdi-shield-check::before { content: "\f3ed"; } /* fa-shield-halved */
.mdi-printer::before { content: "\f02f"; } /* fa-print */
.mdi-close::before { content: "\f00d"; } /* fa-times */
.mdi-information-outline::before { content: "\f05a"; } /* fa-info-circle */
.mdi-monitor-dashboard::before { content: "\f624"; } /* fa-gauge / dashboard */
.mdi-plus::before { content: "\f067"; } /* fa-plus */
.mdi-plus-circle::before { content: "\f055"; } /* fa-plus-circle */
.mdi-eye::before { content: "\f06e"; } /* fa-eye */
.mdi-content-save::before { content: "\f0c7"; } /* fa-save */
.mdi-chart-line::before { content: "\f201"; } /* fa-chart-line */
.mdi-magnify::before { content: "\f002"; } /* fa-search */
.mdi-arrow-right::before { content: "\f061"; } /* fa-arrow-right */
.mdi-file-chart::before { content: "\f1fe"; } /* fa-chart-area */
.mdi-file-plus::before { content: "\f65e"; } /* fa-folder-plus */
