/* تخصيصات إضافية للوحة التحكم */

/* تحسين الخطوط العربية - خط Zain */
body {
    font-family: 'Zain', sans-serif;
    line-height: 1.6;
}

/* كلاسات خط Zain */
.zain-extralight {
    font-family: "Zain", sans-serif;
    font-weight: 200;
    font-style: normal;
}

.zain-light {
    font-family: "Zain", sans-serif;
    font-weight: 300;
    font-style: normal;
}

.zain-regular {
    font-family: "Zain", sans-serif;
    font-weight: 400;
    font-style: normal;
}

.zain-bold {
    font-family: "Zain", sans-serif;
    font-weight: 700;
    font-style: normal;
}

.zain-extrabold {
    font-family: "Zain", sans-serif;
    font-weight: 800;
    font-style: normal;
}

.zain-black {
    font-family: "Zain", sans-serif;
    font-weight: 900;
    font-style: normal;
}

.zain-light-italic {
    font-family: "Zain", sans-serif;
    font-weight: 300;
    font-style: italic;
}

.zain-regular-italic {
    font-family: "Zain", sans-serif;
    font-weight: 400;
    font-style: italic;
}

/* تحسين التمرير */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* تأثيرات الانتقال */
.transition-all {
    transition: all 0.3s ease;
}

/* تحسين البطاقات */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* تحسين الأزرار */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

/* تحسين الجداول */
.table-hover tbody tr:hover {
    background-color: #f8fafc;
    transform: scale(1.01);
    transition: all 0.2s ease;
}

/* تحسين الشريط الجانبي */
.sidebar-item {
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s ease;
}

.sidebar-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    transition: width 0.3s ease;
    z-index: -1;
}

.sidebar-item:hover::before {
    width: 100%;
}

.sidebar-item:hover {
    color: white !important;
    transform: translateX(-5px);
    text-decoration: none;
}

.sidebar-item:hover i,
.sidebar-item:hover span {
    color: white !important;
}

/* التأكد من أن النص يظهر باللون الأبيض عند hover */
.sidebar-item:hover * {
    color: white !important;
}

/* تحسين الأيقونات في الشريط الجانبي */
.sidebar-item i {
    transition: all 0.3s ease;
}

.sidebar-item:hover i {
    transform: scale(1.1);
}

/* تحسين الإحصائيات */
.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.1);
}

/* تحسين شريط التقدم */
.progress-bar {
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* تحسين الأيقونات */
.icon-wrapper {
    transition: all 0.3s ease;
}

.icon-wrapper:hover {
    transform: scale(1.1) rotate(5deg);
}

/* تحسين النوافذ المنبثقة */
.modal-backdrop {
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.3);
}

/* تحسين النماذج */
.form-input {
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
}

.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: scale(1.02);
}

/* تحسين الحالات */
.status-delivered {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}

.status-in-transit {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.3);
}

.status-pending {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
}

/* تحسين الاستجابة */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
    }
}

/* تحسينات إضافية للشريط الجانبي */
.sidebar {
    transition: transform 0.3s ease-in-out;
}

.sidebar.translate-x-0 {
    transform: translateX(0);
}

.sidebar.translate-x-full {
    transform: translateX(100%);
}

/* تحسين زر الهمبرغر */
#sidebar-toggle {
    cursor: pointer;
    transition: all 0.3s ease;
}

#sidebar-toggle:hover {
    background-color: #f3f4f6;
    transform: scale(1.05);
}

#sidebar-toggle:active {
    transform: scale(0.95);
}

/* تحسين زر الإغلاق */
#sidebar-close {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

#sidebar-close:hover {
    background-color: #f3f4f6;
    transform: scale(1.05);
    color: #ef4444;
}

#sidebar-close:active {
    transform: scale(0.95);
}

#sidebar-close:hover i {
    color: #ef4444;
    transform: rotate(90deg);
}

/* تأثيرات إضافية لزر الإغلاق */
#sidebar-close i {
    transition: all 0.3s ease;
}

#sidebar-close:hover i {
    animation: rotateClose 0.3s ease;
}

@keyframes rotateClose {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(90deg);
    }
}

