/* 
 * Button Cairo Font Fix
 * Ensures buttons use Cairo font while maintaining functionality
 */

/* ========================================
 * BUTTON CAIRO APPLICATION
 * ======================================== */

/* Apply Cairo to all button types */
.btn, button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    font-family: 'Cairo', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 500 !important;
    font-style: normal !important;
    line-height: 1.42857143 !important;
}

/* Button variants */
.btn-default,
.btn-primary,
.btn-success,
.btn-info,
.btn-warning,
.btn-danger,
.btn-secondary,
.btn-light,
.btn-dark {
    font-family: 'Cairo', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 500 !important;
}

/* Button sizes */
.btn-xs,
.btn-sm,
.btn-md,
.btn-lg {
    font-family: 'Cairo', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 500 !important;
}

/* Button groups */
.btn-group .btn,
.btn-group-vertical .btn,
.btn-toolbar .btn {
    font-family: 'Cairo', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 500 !important;
}

/* ========================================
 * BUTTON TEXT ELEMENTS
 * ======================================== */

/* Button text content */
.btn span,
.btn div,
button span,
button div,
.btn > *:not(i):not(.fa):not(.fas):not(.far):not(.fab):not(.glyphicon):not([class*="icon-"]) {
    font-family: 'Cairo', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 500 !important;
}

/* ========================================
 * SPECIFIC BUTTON CLASSES
 * ======================================== */

/* Settings page buttons */
.settings-btn,
.update-settings-btn,
.save-settings-btn,
.submit-btn {
    font-family: 'Cairo', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 500 !important;
}

/* Form buttons */
.form-btn,
.form-submit,
.form-cancel {
    font-family: 'Cairo', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 500 !important;
}

/* Modal buttons */
.modal-btn,
.modal-submit,
.modal-cancel {
    font-family: 'Cairo', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 500 !important;
}

/* ========================================
 * ICON PROTECTION IN BUTTONS
 * ======================================== */

/* Icons inside buttons */
.btn i,
.btn .fa,
.btn .fas,
.btn .far,
.btn .fab,
.btn .glyphicon,
.btn .icon,
button i,
button .fa,
button .fas,
button .far,
button .fab,
button .glyphicon,
button .icon {
    font-family: 'Font Awesome 5 Free', 'Font Awesome 5 Brands', 'FontAwesome', 
                 'Glyphicons Halflings', 'Ionicons', 'Material Icons' !important;
    font-style: normal !important;
    font-weight: 900 !important;
}

/* ========================================
 * BUTTON LAYOUT FIXES
 * ======================================== */

/* Ensure proper button spacing */
.btn {
    padding: 6px 12px !important;
    vertical-align: middle !important;
    text-align: center !important;
    white-space: nowrap !important;
    cursor: pointer !important;
}

.btn-xs {
    padding: 1px 5px !important;
    font-size: 12px !important;
}

.btn-sm {
    padding: 5px 10px !important;
    font-size: 12px !important;
}

.btn-lg {
    padding: 10px 16px !important;
    font-size: 18px !important;
}

/* Icon spacing in buttons */
.btn > i:first-child,
.btn > .fa:first-child {
    margin-right: 5px !important;
}

.btn > i:last-child,
.btn > .fa:last-child {
    margin-left: 5px !important;
}

/* ========================================
 * BUTTON STATES
 * ======================================== */

/* Button hover and focus states */
.btn:hover,
.btn:focus,
.btn:active,
button:hover,
button:focus,
button:active {
    font-family: 'Cairo', 'Tahoma', 'Arial', sans-serif !important;
    font-weight: 500 !important;
}

/* ========================================
 * EXCLUSIONS - KEEP SYSTEM FONT
 * ======================================== */

/* DataTables buttons - keep system font for proper layout */
.dt-button,
.dt-buttons .dt-button,
.DTTT_button,
.DTTT_container .DTTT_button {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* Pagination buttons - keep system font */
.pagination > li > a,
.pagination > li > span,
.dataTables_paginate .paginate_button {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
}

/* ========================================
 * RESPONSIVE FIXES
 * ======================================== */

@media (max-width: 768px) {
    .btn {
        font-size: 14px !important;
        padding: 8px 12px !important;
    }
    
    .btn-xs {
        font-size: 11px !important;
        padding: 2px 6px !important;
    }
    
    .btn-sm {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
    
    .btn-lg {
        font-size: 16px !important;
        padding: 12px 20px !important;
    }
}
