/* ========================================
   نظام الخطوط والألوان الموحد
   Unified Typography & Color System
   ======================================== */

/* ===== استيراد الخطوط ===== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== متغيرات الخطوط الأساسية ===== */
:root {
    /* أنواع الخطوط - Font Families */
    --font-primary: 'Cairo', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-secondary: 'Inter', 'Cairo', system-ui, sans-serif;
    --font-mono: 'Fira Code', 'Monaco', 'Consolas', monospace;
    
    /* أحجام الخطوط - Font Sizes */
    --font-size-xs: 0.75rem;      /* 12px - نصوص صغيرة جداً */
    --font-size-sm: 0.875rem;     /* 14px - نصوص صغيرة */
    --font-size-base: 1rem;       /* 16px - النص الأساسي */
    --font-size-lg: 1.125rem;     /* 18px - نصوص كبيرة */
    --font-size-xl: 1.25rem;      /* 20px - عناوين صغيرة */
    --font-size-2xl: 1.5rem;      /* 24px - عناوين متوسطة */
    --font-size-3xl: 1.875rem;    /* 30px - عناوين كبيرة */
    --font-size-4xl: 2.25rem;     /* 36px - عناوين رئيسية */
    --font-size-5xl: 3rem;        /* 48px - عناوين ضخمة */
    
    /* أوزان الخطوط - Font Weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    
    /* ارتفاع السطر - Line Heights */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    --line-height-loose: 2;
    
    /* ألوان النصوص - Text Colors */
    --text-primary: #111827;      /* نص أساسي - أسود داكن */
    --text-secondary: #6b7280;    /* نص ثانوي - رمادي متوسط */
    --text-muted: #9ca3af;        /* نص خفيف - رمادي فاتح */
    --text-white: #ffffff;        /* نص أبيض */
    --text-accent: #1e3c72;       /* نص مميز - أزرق احترافي غامق */
    --text-success: #059669;      /* نص نجاح - أخضر */
    --text-danger: #dc2626;       /* نص خطر - أحمر */
    --text-warning: #d97706;      /* نص تحذير - برتقالي */
    --text-info: #0891b2;         /* نص معلومات - أزرق فاتح */
    
    /* ألوان الروابط - Link Colors */
    --link-color: #1e3c72;        /* لون الرابط الأساسي */
    --link-hover: #2a5298;        /* لون الرابط عند hover */
    --link-visited: #360033;      /* لون الرابط المزور */
}

/* ===== إعدادات أساسية ===== */
html {
    font-size: 16px; /* Base font size */
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ===== العناوين - Headings ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
    margin-bottom: 1rem;
}

h1 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-extrabold);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-base);
}

/* ===== الفقرات والنصوص ===== */
p {
    margin-bottom: 1rem;
    line-height: var(--line-height-normal);
}

.lead {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-normal);
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
}

/* ===== Classes للعناوين الموحدة ===== */
.heading-primary {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-extrabold);
    color: var(--text-primary);
    line-height: var(--line-height-tight);
}

.heading-secondary {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    line-height: var(--line-height-tight);
}

.heading-card {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: inherit;
    line-height: var(--line-height-tight);
    margin-bottom: 0;
}

.heading-gradient {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: var(--font-weight-extrabold);
}

/* ===== Classes للنصوص الموحدة ===== */
.text-base {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    color: var(--text-primary);
}

.text-small {
    font-size: var(--font-size-sm);
}

.text-large {
    font-size: var(--font-size-lg);
}

.text-xl {
    font-size: var(--font-size-xl);
}

/* ===== ألوان النصوص ===== */
.text-primary-color {
    color: var(--text-primary) !important;
}

.text-secondary-color {
    color: var(--text-secondary) !important;
}

.text-muted-color {
    color: var(--text-muted) !important;
}

.text-accent-color {
    color: var(--text-accent) !important;
}

.text-success-color {
    color: var(--text-success) !important;
}

.text-danger-color {
    color: var(--text-danger) !important;
}

.text-warning-color {
    color: var(--text-warning) !important;
}

.text-info-color {
    color: var(--text-info) !important;
}

.text-white-color {
    color: var(--text-white) !important;
}

/* ===== أوزان الخطوط ===== */
.font-light {
    font-weight: var(--font-weight-light) !important;
}

.font-normal {
    font-weight: var(--font-weight-normal) !important;
}

.font-medium {
    font-weight: var(--font-weight-medium) !important;
}

.font-semibold {
    font-weight: var(--font-weight-semibold) !important;
}

.font-bold {
    font-weight: var(--font-weight-bold) !important;
}

.font-extrabold {
    font-weight: var(--font-weight-extrabold) !important;
}

/* ===== الروابط ===== */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

a:visited {
    color: var(--link-visited);
}

/* ===== Strong و Emphasis ===== */
strong, b {
    font-weight: var(--font-weight-bold);
}

em, i {
    font-style: italic;
}

/* ===== Code و Pre ===== */
code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
}

pre {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
    background-color: rgba(0, 0, 0, 0.05);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

/* ===== Lists ===== */
ul, ol {
    margin-bottom: 1rem;
    padding-right: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* ===== Blockquote ===== */
blockquote {
    font-size: var(--font-size-lg);
    font-style: italic;
    color: var(--text-secondary);
    border-right: 4px solid var(--text-accent);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
}

/* ===== Small Text ===== */
small {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* ===== Mark / Highlight ===== */
mark {
    background-color: #fef3c7;
    color: var(--text-primary);
    padding: 0.1em 0.3em;
    border-radius: 0.25rem;
}

/* ===== Classes خاصة بالبطاقات ===== */
.card-title-unified {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: 0;
    color: inherit;
}

.card-subtitle-unified {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: inherit;
    opacity: 0.9;
}

.card-text-unified {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    color: inherit;
    line-height: var(--line-height-relaxed);
}

/* ===== Classes خاصة بالأزرار ===== */
.btn-text-bold {
    font-weight: var(--font-weight-bold) !important;
}

.btn-text-extrabold {
    font-weight: var(--font-weight-extrabold) !important;
}

/* ===== Classes خاصة بالجداول ===== */
.table-header-text {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-white);
}

.table-cell-text {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
    color: var(--text-primary);
}

/* ===== Classes خاصة بالنماذج ===== */
.form-label-unified {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-input-unified {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    color: var(--text-primary);
}

/* ===== Classes للإحصائيات ===== */
.stats-number-unified {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-extrabold);
    color: inherit;
    line-height: var(--line-height-tight);
    margin: 0;
}

.stats-label-unified {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: inherit;
    opacity: 0.95;
}

/* ===== Utility Classes ===== */
.text-center {
    text-align: center !important;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

.text-uppercase {
    text-transform: uppercase !important;
}

.text-lowercase {
    text-transform: lowercase !important;
}

.text-capitalize {
    text-transform: capitalize !important;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Responsive Typography ===== */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .heading-primary {
        font-size: var(--font-size-3xl);
    }
    
    .heading-secondary {
        font-size: var(--font-size-2xl);
    }
    
    .stats-number-unified {
        font-size: var(--font-size-3xl);
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
    
    .heading-primary {
        font-size: var(--font-size-2xl);
    }
    
    .heading-secondary {
        font-size: var(--font-size-xl);
    }
}

/* ===== Print Styles ===== */
@media print {
    body {
        font-family: var(--font-primary);
        font-size: 12pt;
        color: #000;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #000;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
}