/* 
 * Icons & Buttons Protection CSS
 * Ensures all interactive elements work correctly
 * This file must be loaded AFTER cairo-font.css
 */

/* ========================================
 * BUTTONS PROTECTION - HIGHEST PRIORITY
 * ======================================== */

/* All button types - Apply Cairo font */
.btn, button, 
input[type="button"],
input[type="submit"],
input[type="reset"],
.btn-default, .btn-primary, .btn-success, .btn-info, .btn-warning, .btn-danger,
.btn-xs, .btn-sm, .btn-md, .btn-lg,
.btn-group .btn,
.btn-group-vertical .btn {
    font-family: 'Cairo', 'Tahoma', 'Arial', sans-serif !important;
    font-style: normal !important;
    font-weight: 500 !important;
    line-height: 1.42857143 !important;
}

/* Button content - Apply Cairo to text, protect icons */
.btn > span, .btn > div,
button > span, button > div {
    font-family: 'Cairo', 'Tahoma', 'Arial', sans-serif !important;
}

.btn > i, button > i {
    font-family: 'Font Awesome 5 Free', 'FontAwesome', 'Glyphicons Halflings', sans-serif !important;
}

/* DataTables buttons */
.dt-buttons, .dt-buttons *,
.dt-button, .dt-button *,
.buttons-html5, .buttons-print, .buttons-pdf, .buttons-excel, .buttons-csv,
.buttons-copy, .buttons-collection,
div.dt-buttons, div.dt-buttons * {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* Legacy DataTables buttons */
.DTTT_button, .DTTT_button *,
.DTTT_container, .DTTT_container * {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* ========================================
 * PAGINATION PROTECTION
 * ======================================== */

/* Bootstrap pagination */
.pagination, .pagination *,
.pagination > li > a,
.pagination > li > span,
.pager, .pager * {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
    font-style: normal !important;
}

/* DataTables pagination */
.dataTables_paginate, .dataTables_paginate *,
.paginate_button, .paginate_button *,
.paging_simple_numbers, .paging_simple_numbers *,
div.dataTables_paginate, div.dataTables_paginate *,
.dataTables_wrapper .dataTables_paginate,
.dataTables_wrapper .dataTables_paginate * {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* ========================================
 * DROPDOWNS & SELECT2 PROTECTION
 * ======================================== */

/* Bootstrap dropdowns */
.dropdown-menu, .dropdown-menu *,
.dropdown-menu > li > a,
.dropdown-header,
.dropdown-toggle {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* Select2 */
.select2-container, .select2-container *,
.select2-results, .select2-results *,
.select2-selection, .select2-selection *,
.select2-dropdown, .select2-dropdown *,
.select2-search, .select2-search *,
span.select2, span.select2 * {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* Native select - Keep Cairo for readability */
select, select option {
    font-family: 'Cairo', 'Tahoma', 'Arial', sans-serif !important;
}

/* ========================================
 * ICON FONTS PROTECTION
 * ======================================== */

/* Font Awesome - All versions */
.fa, .fas, .far, .fab, .fal, .fad, 
.fa-solid, .fa-regular, .fa-light, .fa-thin, .fa-duotone,
i[class^="fa-"], i[class*=" fa-"],
span[class^="fa-"], span[class*=" fa-"],
i.fa, i.fas, i.far, i.fab, i.fal, i.fad,
span.fa, span.fas, span.far, span.fab {
    font-family: 'Font Awesome 5 Free', 'Font Awesome 5 Brands', 'Font Awesome 6 Free', 
                 'Font Awesome 6 Brands', 'FontAwesome', sans-serif !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-weight: 900 !important;
}

/* Glyphicons */
.glyphicon, [class^="glyphicon-"], [class*=" glyphicon-"],
i.glyphicon, span.glyphicon {
    font-family: 'Glyphicons Halflings', sans-serif !important;
    font-style: normal !important;
    font-weight: normal !important;
    line-height: 1 !important;
}

/* Material Icons */
.material-icons {
    font-family: 'Material Icons', sans-serif !important;
    font-weight: normal !important;
    font-style: normal !important;
}

/* Generic icons */
.icon, [class*="icon-"], i.icon, span.icon {
    font-family: 'FontAwesome', 'Glyphicons Halflings', 'Ionicons', sans-serif !important;
}

/* All i and span tags (catch-all for icons) */
i:not([class*="text-"]) {
    font-family: 'Font Awesome 5 Free', 'FontAwesome', 'Glyphicons Halflings', sans-serif !important;
}

/* ========================================
 * POS SYSTEM PROTECTION
 * ======================================== */

/* POS containers and buttons */
.pos-tab-container, .pos-tab-container *,
.pos-product-div, .pos-product-div *,
.pos-processing, .pos-processing *,
.pos-header, .pos-header *,
.pos-footer, .pos-footer *,
#pos_form, #pos_form *,
.pos-product-card, .pos-product-card *,
.payment-modal, .payment-modal * {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* POS buttons specifically */
.pos-express-finalize,
.pos-delete-cart-item,
.pos-add-product-qty,
.pos-minus-product-qty,
.quick_add_product_modal,
#close-express-finalize {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* ========================================
 * NAVIGATION PROTECTION
 * ======================================== */

/* Navbar */
.navbar, .navbar *,
.navbar-nav, .navbar-nav *,
.nav, .nav *,
.nav-tabs, .nav-tabs *,
.nav-pills, .nav-pills * {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* Sidebar menu - Protect icons only, allow Cairo for text */
.sidebar-menu > li > a > i,
.sidebar-menu > li > a > .fa,
.sidebar-menu > li > a > .glyphicon,
.sidebar-menu > li > a > .icon,
.treeview-menu > li > a > i,
.treeview-menu > li > a > .fa,
.treeview-menu > li > a > .glyphicon,
.treeview-menu > li > a > .icon {
    font-family: 'Font Awesome 5 Free', 'FontAwesome', 'Glyphicons Halflings', sans-serif !important;
}

/* ========================================
 * FORM ELEMENTS PROTECTION
 * ======================================== */

/* Input groups with icons/buttons */
.input-group-addon, .input-group-addon *,
.input-group-btn, .input-group-btn *,
.input-group-btn button,
.input-group-btn .btn {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* ========================================
 * TABLES & DATATABLES PROTECTION
 * ======================================== */

/* DataTables controls */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_length *,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_filter *,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* Table action buttons and icons */
.table td button,
.table td .btn,
.table td i,
.table td a i {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* ========================================
 * BADGES & LABELS
 * ======================================== */

.badge, .label,
.badge *, .label * {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* ========================================
 * MODALS & ALERTS
 * ======================================== */

/* Modal buttons */
.modal-footer button,
.modal-footer .btn,
.modal-header .close {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* Alert buttons */
.alert button,
.alert .btn,
.alert .close {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* SweetAlert */
.swal2-container, .swal2-container *,
.swal2-popup, .swal2-popup *,
.swal2-confirm, .swal2-cancel {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* ========================================
 * PRINT & INVOICE PROTECTION
 * ======================================== */

.invoice, .invoice *,
.receipt, .receipt *,
.print-area, .print-area *,
.thermal-receipt, .thermal-receipt *,
.pos-receipt, .pos-receipt * {
    font-family: 'Arial', 'Tahoma', 'Helvetica', sans-serif !important;
}
