/**
 * Arabic Text Fix for Forms
 * Fixes overlapping/spacing issues in Arabic text
 */

/* Fix all form labels for Arabic text */
.form-label,
label,
.form-check-label {
    letter-spacing: normal !important;
    word-spacing: normal !important;
    font-feature-settings: normal !important;
}

/* Ensure proper Arabic text rendering */
[dir="rtl"] .form-label,
[dir="rtl"] label,
[dir="rtl"] .form-check-label,
html[lang="ar"] .form-label,
html[lang="ar"] label,
html[lang="ar"] .form-check-label {
    font-family: 'Assistant', 'Cairo', 'Tajawal', 'Arial', sans-serif !important;
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
    line-height: 1.6 !important;
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Fix card headers with Arabic text */
.card-header h5,
.card-header h4,
.card-header h3 {
    letter-spacing: normal !important;
    word-spacing: normal !important;
    font-feature-settings: normal !important;
}

[dir="rtl"] .card-header h5,
[dir="rtl"] .card-header h4,
[dir="rtl"] .card-header h3,
html[lang="ar"] .card-header h5,
html[lang="ar"] .card-header h4,
html[lang="ar"] .card-header h3 {
    font-family: 'Assistant', 'Cairo', 'Tajawal', 'Arial', sans-serif !important;
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
    line-height: 1.5 !important;
}

/* Fix instruction content */
.instruction-content,
.instruction-content p,
.instruction-content div {
    letter-spacing: normal !important;
    word-spacing: normal !important;
    line-height: 1.8 !important;
}

[dir="rtl"] .instruction-content,
[dir="rtl"] .instruction-content p,
[dir="rtl"] .instruction-content div,
html[lang="ar"] .instruction-content,
html[lang="ar"] .instruction-content p,
html[lang="ar"] .instruction-content div {
    font-family: 'Assistant', 'Cairo', 'Tajawal', 'Arial', sans-serif !important;
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
}

/* Fix badge content */
.badge-content,
.id-label,
.id-number {
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

[dir="rtl"] .badge-content,
[dir="rtl"] .id-label,
[dir="rtl"] .id-number,
html[lang="ar"] .badge-content,
html[lang="ar"] .id-label,
html[lang="ar"] .id-number {
    font-family: 'Assistant', 'Cairo', 'Tajawal', 'Arial', sans-serif !important;
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
}

/* Fix currency details */
.currency-name,
.currency-symbol {
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

[dir="rtl"] .currency-name,
[dir="rtl"] .currency-symbol,
html[lang="ar"] .currency-name,
html[lang="ar"] .currency-symbol {
    font-family: 'Assistant', 'Cairo', 'Tajawal', 'Arial', sans-serif !important;
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
}

/* Fix all paragraph text */
p,
span,
div {
    letter-spacing: normal;
    word-spacing: normal;
}

/* Fix button text */
.btn,
.btn-glow,
button {
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

[dir="rtl"] .btn,
[dir="rtl"] .btn-glow,
[dir="rtl"] button,
html[lang="ar"] .btn,
html[lang="ar"] .btn-glow,
html[lang="ar"] button {
    font-family: 'Assistant', 'Cairo', 'Tajawal', 'Arial', sans-serif !important;
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
}

/* Fix tooltips */
.tooltip,
[data-bs-toggle="tooltip"] {
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

/* Fix form inputs placeholders */
.form-control::placeholder,
.form--control::placeholder,
input::placeholder,
textarea::placeholder {
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

/* Fix select options */
select option {
    letter-spacing: normal !important;
    word-spacing: normal !important;
    line-height: 1.5 !important;
}

/* Fix alert messages */
.alert,
.iziToast {
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

[dir="rtl"] .alert,
[dir="rtl"] .iziToast,
html[lang="ar"] .alert,
html[lang="ar"] .iziToast {
    font-family: 'Assistant', 'Cairo', 'Tajawal', 'Arial', sans-serif !important;
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
    line-height: 1.6 !important;
}

/* Ensure proper spacing in RTL */
[dir="rtl"] * {
    text-align: right;
}

/* Fix Bootstrap default letter-spacing */
.form-label,
.form-control,
.form-select,
.form-check-label {
    letter-spacing: 0 !important;
}

/* Fix any remaining text elements */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6,
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6 {
    font-family: 'Assistant', 'Cairo', 'Tajawal', 'Arial', sans-serif !important;
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    [dir="rtl"] .form-label,
    [dir="rtl"] label,
    html[lang="ar"] .form-label,
    html[lang="ar"] label {
        font-size: 14px !important;
        line-height: 1.7 !important;
    }
}
