/* Vazir Font - Using TTF files */
@font-face {
    font-family: 'Vazir';
    src: url('/build/fonts/vazir/Vazir.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('/build/fonts/vazir/Vazir-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* For medium weight - use bold with reduced weight if no medium file */
@font-face {
    font-family: 'Vazir';
    src: url('/build/fonts/vazir/Vazir.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* For light weight - use regular with adjusted rendering */
@font-face {
    font-family: 'Vazir';
    src: url('/build/fonts/vazir/Vazir.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* RTL Specific Styles with Vazir Font */
[dir="rtl"] {
    font-family: 'Vazir', 'hkgrotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[dir="rtl"] body {
    font-family: 'Vazir', 'hkgrotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6,
[dir="rtl"] .h1, [dir="rtl"] .h2, [dir="rtl"] .h3, [dir="rtl"] .h4, [dir="rtl"] .h5, [dir="rtl"] .h6 {
    font-family: 'Vazir', 'hkgrotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
}

[dir="rtl"] p, [dir="rtl"] span, [dir="rtl"] div, [dir="rtl"] input, [dir="rtl"] textarea, 
[dir="rtl"] select, [dir="rtl"] button, [dir="rtl"] a, [dir="rtl"] label, [dir="rtl"] th, 
[dir="rtl"] td, [dir="rtl"] .form-control, [dir="rtl"] .btn, [dir="rtl"] .card-title, 
[dir="rtl"] .modal-title, [dir="rtl"] .alert, [dir="rtl"] .badge, [dir="rtl"] .dropdown-item,
[dir="rtl"] .nav-link, [dir="rtl"] .breadcrumb-item, [dir="rtl"] .page-link,
[dir="rtl"] .table, [dir="rtl"] .table th, [dir="rtl"] .table td,
[dir="rtl"] .sidebar, [dir="rtl"] .navbar, [dir="rtl"] .dropdown-menu,
[dir="rtl"] .list-group-item, [dir="rtl"] .progress-bar, [dir="rtl"] .alert-heading {
    font-family: 'Vazir', 'hkgrotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Font weight adjustments */
[dir="rtl"] .fw-light {
    font-weight: 300 !important;
}

[dir="rtl"] .fw-normal,
[dir="rtl"] .fw-regular {
    font-weight: 400 !important;
}

[dir="rtl"] .fw-medium {
    font-weight: 500 !important;
}

[dir="rtl"] .fw-semibold {
    font-weight: 600 !important;
}

[dir="rtl"] .fw-bold {
    font-weight: 700 !important;
}

/* Specific components that need special handling */
[dir="rtl"] .badge {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
    font-weight: 500;
}

[dir="rtl"] .btn {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
    font-weight: 400;
}

[dir="rtl"] .form-control,
[dir="rtl"] .form-select {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
}

[dir="rtl"] .dropdown-item {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
    font-weight: 400;
}

[dir="rtl"] .nav-link {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
    font-weight: 500;
}

[dir="rtl"] .card-title {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
    font-weight: 700;
}

[dir="rtl"] .modal-title {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
    font-weight: 700;
}

[dir="rtl"] .page-link {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
    font-weight: 400;
}

[dir="rtl"] .breadcrumb-item {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
}

[dir="rtl"] .alert {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
}

[dir="rtl"] .table {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
}

[dir="rtl"] .table th {
    font-weight: 700;
}

[dir="rtl"] .list-group-item {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
}

/* Fix for Persian numbers - keep them readable */
[dir="rtl"] .text-number,
[dir="rtl"] [data-number],
[dir="rtl"] .badge-number,
[dir="rtl"] .statistic-number,
[dir="rtl"] .price-value,
[dir="rtl"] .quantity-value {
    font-family: 'Vazir', 'hkgrotesk', 'Courier New', monospace;
    direction: ltr;
    display: inline-block;
    unicode-bidi: embed;
}

/* Fix for mixed English/Persian text */
[dir="rtl"] .mixed-text {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
}

[dir="rtl"] .english-text {
    font-family: 'hkgrotesk', 'Vazir', sans-serif;
    direction: ltr;
    display: inline-block;
}

/* Fix for placeholder text */
[dir="rtl"] ::placeholder {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
    opacity: 0.7;
}

/* Fix for select options */
[dir="rtl"] select option {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
}

/* Fix for code/pre elements */
[dir="rtl"] code,
[dir="rtl"] pre {
    font-family: 'Courier New', monospace;
    direction: ltr;
    text-align: left;
}

/* Prescription specific font fixes */
[dir="rtl"] .prescription-container {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
}

[dir="rtl"] .medicine-name {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
    font-weight: 500;
}

[dir="rtl"] .patient-name {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
    font-weight: 700;
}

[dir="rtl"] .doctor-signature {
    font-family: 'Vazir', 'hkgrotesk', sans-serif;
    font-style: italic;
}