/* IRANSans Font - Local Files - استفاده از فونت‌های موجود */

/* IRANSans Regular */
@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSans-Edit.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE80-FEFC;
}

/* IRANSans Bold */
@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansBold-Edit.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE80-FEFC;
}

/* تعریف Font Stack با IRANSans */
:root {
    --iransans-font-stack: 'IRANSans', 'Tahoma', 'Arial Unicode MS', 'Microsoft Sans Serif', 'Arial', sans-serif;
}

/* اعمال فونت IRANSans به همه عناصر */
* {
    font-family: var(--iransans-font-stack) !important;
}

/* عناصر اصلی */
body, html {
    font-family: var(--iransans-font-stack) !important;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 400;
    direction: rtl;
    text-align: right;
}

/* عناصر فرم */
input, textarea, select, button,
.form-control, .form-select, .btn {
    font-family: var(--iransans-font-stack) !important;
    direction: rtl;
    text-align: right;
}

/* کامپوننت‌های Bootstrap */
.navbar, .nav-link, .dropdown-menu, .dropdown-item,
.card, .card-body, .card-title, .card-text,
.modal, .modal-header, .modal-body, .modal-footer,
.alert, .badge, .breadcrumb,
table, th, td, .table,
.sidebar, .sidebar .nav-link, .user-info {
    font-family: var(--iransans-font-stack) !important;
}

/* عناوین */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--iransans-font-stack) !important;
    font-weight: 700;
    line-height: 1.4;
}

h1 { 
    font-size: 2.5rem; 
    font-weight: 700; 
}

h2 { 
    font-size: 2rem; 
    font-weight: 700; 
}

h3 { 
    font-size: 1.75rem; 
    font-weight: 700; 
}

h4 { 
    font-size: 1.5rem; 
    font-weight: 400; 
}

h5 { 
    font-size: 1.25rem; 
    font-weight: 400; 
}

h6 { 
    font-size: 1rem; 
    font-weight: 400; 
}

/* بهبود رندر فونت */
body, * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'kern' 1;
}

/* تنظیمات خاص متن فارسی */
[lang='fa'], [dir='rtl'], .persian-text {
    font-family: var(--iransans-font-stack) !important;
    direction: rtl;
    text-align: right;
    font-feature-settings: 'kern' 1, 'liga' 1;
}

/* تنظیمات responsive */
@media (max-width: 1200px) {
    body { font-size: 14px; }
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.875rem; }
}

@media (max-width: 768px) {
    body { font-size: 13px; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

@media (max-width: 576px) {
    body { font-size: 12px; }
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* تنظیمات چاپ */
@media print {
    * {
        font-family: var(--iransans-font-stack) !important;
        color: black !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* کلاس‌های وزن فونت */
.font-regular { font-weight: 400; }
.font-bold { font-weight: 700; }

/* تنظیمات خاص برای عناصر مختلف */
.btn {
    font-weight: 400;
    font-size: 0.875rem;
}

.btn-primary, .btn-success, .btn-danger, .btn-warning {
    font-weight: 700;
}

.card-title {
    font-weight: 700;
    font-size: 1.125rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

.badge {
    font-size: 0.75rem;
    font-weight: 400;
}

.small, small {
    font-size: 0.875em;
    font-weight: 400;
}

/* تنظیمات خاص برای جداول */
.table {
    font-size: 0.875rem;
}

.table th {
    font-weight: 700;
}

.table td {
    font-weight: 400;
}

/* تنظیمات خاص برای فرم‌ها */
.form-label {
    font-weight: 400;
    font-size: 0.875rem;
}

.form-control, .form-select {
    font-size: 0.875rem;
    font-weight: 400;
}

/* تنظیمات خاص برای sidebar */
.sidebar .nav-link {
    font-size: 0.875rem;
    font-weight: 400;
}

.user-info h6 {
    font-weight: 700;
}

/* بهبود خوانایی برای متن‌های طولانی */
p, .text-content {
    line-height: 1.7;
    font-weight: 400;
}

/* تنظیمات خاص برای لیست‌ها */
ul, ol {
    line-height: 1.6;
    font-weight: 400;
}

li {
    margin-bottom: 0.25rem;
}

/* تنظیمات خاص برای لینک‌ها */
a {
    text-decoration: none;
    font-weight: 400;
}

a:hover {
    text-decoration: underline;
}

/* اطمینان از RTL */
.rtl, [dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.ltr, [dir="ltr"] {
    direction: ltr;
    text-align: left;
}

/* تنظیمات خاص برای اعداد فارسی */
.persian-numbers {
    font-feature-settings: 'tnum' 1;
}

/* بهبود نمایش در حالت تاریک */
@media (prefers-color-scheme: dark) {
    body, * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* تنظیمات خاص برای alert ها */
.alert {
    font-weight: 400;
}

.alert-heading {
    font-weight: 700;
}

/* تنظیمات خاص برای breadcrumb */
.breadcrumb {
    font-size: 0.875rem;
    font-weight: 400;
}

/* تنظیمات خاص برای dropdown */
.dropdown-item {
    font-size: 0.875rem;
    font-weight: 400;
}

/* تنظیمات خاص برای modal */
.modal-title {
    font-weight: 700;
}

.modal-body {
    font-weight: 400;
}

/* اطمینان از بارگذاری صحیح فونت */
.font-loaded {
    font-family: var(--iransans-font-stack) !important;
}