/* ملف الخطوط المخصصة للتطبيق */

/* استيراد خط Cairo من Google Fonts - خط عربي أنيق */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700;800;900&display=swap');

/* استيراد خط Tajawal من Google Fonts - خط عربي واضح */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@200;300;400;500;700;800;900&display=swap');

/* استيراد خط IBM Plex Sans Arabic - خط احترافي */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@100;200;300;400;500;600;700&display=swap');

/* استيراد خط Amiri للنصوص الكلاسيكية */
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* استيراد خط Noto Sans Arabic */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* تعريف الخطوط الأساسية */
:root {
    --font-primary: 'Cairo', 'Noto Sans Arabic', 'Tajawal', 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-secondary: 'Tajawal', 'Cairo', 'Noto Sans Arabic', 'IBM Plex Sans Arabic', sans-serif;
    --font-classic: 'Amiri', 'Times New Roman', serif;
    --font-mono: 'Courier New', Consolas, monospace;
    --font-icons: 'Font Awesome 6 Free', 'Font Awesome 6 Pro', 'FontAwesome', sans-serif;
}

/* تطبيق الخط على كامل الصفحة */
body {
    font-family: var(--font-primary) !important;
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* تحسين عرض النصوص العربية */
* {
    font-family: var(--font-primary) !important;
}

/* خطوط العناوين */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary) !important;
    font-weight: 600;
    line-height: 1.4;
}

h1 { font-weight: 700; }
h2 { font-weight: 600; }
h3 { font-weight: 600; }
h4 { font-weight: 500; }
h5 { font-weight: 500; }
h6 { font-weight: 400; }

/* خطوط الأزرار */
.btn {
    font-family: var(--font-primary) !important;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* خطوط النماذج */
.form-control, .form-select, .form-label {
    font-family: var(--font-primary) !important;
}

/* خطوط الجداول */
.table {
    font-family: var(--font-primary) !important;
}

.table th {
    font-weight: 600;
}

.table td {
    font-weight: 400;
}

/* خطوط شريط التنقل */
.navbar {
    font-family: var(--font-primary) !important;
}

.navbar-brand {
    font-weight: 700 !important;
    font-size: 1.3rem;
}

/* خطوط البطاقات */
.card-title {
    font-weight: 600;
    font-family: var(--font-primary) !important;
}

.card-text {
    font-family: var(--font-primary) !important;
}

/* خطوط التنبيهات */
.alert {
    font-family: var(--font-primary) !important;
    font-weight: 400;
}

/* خطوط الشارات */
.badge {
    font-family: var(--font-primary) !important;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* تحسين عرض الأرقام العربية */
.number-ar {
    font-family: var(--font-primary) !important;
    direction: ltr;
    unicode-bidi: embed;
}

/* خطوط خاصة للملاحظات والنصوص الطويلة */
.notes-text {
    font-family: var(--font-secondary) !important;
    line-height: 1.7;
    font-weight: 400;
}

/* تحسين عرض النصوص في الشاشات الصغيرة */
@media (max-width: 768px) {
    body {
        font-size: 0.95rem;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.4rem; }
    h4 { font-size: 1.2rem; }
    h5 { font-size: 1.1rem; }
    
    .btn {
        font-size: 0.9rem;
    }
}

/* تحسين عرض النصوص للطباعة */
@media print {
    * {
        font-family: var(--font-primary) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        font-weight: 600;
        page-break-after: avoid;
    }
}

/* أنماط إضافية للنصوص العربية */
.arabic-text {
    font-family: var(--font-primary) !important;
    text-align: right;
    direction: rtl;
}

.english-text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: left;
    direction: ltr;
}

/* تحسين عرض أرقام السيارات */
.matricule {
    font-family: var(--font-mono) !important;
    font-weight: 600;
    letter-spacing: 1px;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* تحسين عرض المبالغ المالية */
.currency {
    font-family: var(--font-primary) !important;
    font-weight: 600;
    font-size: 1.1em;
}

/* خط خاص للعناوين الرئيسية */
.main-title {
    font-family: var(--font-primary) !important;
    font-weight: 800;
    font-size: 2.2rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* تحسينات إضافية للخطوط العربية */

/* تحسين المسافات بين الكلمات */
.text-spacing {
    letter-spacing: 0.02em;
    word-spacing: 0.05em;
}

/* تحسين النصوص الكلاسيكية */
.arabic-classic {
    font-family: var(--font-classic) !important;
    font-weight: 400;
    line-height: 1.8;
}

/* تحسين الأيقونات */
.fa, .fas, .far, .fab, .fal, .fad {
    font-family: var(--font-icons) !important;
}

/* تحسين عرض الأرقام */
.number-display {
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: "lnum" 1, "tnum" 1;
}

/* تحسين الخط في الجداول */
.table-enhanced {
    font-family: var(--font-primary) !important;
}

.table-enhanced th {
    font-weight: 700;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.table-enhanced td {
    font-weight: 500;
}

/* تحسين النصوص في البطاقات */
.card-enhanced .card-title {
    font-family: var(--font-secondary) !important;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.card-enhanced .card-text {
    font-family: var(--font-primary) !important;
    font-weight: 400;
    line-height: 1.7;
}

/* تحسين النصوص في النماذج */
.form-enhanced label {
    font-family: var(--font-primary) !important;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-enhanced .form-control,
.form-enhanced .form-select {
    font-family: var(--font-primary) !important;
    font-weight: 500;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

.form-enhanced .form-control:focus,
.form-enhanced .form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* تحسين النصوص في الإشعارات */
.alert-enhanced {
    font-family: var(--font-primary) !important;
    font-weight: 500;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* تحسين النصوص في الأزرار */
.btn-enhanced {
    font-family: var(--font-primary) !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
}

/* تحسين الخط للشاشات الصغيرة */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        line-height: 1.5;
    }
    
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.4rem; }
    h4 { font-size: 1.2rem; }
    h5 { font-size: 1.1rem; }
    h6 { font-size: 1rem; }
    
    .main-title {
        font-size: 1.8rem;
    }
}

/* تحسين الطباعة */
@media print {
    * {
        font-family: var(--font-primary) !important;
        color: #000 !important;
        background: transparent !important;
    }
}

/* خط خاص للعناوين الفرعية */
.sub-title {
    font-family: var(--font-secondary) !important;
    font-weight: 500;
    color: #6c757d;
}
