/* ===================================
   ICON SPACING FIX - COMPREHENSIVE
   This file forces proper icon spacing throughout the application
   =================================== */

/* Force all FontAwesome icons to have inline-block display */
i.fa, i.fas, i.far, i.fab,
.fa, .fas, .far, .fab {
    display: inline-block !important;
}

/* ===================================
   LABELS - All Types
   =================================== */
label > i,
label > .fa,
label > .fas,
label > .far,
label > .fab,
.form-label > i,
.form-label > .fa,
.form-label > .fas,
.form-label > .far,
.form-label > .fab,
.form-label-modern > i,
.form-label-modern > .fa,
.form-label-modern > .fas,
.form-label-modern > .far,
.form-label-modern > .fab,
.control-label > i,
.control-label > .fa,
.control-label > .fas,
.control-label > .far,
.control-label > .fab,
.col-form-label > i,
.col-form-label > .fa,
.col-form-label > .fas,
.col-form-label > .far,
.col-form-label > .fab {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

/* ===================================
   CHECKBOXES & RADIOS
   =================================== */
.form-check-label > i,
.form-check-label > .fa,
.form-check-label > .fas,
.form-check-label > .far,
.form-check-label > .fab,
.custom-control-label > i,
.custom-control-label > .fa,
.custom-control-label > .fas,
.custom-control-label > .far,
.custom-control-label > .fab {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

/* ===================================
   BUTTONS - All Types
   =================================== */
.btn > i,
.btn > .fa,
.btn > .fas,
.btn > .far,
.btn > .fab,
.btn-modern > i,
.btn-modern > .fa,
.btn-modern > .fas,
.btn-modern > .far,
.btn-modern > .fab,
button > i,
button > .fa,
button > .fas,
button > .far,
button > .fab {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

/* Icons at the END of button text */
.btn > i:last-child:not(:only-child),
.btn > .fa:last-child:not(:only-child),
.btn > .fas:last-child:not(:only-child),
.btn > .far:last-child:not(:only-child),
.btn > .fab:last-child:not(:only-child),
.btn-modern > i:last-child:not(:only-child),
.btn-modern > .fa:last-child:not(:only-child),
.btn-modern > .fas:last-child:not(:only-child),
.btn-modern > .far:last-child:not(:only-child),
.btn-modern > .fab:last-child:not(:only-child),
button > i:last-child:not(:only-child),
button > .fa:last-child:not(:only-child),
button > .fas:last-child:not(:only-child),
button > .far:last-child:not(:only-child),
button > .fab:last-child:not(:only-child) {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

/* Icon-only buttons (no spacing needed) */
.btn > i:only-child,
.btn > .fa:only-child,
.btn > .fas:only-child,
.btn > .far:only-child,
.btn > .fab:only-child,
.btn-modern > i:only-child,
.btn-modern > .fa:only-child,
.btn-modern > .fas:only-child,
.btn-modern > .far:only-child,
.btn-modern > .fab:only-child,
button > i:only-child,
button > .fa:only-child,
button > .fas:only-child,
button > .far:only-child,
button > .fab:only-child {
    margin: 0 !important;
}

/* ===================================
   HEADINGS - All Levels
   =================================== */
h1 > i, h2 > i, h3 > i, h4 > i, h5 > i, h6 > i,
h1 > .fa, h2 > .fa, h3 > .fa, h4 > .fa, h5 > .fa, h6 > .fa,
h1 > .fas, h2 > .fas, h3 > .fas, h4 > .fas, h5 > .fas, h6 > .fas,
h1 > .far, h2 > .far, h3 > .far, h4 > .far, h5 > .far, h6 > .far,
h1 > .fab, h2 > .fab, h3 > .fab, h4 > .fab, h5 > .fab, h6 > .fab {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

/* ===================================
   CARD TITLES & PAGE TITLES
   =================================== */
.card-title > i,
.card-title > .fa,
.card-title > .fas,
.card-title > .far,
.card-title > .fab,
.modern-card-title > i,
.modern-card-title > .fa,
.modern-card-title > .fas,
.modern-card-title > .far,
.modern-card-title > .fab,
.page-title > i,
.page-title > .fa,
.page-title > .fas,
.page-title > .far,
.page-title > .fab {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

/* ===================================
   LINKS
   =================================== */
a > i,
a > .fa,
a > .fas,
a > .far,
a > .fab {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

a > i:last-child:not(:only-child),
a > .fa:last-child:not(:only-child),
a > .fas:last-child:not(:only-child),
a > .far:last-child:not(:only-child),
a > .fab:last-child:not(:only-child) {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

/* ===================================
   BADGES & ALERTS
   =================================== */
.badge > i,
.badge > .fa,
.badge > .fas,
.badge > .far,
.badge > .fab,
.badge-modern > i,
.badge-modern > .fa,
.badge-modern > .fas,
.badge-modern > .far,
.badge-modern > .fab,
.alert > i,
.alert > .fa,
.alert > .fas,
.alert > .far,
.alert > .fab,
.alert-modern > i,
.alert-modern > .fa,
.alert-modern > .fas,
.alert-modern > .far,
.alert-modern > .fab {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

/* ===================================
   OVERRIDE BOOTSTRAP MARGIN UTILITIES
   =================================== */
/* Force .me-2 to work properly */
.me-2 {
    margin-right: 0.5rem !important;
}

/* Force .ms-2 to work properly */
.ms-2 {
    margin-left: 0.5rem !important;
}

/* ===================================
   INPUT GROUPS
   =================================== */
.input-group-text > i,
.input-group-text > .fa,
.input-group-text > .fas,
.input-group-text > .far,
.input-group-text > .fab {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

.input-group-text > i:only-child,
.input-group-text > .fa:only-child,
.input-group-text > .fas:only-child,
.input-group-text > .far:only-child,
.input-group-text > .fab:only-child {
    margin: 0 !important;
}

/* ===================================
   TABS & NAV ITEMS
   =================================== */
.nav-link > i,
.nav-link > .fa,
.nav-link > .fas,
.nav-link > .far,
.nav-link > .fab,
.nav-item > i,
.nav-item > .fa,
.nav-item > .fas,
.nav-item > .far,
.nav-item > .fab {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

/* Modern Tabs Styling */
.nav-tabs-modern {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs-modern .nav-item {
    margin-bottom: -2px;
}

.nav-tabs-modern .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
}

.nav-tabs-modern .nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--border-color);
    background: var(--light-bg);
}

.nav-tabs-modern .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: transparent;
}

.nav-tabs-modern .nav-link i {
    margin-right: 0.5rem !important;
}

/* Tab content styling */
.tab-content {
    padding-top: 1.5rem;
}

.tab-pane {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   LIST ITEMS
   =================================== */
li > i:first-child,
li > .fa:first-child,
li > .fas:first-child,
li > .far:first-child,
li > .fab:first-child {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

/* ===================================
   DROPDOWN ITEMS
   =================================== */
.dropdown-item > i,
.dropdown-item > .fa,
.dropdown-item > .fas,
.dropdown-item > .far,
.dropdown-item > .fab {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

/* ===================================
   TABLE CELLS
   =================================== */
td > i:first-child,
td > .fa:first-child,
td > .fas:first-child,
td > .far:first-child,
td > .fab:first-child,
th > i:first-child,
th > .fa:first-child,
th > .fas:first-child,
th > .far:first-child,
th > .fab:first-child {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

/* ===================================
   SPANS & DIVS WITH ICONS
   =================================== */
span > i:first-child,
span > .fa:first-child,
span > .fas:first-child,
span > .far:first-child,
span > .fab:first-child {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

/* ===================================
   SPECIAL CASES
   =================================== */
/* Small text with icons */
small > i,
small > .fa,
small > .fas,
small > .far,
small > .fab {
    margin-right: 0.375rem !important;
    margin-left: 0 !important;
}

/* Strong/Bold text with icons */
strong > i,
strong > .fa,
strong > .fas,
strong > .far,
strong > .fab,
b > i,
b > .fa,
b > .fas,
b > .far,
b > .fab {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}
