/* assets/css/style.css */
/* تصميم مخصص ومحترف لنظام الإجازات المرضية */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #1e3a8a;       /* أزرق داكن */
    --primary-light: #eff6ff;
    --secondary-color: #0d9488;     /* تركواز / أخضر طبي هادئ */
    --secondary-light: #f0fdf4;
    --accent-color: #f59e0b;        /* برتقالي للتنبيهات */
    --text-dark: #1e293b;           /* رمادي غامق للنصوص */
    --text-muted: #64748b;          /* رمادي باهت */
    --bg-light: #f8fafc;            /* خلفية هادئة */
    --border-color: #e2e8f0;
    --sidebar-width: 260px;
    --transition-speed: 0.3s;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-size: 0.95rem;
    overflow-x: hidden;
}

/* التنسيق للاتجاهين (RTL بشكل أساسي ودعم LTR) */
[dir="rtl"] {
    text-align: right;
}
[dir="ltr"] {
    text-align: left;
}

/* هيكلية لوحة التحكم والـ Sidebar */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    min-height: 100vh;
}

#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--primary-color);
    color: #fff;
    transition: all var(--transition-speed) ease;
    z-index: 999;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#sidebar ul.components {
    padding: 15px 0;
}

#sidebar ul li {
    padding: 2px 15px;
}

#sidebar ul li a {
    padding: 12px 15px;
    font-size: 0.95rem;
    display: block;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 5px;
}

#sidebar ul li a:hover, #sidebar ul li.active > a {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

#sidebar ul li a i {
    margin-left: 10px;
    margin-right: 5px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

[dir="ltr"] #sidebar ul li a i {
    margin-right: 10px;
    margin-left: 5px;
}

#content {
    width: 100%;
    padding: 25px;
    min-height: 100vh;
    transition: all var(--transition-speed);
}

/* بطاقات الإحصائيات */
.stat-card {
    background: #fff;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* بطاقات ونماذج */
.card-custom {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-custom .card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 18px 24px;
    font-weight: 600;
}

/* جداول مخصصة */
.table-custom {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

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

.table-custom td {
    padding: 12px 16px;
    vertical-align: middle;
}

/* التبديل بين اللغات في النماذج */
.bilingual-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-weight: 500;
}

.bilingual-label span.lang-en {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'Cairo', sans-serif;
}

/* صفحات الدخول */
.login-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #0d9488 100%);
    padding: 15px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 450px;
    padding: 35px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* شارات الحالة */
.badge-active {
    background-color: var(--secondary-light);
    color: var(--secondary-color);
    border: 1px solid rgba(13, 148, 136, 0.2);
}

.badge-cancelled {
    background-color: #fef2f2;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* تنسيقات التقارير والطباعة */
.report-paper {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    max-width: 800px;
    margin: 30px auto;
    padding: 40px;
    position: relative;
}

.report-header-section {
    border-bottom: 3px double var(--primary-color);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.report-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin: 15px 0;
    letter-spacing: 0.5px;
}

.report-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 20px 0;
}

.table-report-info {
    width: 100%;
    margin-bottom: 20px;
}

.table-report-info td {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.table-report-info td.label-cell {
    background-color: var(--bg-light);
    font-weight: 600;
    width: 25%;
}

.table-report-info td.label-cell-en {
    background-color: var(--bg-light);
    font-weight: 600;
    width: 25%;
    font-family: 'Cairo', sans-serif;
    text-align: left;
}

.qr-code-box {
    text-align: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-light);
}

.qr-code-box img {
    max-width: 140px;
}

/* تنسيق ورقة A4 للطباعة */
@media print {
    body {
        background-color: #fff;
        color: #000;
        font-size: 11pt;
    }
    
    .no-print, 
    #sidebar, 
    .navbar, 
    .btn, 
    .alert,
    #content-header {
        display: none !important;
    }
    
    #content {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }
    
    .report-paper {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    /* التأكد من طباعة الخلفيات والألوان بشكل صحيح */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .table-report-info td.label-cell, 
    .table-report-info td.label-cell-en {
        background-color: #f1f5f9 !important;
    }
}

/* استجابة الشاشات الصغيرة */
@media (max-width: 768px) {
    .wrapper {
        flex-direction: column;
    }
    
    #sidebar {
        min-width: 100%;
        max-width: 100%;
        min-height: auto;
    }
    
    #sidebar .sidebar-header {
        text-align: center;
    }
    
    #sidebar ul.components {
        display: flex;
        flex-wrap: wrap;
        padding: 10px;
        justify-content: center;
    }
    
    #sidebar ul li {
        padding: 2px 5px;
    }
    
    #sidebar ul li a {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    #content {
        padding: 15px;
    }
}
