/* IranYekan Font Integration */
@font-face {
    font-family: 'IRANYekanX';
    src: url('../fonts/IRANYekanX/IRANYekanX.woff2') format('woff2'),
         url('../fonts/IRANYekanX/IRANYekanX.woff') format('woff'),
         url('../fonts/IRANYekanX/IRANYekanX.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Global Font Settings */
body {
    font-family: 'IRANYekanX', 'Tahoma', 'Arial', sans-serif !important;
}

/* Ensure all text elements use the font */
h1, h2, h3, h4, h5, h6,
p, span, div, a, button, input, textarea, select,
.navbar, .card, .table, .modal, .btn, .form-control, .form-label {
    font-family: 'IRANYekanX', 'Tahoma', 'Arial', sans-serif !important;
}

/* Specific styling for better Persian text rendering */
body {
    direction: rtl;
    text-align: right;
}

/* Improve font rendering */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fix dropdown arrow positioning for RTL layout */
.form-select {
    padding-right: 2.25rem !important;
    padding-left: 0.75rem !important;
    background-position: left 0.75rem center !important;
    background-size: 16px 12px !important;
}

.form-select:focus {
    background-position: left 0.75rem center !important;
}

/* Fix for Bootstrap 5 select dropdown arrows */
select.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: left 0.75rem center !important;
    background-size: 16px 12px !important;
}

/* Ensure proper spacing for dropdown text */
.form-select option {
    padding-right: 0.75rem !important;
    padding-left: 0.75rem !important;
}

/* Fix for large select elements */
.form-select-lg {
    padding-right: 3rem !important;
    padding-left: 1rem !important;
    background-position: left 1rem center !important;
}

/* Fix for small select elements */
.form-select-sm {
    padding-right: 2rem !important;
    padding-left: 0.5rem !important;
    background-position: left 0.5rem center !important;
}

/* Additional fixes for dropdown arrows */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: left 0.75rem center !important;
    background-size: 16px 12px !important;
    padding-right: 2.25rem !important;
    padding-left: 0.75rem !important;
}

/* Fix for custom select elements */
.custom-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: left 0.75rem center !important;
    background-size: 16px 12px !important;
    padding-right: 2.25rem !important;
    padding-left: 0.75rem !important;
}

/* Ensure dropdown arrows don't interfere with text */
.form-select:not([multiple]):not([size]) {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: left 0.75rem center !important;
    background-size: 16px 12px !important;
}

/* Fix for disabled select elements */
.form-select:disabled {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e") !important;
}
