/* Vietnamese Font Optimization CSS */
/* This file ensures consistent Vietnamese character rendering */

/* Import Inter font with Vietnamese subset */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&subset=vietnamese&display=swap');

/* Global font reset for Vietnamese consistency - EXCLUDE ICONS */
*:not([class*="fa-"]):not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.fass):not(.fasr):not(.fasl):not(.fasd) {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif !important;
    font-variant-ligatures: none;
    font-feature-settings: 'kern' 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure Font Awesome icons are NOT affected */
[class*="fa-"], .fa, .fas, .far, .fab, .fal, .fad, .fass, .fasr, .fasl, .fasd {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands", "FontAwesome" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-transform: none !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Specific Vietnamese character fixes */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

/* Headers with consistent Vietnamese rendering */
h1, h2, h3, h4, h5, h6 {
    font-family: inherit;
    font-weight: 600;
    line-height: 1.3;
}

/* Form elements - exclude icon buttons */
input:not([class*="fa-"]),
textarea:not([class*="fa-"]),
select:not([class*="fa-"]),
button:not([class*="fa-"]):not(.fa):not(.fas):not(.far):not(.fab) {
    font-family: inherit;
    font-weight: 400;
}

/* Labels and text */
label, p, span, div {
    font-family: inherit;
    font-weight: 400;
}

/* Strong and bold elements */
strong, b {
    font-weight: 600;
}

/* Table elements */
table, th, td {
    font-family: inherit;
}

/* Vietnamese diacritics optimization */
.vietnamese-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-feature-settings: 'kern' 1, 'liga' 0;
    text-rendering: optimizeLegibility;
}

/* PDF specific styles (for web preview) */
.pdf-preview {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 12px;
    line-height: 1.5;
}

/* Bootstrap override for Vietnamese */
.form-control, .form-select, .form-check-label {
    font-family: inherit !important;
    font-weight: 400 !important;
}

/* Button text consistency */
.btn {
    font-family: inherit !important;
    font-weight: 500 !important;
}

/* Alert and notification text */
.alert {
    font-family: inherit !important;
}

/* Card and section headers */
.card-header, .section-header {
    font-family: inherit !important;
    font-weight: 600 !important;
}

/* Debug: Force Font Awesome for all icons */
[class*="fa-"]::before,
.fa::before,
.fas::before,
.far::before,
.fab::before {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands" !important;
    font-weight: 900 !important;
    font-style: normal !important;
}

.far::before {
    font-weight: 400 !important;
}

.fab::before {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}