/* تحسين أزرار القوائم المنسدلة */
#notifications-btn, #profile-btn {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

#notifications-btn:hover, #profile-btn:hover {
    background-color: #f3f4f6;
    transform: scale(1.05);
}

#notifications-btn:active, #profile-btn:active {
    transform: scale(0.95);
}

/* تحسين القوائم المنسدلة */
#notifications-dropdown, #profile-dropdown {
    transition: all 0.3s ease;
    transform-origin: top;
}

#notifications-dropdown.hidden, #profile-dropdown.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

#notifications-dropdown:not(.hidden), #profile-dropdown:not(.hidden) {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* تأثيرات إضافية للقوائم */
#notifications-dropdown {
    animation: slideDown 0.3s ease-out;
}

#profile-dropdown {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تحسين عناصر القوائم */
#notifications-dropdown .hover\\:bg-gray-50:hover,
#profile-dropdown .hover\\:bg-gray-50:hover {
    background-color: #f8fafc;
    transform: translateX(-2px);
    transition: all 0.2s ease;
}

/* تحسينات الموبايل */
@media (max-width: 768px) {
    .mobile-optimized {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .mobile-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .mobile-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .mobile-table {
        font-size: 0.75rem;
    }
    
    .mobile-hidden {
        display: none !important;
    }
}

/* تحسينات للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .xs-mobile-optimized {
        font-size: 12px;
        padding: 0.5rem;
    }
    
    .xs-mobile-button {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .xs-mobile-text {
        font-size: 0.75rem;
    }
}

/* تحسين الطباعة */
@media print {
    .sidebar,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-right: 0 !important;
    }
}

/* تحسين الوضع المظلم */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        background-color: #1a202c;
        color: #e2e8f0;
    }
    
    .dark-mode .card {
        background-color: #2d3748;
        border-color: #4a5568;
    }
}

/* تحسين الأداء */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* تحسين إمكانية الوصول */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* تحسينات إدارة المستخدمين */
.search-highlight {
    background-color: #fef3c7 !important;
    animation: highlight 0.5s ease-in-out;
}

@keyframes highlight {
    0% { background-color: #fbbf24; }
    100% { background-color: #fef3c7; }
}

/* تحسين النوافذ المنبثقة */
.modal-animation {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* تحسين الجداول */
.table-row-hover {
    transition: all 0.2s ease;
}

.table-row-hover:hover {
    background-color: #f8fafc;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* تحسين الأزرار */
.btn-action {
    transition: all 0.2s ease;
    border-radius: 6px;
    padding: 8px 12px;
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-action:active {
    transform: translateY(0);
}

/* تحسين البطاقات الإحصائية */
.stat-card-enhanced {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card-enhanced:hover::before {
    transform: scaleX(1);
}

.stat-card-enhanced:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

/* تحسين النماذج */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input-enhanced {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background-color: #ffffff;
}

.form-input-enhanced:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: scale(1.02);
}

.form-input-enhanced:invalid {
    border-color: #ef4444;
}

.form-input-enhanced:valid {
    border-color: #10b981;
}

/* تحسين الأيقونات */
.icon-enhanced {
    transition: all 0.3s ease;
}

.icon-enhanced:hover {
    transform: scale(1.1) rotate(5deg);
}

/* تحسين الحالات */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.status-badge:hover {
    transform: scale(1.05);
}

.status-active {
    background-color: #dcfce7;
    color: #166534;
}

.status-inactive {
    background-color: #fef2f2;
    color: #991b1b;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

/* تحسين الأدوار */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.role-admin {
    background-color: #ede9fe;
    color: #6b21a8;
}

.role-employee {
    background-color: #dbeafe;
    color: #1e40af;
}

.role-driver {
    background-color: #dcfce7;
    color: #166534;
}

.role-reception {
    background-color: #fef3c7;
    color: #92400e;
}

/* تحسين الاستجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .mobile-stack {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .mobile-full-width {
        width: 100%;
    }
    
    .mobile-text-center {
        text-align: center;
    }
    
    .mobile-hidden {
        display: none !important;
    }
}

/* تحسين الطباعة */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-friendly {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
}

/* تحسين التركيز */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* تحسين الحركة */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* تحسين التحميل */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

