/**
 * ملف التصميم المخصص
 * Custom CSS File
 * نظام تتبع الشحنات - Shipment Tracking System
 */

/* إعدادات عامة */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400;1,700&display=swap');

/* استيراد متغيرات CSS */
@import url('variables.css');

body {
    font-family: var(--font-family);
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.6;
    font-weight: var(--font-weight-normal);
    font-size: var(--font-size-base);
}

/* تحسين الخطوط العربية */
.arabic-text {
    font-family: 'Cairo', 'Amiri', 'Arial', 'Tahoma', sans-serif;
}

/* خط تجوال جميل للعناوين */
.display-font {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* خط تجوال للعناوين الرئيسية */
.main-title {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 800;
    font-size: 2.5rem;
    line-height: 1.2;
    color: #2c3e50;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* خط تجوال للعناوين الفرعية */
.sub-title {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 600;
    font-size: 1.5rem;
    line-height: 1.3;
    color: #34495e;
}

/* خط تجوال للنصوص المهمة */
.important-text {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 500;
    font-size: 1.1rem;
    line-height: 1.5;
    color: #2c3e50;
}

/* تحسين الألوان - تم نقلها إلى variables.css */

/* تحسين البطاقات */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
    background-color: var(--bg-white);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* تحسين الأزرار */
.btn {
    border-radius: var(--border-radius-md);
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
    transition: all var(--transition-fast);
    padding: var(--spacing-sm) var(--spacing-md);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* تحسين الجداول */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background-color: var(--light-color);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* تحسين النماذج */
.form-control {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* تحسين التنبيهات */
.alert {
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
}

.alert-dismissible .btn-close {
    padding: 0.75rem 1rem;
}

/* تحسين الشارات */
.badge {
    font-size: 0.75em;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
}

/* تحسين الشريط الجانبي */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
}

.sidebar h1 {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 800;
    font-size: 3rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -1px;
}

.sidebar .lead {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 400;
    font-size: 1.2rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* تحسين القوائم */
.list-unstyled li {
    padding: 0.25rem 0;
}

.list-unstyled li i {
    margin-left: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
}

/* تحسين الإحصائيات */
.stats-card {
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.15s ease-in-out;
}

.stats-card:hover {
    transform: translateY(-2px);
}

/* تحسين الجدول الزمني */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 40px;
    width: 2px;
    height: 30px;
    background: #dee2e6;
}

.timeline-item.completed:not(:last-child)::after {
    background: var(--success-color);
}

.timeline-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 20px;
    background: #dee2e6;
    color: #6c757d;
    transition: all 0.15s ease-in-out;
}

.timeline-item.completed .timeline-marker {
    background: var(--success-color);
    color: white;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.2);
}

.timeline-content {
    flex: 1;
}

.timeline-content h6 {
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--dark-color);
}

/* تحسين النوافذ المنبثقة */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    border-radius: 0.75rem 0.75rem 0 0;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 0.75rem 0.75rem;
}

/* تحسين التنقل */
.navbar-brand {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.navbar-nav .nav-link {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    transition: color 0.15s ease-in-out;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* تحسين القوائم المنسدلة */
.dropdown-menu {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: background-color 0.15s ease-in-out;
}

.dropdown-item:hover {
    background-color: var(--light-color);
}

/* تحسين التذييل */
footer {
    margin-top: auto;
}

footer h5 {
    font-weight: 600;
    margin-bottom: 1rem;
}

footer p {
    opacity: 0.8;
}

/* تحسين الاستجابة */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .timeline-item {
        flex-direction: column;
        text-align: center;
    }
    
    .timeline-marker {
        margin: 0 auto 1rem;
    }
    
    .timeline-item:not(:last-child)::after {
        display: none;
    }
}

/* تحسين الطباعة */
@media print {
    .navbar,
    .btn,
    .modal,
    footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* تحسين التحميل */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* تحسين الأيقونات */
.fas, .far, .fab {
    transition: transform 0.15s ease-in-out;
}

.btn:hover .fas,
.btn:hover .far,
.btn:hover .fab {
    transform: scale(1.1);
}

/* تحسين الألوان المخصصة */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }

.text-success { color: var(--success-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.border-success { border-color: var(--success-color) !important; }

.text-warning { color: var(--warning-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.border-warning { border-color: var(--warning-color) !important; }

.text-danger { color: var(--danger-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.border-danger { border-color: var(--danger-color) !important; }

.text-info { color: var(--info-color) !important; }
.bg-info { background-color: var(--info-color) !important; }
.border-info { border-color: var(--info-color) !important; }

/* تحسين الظلال */
.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important; }
.shadow { box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; }
.shadow-lg { box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important; }

/* تحسين الحدود */
.rounded { border-radius: 0.375rem !important; }
.rounded-lg { border-radius: 0.5rem !important; }
.rounded-xl { border-radius: 0.75rem !important; }

/* تحسين المسافات */
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

.m-1 { margin: 0.25rem !important; }
.m-2 { margin: 0.5rem !important; }
.m-3 { margin: 1rem !important; }
.m-4 { margin: 1.5rem !important; }
.m-5 { margin: 3rem !important; }

/* تحسينات إضافية للخطوط */
.card-title {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: #2c3e50;
}

.card-text {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 400;
    line-height: 1.6;
    color: #5a6c7d;
}

.btn {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.form-label {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 500;
    color: #2c3e50;
}

.form-control {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 400;
}

.table th {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 600;
    color: #2c3e50;
}

.table td {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 400;
    color: #5a6c7d;
}

.alert {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 400;
}

.badge {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 500;
}

/* تحسينات للعناوين */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 2rem; font-weight: 700; }
h3 { font-size: 1.75rem; font-weight: 600; }
h4 { font-size: 1.5rem; font-weight: 600; }
h5 { font-size: 1.25rem; font-weight: 600; }
h6 { font-size: 1rem; font-weight: 600; }

/* تحسينات للعناوين في البطاقات */
.card-header h5 {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

/* تحسينات للعناوين في النماذج */
.modal-title {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 600;
    color: #2c3e50;
}

/* تحسينات للعناوين في الجداول */
.table-responsive h5 {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* تحسينات للعناوين في التذييل */
footer h5 {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 600;
    color: #2c3e50;
}

/* تحسينات للعناوين في الشريط الجانبي */
.sidebar h2 {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* تحسينات للعناوين في الإحصائيات */
.stats-card h3 {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.stats-card p {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 400;
    color: #5a6c7d;
    margin-bottom: 0;
}

/* تحسينات للعناوين في الجدول الزمني */
.timeline-content h6 {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.timeline-content p {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 400;
    color: #5a6c7d;
    margin-bottom: 0;
}

/* تحسينات للعناوين في التنبيهات */
.alert h4 {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 600;
    color: inherit;
    margin-bottom: 0.5rem;
}

.alert p {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 400;
    margin-bottom: 0;
}

/* تحسينات للعناوين في القوائم */
.list-group-item h6 {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.list-group-item p {
    font-family: 'Cairo', 'Amiri', serif;
    font-weight: 400;
    color: #5a6c7d;
    margin-bottom: 0;
}
