/**
 * AUTO TESTER - المصرية لفحص السيارات
 * الملف: dark.css
 * الوصف: تنسيقات الوضع الليلي المتكامل (Dark Mode)
 * الإصدار: 2.0
 */

/* ========================================
   المتغيرات الخاصة بالوضع الليلي
   ======================================== */
[data-theme="dark"] {
    /* الألوان الأساسية - نسخة داكنة */
    --primary: #004481;
    --primary-dark: #003366;
    --primary-light: #0a5c9e;
    --secondary: #ffd700;
    --secondary-dark: #e6c200;
    --secondary-light: #fff9e6;
    
    /* ألوان الحالات - معدلة للوضع الليلي */
    --success: #2ecc71;
    --success-light: #1e3a2a;
    --success-dark: #27ae60;
    
    --danger: #e74c3c;
    --danger-light: #3a1e1e;
    --danger-dark: #c0392b;
    
    --warning: #f39c12;
    --warning-light: #3a2e1e;
    --warning-dark: #e67e22;
    
    --info: #3498db;
    --info-light: #1e2e3a;
    --info-dark: #2980b9;
    
    /* ألوان النص - فاتحة للوضع الليلي */
    --text-dark: #ecf0f1;
    --text-gray: #bdc3c7;
    --text-light: #95a5a6;
    --text-white: #ffffff;
    --text-black: #2c3e50;
    
    /* ألوان الخلفية - داكنة */
    --bg-light: #1a1a2e;
    --bg-white: #16213e;
    --bg-dark: #0f0f1f;
    --bg-gray: #2a2a3a;
    --bg-primary-light: rgba(0, 68, 129, 0.2);
    --bg-secondary-light: rgba(255, 215, 0, 0.2);
    
    /* الحدود */
    --border-color: #2a2a3a;
    --border-color-dark: #3a3a4a;
    --border-color-light: #1a1a2a;
    
    /* الظلال */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 40px -5px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-primary: 0 5px 20px rgba(0, 68, 129, 0.5);
    --shadow-secondary: 0 5px 20px rgba(255, 215, 0, 0.3);
}

/* ========================================
   الخلفيات الأساسية
   ======================================== */
[data-theme="dark"] body {
    background: var(--bg-dark);
    color: var(--text-dark);
}

[data-theme="dark"] .navbar {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

[data-theme="dark"] .footer {
    background: var(--primary-dark);
    border-top: 1px solid var(--border-color);
}

/* ========================================
   البطاقات والحاويات
   ======================================== */
[data-theme="dark"] .card,
[data-theme="dark"] .table-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .filters-card,
[data-theme="dark"] .request-form,
[data-theme="dark"] .search-box,
[data-theme="dark"] .profile-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .inspector-card,
[data-theme="dark"] .service-card,
[data-theme="dark"] .request-card,
[data-theme="dark"] .vehicle-item,
[data-theme="dark"] .notification-item {
    background: var(--bg-white);
    border-color: var(--border-color);
}

[data-theme="dark"] .card:hover,
[data-theme="dark"] .stat-card:hover,
[data-theme="dark"] .inspector-card:hover {
    border-color: var(--secondary);
    box-shadow: var(--shadow-secondary);
}

[data-theme="dark"] .card-header,
[data-theme="dark"] .card-footer {
    border-color: var(--border-color);
}

/* ========================================
   النصوص والعناوين
   ======================================== */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-white);
}

[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div,
[data-theme="dark"] li,
[data-theme="dark"] td {
    color: var(--text-dark);
}

[data-theme="dark"] .text-muted {
    color: var(--text-gray) !important;
}

[data-theme="dark"] .text-primary {
    color: var(--primary-light) !important;
}

[data-theme="dark"] .text-secondary {
    color: var(--secondary) !important;
}

/* ========================================
   الروابط
   ======================================== */
[data-theme="dark"] a {
    color: var(--secondary);
    transition: var(--transition);
}

[data-theme="dark"] a:hover {
    color: var(--secondary-dark);
}

[data-theme="dark"] .nav-links a {
    color: var(--text-white);
}

[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a.active {
    background: rgba(255, 215, 0, 0.2);
    color: var(--secondary);
}

[data-theme="dark"] .footer-links a {
    color: var(--text-gray);
}

[data-theme="dark"] .footer-links a:hover {
    color: var(--secondary);
}

/* ========================================
   النماذج والحقول
   ======================================== */
[data-theme="dark"] .form-control {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-white);
}

[data-theme="dark"] .form-control:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--text-gray);
}

[data-theme="dark"] select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23bdc3c7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="dark"] .input-wrapper i {
    color: var(--secondary);
}

[data-theme="dark"] .form-group label {
    color: var(--text-white);
}

[data-theme="dark"] .form-group label i {
    color: var(--secondary);
}

/* ========================================
   الجداول
   ======================================== */
[data-theme="dark"] table {
    color: var(--text-dark);
}

[data-theme="dark"] thead {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

[data-theme="dark"] th {
    color: var(--text-white);
}

[data-theme="dark"] td {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] tr:hover {
    background: var(--bg-light);
}

[data-theme="dark"] .table-container {
    background: var(--bg-white);
}

/* ========================================
   الأزرار
   ======================================== */
[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

[data-theme="dark"] .btn-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: var(--primary-dark);
}

[data-theme="dark"] .btn-outline {
    border-color: var(--secondary);
    color: var(--secondary);
}

[data-theme="dark"] .btn-outline:hover {
    background: var(--secondary);
    color: var(--primary-dark);
}

[data-theme="dark"] .btn-success {
    background: var(--success);
    color: white;
}

[data-theme="dark"] .btn-danger {
    background: var(--danger);
    color: white;
}

[data-theme="dark"] .btn-warning {
    background: var(--warning);
    color: var(--text-dark);
}

[data-theme="dark"] .btn-info {
    background: var(--info);
    color: white;
}

[data-theme="dark"] .btn:disabled {
    opacity: 0.5;
}

/* ========================================
   شريط التبويبات
   ======================================== */
[data-theme="dark"] .tab {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-gray);
}

[data-theme="dark"] .tab:hover {
    border-color: var(--secondary);
    color: var(--secondary);
}

[data-theme="dark"] .tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

[data-theme="dark"] .tab.active i {
    color: var(--secondary);
}

/* ========================================
   النوافذ المنبثقة
   ======================================== */
[data-theme="dark"] .modal-content {
    background: var(--bg-white);
}

[data-theme="dark"] .modal-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

[data-theme="dark"] .modal-footer {
    border-top-color: var(--border-color);
}

[data-theme="dark"] .close-modal {
    color: var(--text-white);
}

[data-theme="dark"] .close-modal:hover {
    color: var(--secondary);
}

/* ========================================
   القوائم المنسدلة
   ======================================== */
[data-theme="dark"] .dropdown-content {
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .dropdown-content a {
    color: var(--text-dark) !important;
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .dropdown-content a:hover {
    background: var(--bg-light);
    color: var(--secondary) !important;
}

/* ========================================
   الشارات (Badges)
   ======================================== */
[data-theme="dark"] .badge-primary {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .badge-secondary {
    background: var(--secondary);
    color: var(--primary-dark);
}

[data-theme="dark"] .badge-success {
    background: var(--success-light);
    color: var(--success);
}

[data-theme="dark"] .badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

[data-theme="dark"] .badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

[data-theme="dark"] .badge-info {
    background: var(--info-light);
    color: var(--info);
}

/* ========================================
   مؤشرات التقدم
   ======================================== */
[data-theme="dark"] .progress-bar {
    background: var(--bg-light);
}

[data-theme="dark"] .progress-fill {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* ========================================
   شريط الإشعارات
   ======================================== */
[data-theme="dark"] .notification-bell {
    color: var(--text-white);
}

[data-theme="dark"] .notification-bell:hover {
    color: var(--secondary);
}

[data-theme="dark"] .notification-badge {
    background: var(--danger);
    color: white;
}

/* ========================================
   قائمة المستخدم
   ======================================== */
[data-theme="dark"] .user-info .user-name {
    color: var(--text-white);
}

[data-theme="dark"] .user-info .user-role {
    color: var(--text-gray);
}

[data-theme="dark"] .logout-btn {
    border-color: var(--secondary);
    color: var(--secondary);
}

[data-theme="dark"] .logout-btn:hover {
    background: var(--secondary);
    color: var(--primary-dark);
}

[data-theme="dark"] .login-btn {
    background: var(--secondary);
    color: var(--primary-dark) !important;
}

/* ========================================
   بطاقات الإحصائيات
   ======================================== */
[data-theme="dark"] .stat-card {
    background: var(--bg-white);
}

[data-theme="dark"] .stat-value {
    color: var(--text-white);
}

[data-theme="dark"] .stat-label {
    color: var(--text-gray);
}

[data-theme="dark"] .stat-icon {
    background: var(--bg-primary-light);
}

/* ========================================
   قائمة الطلبات
   ======================================== */
[data-theme="dark"] .request-item {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .request-item:hover {
    background: var(--bg-light);
}

[data-theme="dark"] .request-info h3 {
    color: var(--text-white);
}

[data-theme="dark"] .request-info p {
    color: var(--text-gray);
}

/* ========================================
   المركبات
   ======================================== */
[data-theme="dark"] .vehicle-item {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .vehicle-item:hover {
    background: var(--bg-light);
}

[data-theme="dark"] .vehicle-info h4 {
    color: var(--text-white);
}

[data-theme="dark"] .vehicle-info p {
    color: var(--text-gray);
}

[data-theme="dark"] .vehicle-icon {
    background: var(--secondary);
    color: var(--primary-dark);
}

/* ========================================
   خدمات سريعة
   ======================================== */
[data-theme="dark"] .service-card {
    background: var(--bg-light);
    border-color: var(--border-color);
}

[data-theme="dark"] .service-card:hover {
    background: var(--bg-white);
    border-color: var(--secondary);
}

[data-theme="dark"] .service-card i {
    color: var(--secondary);
}

[data-theme="dark"] .service-card h4 {
    color: var(--text-white);
}

[data-theme="dark"] .service-card p {
    color: var(--text-gray);
}

/* ========================================
   المساعد الذكي
   ======================================== */
[data-theme="dark"] .chat-messages {
    background: var(--bg-light);
}

[data-theme="dark"] .message.bot .message-content {
    background: var(--bg-white);
    color: var(--text-dark);
}

[data-theme="dark"] .message.user .message-content {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .message-avatar.bot {
    background: var(--primary);
    color: var(--secondary);
}

[data-theme="dark"] .message-avatar.user {
    background: var(--secondary);
    color: var(--primary-dark);
}

[data-theme="dark"] .chat-input-area {
    background: var(--bg-white);
    border-top-color: var(--border-color);
}

[data-theme="dark"] .chat-input {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-white);
}

[data-theme="dark"] .suggestions {
    background: var(--bg-white);
    border-top-color: var(--border-color);
}

[data-theme="dark"] .suggestion-btn {
    background: var(--bg-light);
    color: var(--text-dark);
}

[data-theme="dark"] .suggestion-btn:hover {
    background: var(--secondary);
    color: var(--primary-dark);
}

/* ========================================
   التصنيفات
   ======================================== */
[data-theme="dark"] .skill-tag,
[data-theme="dark"] .gov-tag,
[data-theme="dark"] .type-tag {
    background: var(--bg-light);
    color: var(--text-dark);
}

[data-theme="dark"] .skill-tag i,
[data-theme="dark"] .gov-tag i,
[data-theme="dark"] .type-tag i {
    color: var(--secondary);
}

/* ========================================
   التذييل
   ======================================== */
[data-theme="dark"] .footer-links a {
    color: var(--text-gray);
}

[data-theme="dark"] .footer-links a:hover {
    color: var(--secondary);
}

[data-theme="dark"] .contact-info li {
    color: var(--text-gray);
}

[data-theme="dark"] .footer-bottom {
    border-top-color: rgba(255, 255, 255, 0.1);
    color: var(--text-gray);
}

[data-theme="dark"] .social-links a {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

[data-theme="dark"] .social-links a:hover {
    background: var(--secondary);
    color: var(--primary-dark);
}

/* ========================================
   أزرار الصفحات
   ======================================== */
[data-theme="dark"] .pagination .page-item {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-gray);
}

[data-theme="dark"] .pagination .page-item:hover,
[data-theme="dark"] .pagination .page-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ========================================
   شريط التمرير
   ======================================== */
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--primary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* ========================================
   التحديد
   ======================================== */
[data-theme="dark"] ::selection {
    background: var(--secondary);
    color: var(--primary-dark);
}

/* ========================================
   الرسوم البيانية
   ======================================== */
[data-theme="dark"] .chart-card canvas {
    filter: brightness(0.9) contrast(1.1);
}

[data-theme="dark"] .chart-card {
    background: var(--bg-white);
}

/* ========================================
   الإشعارات المنبثقة (Toast)
   ======================================== */
[data-theme="dark"] .toast-success {
    background: var(--success-light);
    color: var(--success);
}

[data-theme="dark"] .toast-error {
    background: var(--danger-light);
    color: var(--danger);
}

[data-theme="dark"] .toast-warning {
    background: var(--warning-light);
    color: var(--warning);
}

[data-theme="dark"] .toast-info {
    background: var(--info-light);
    color: var(--info);
}

/* ========================================
   شاشات التحميل
   ======================================== */
[data-theme="dark"] .loading-spinner {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: var(--secondary);
}

[data-theme="dark"] .loader-container {
    background: var(--bg-white);
}

/* ========================================
   حالات الخطأ والفارغ
   ======================================== */
[data-theme="dark"] .error-container i,
[data-theme="dark"] .empty-container i {
    color: var(--text-gray);
}

[data-theme="dark"] .error-container h3,
[data-theme="dark"] .empty-container h3 {
    color: var(--text-white);
}

/* ========================================
   تنسيقات خاصة بصفحات المصادقة
   ======================================== */
[data-theme="dark"] .auth-page {
    background: var(--bg-dark);
}

[data-theme="dark"] .auth-card {
    background: var(--bg-white);
}

[data-theme="dark"] .demo-btn {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-dark);
}

[data-theme="dark"] .demo-btn:hover {
    background: var(--secondary);
    color: var(--primary-dark);
}

/* ========================================
   تنسيقات خاصة بلوحة التحكم
   ======================================== */
[data-theme="dark"] .welcome-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

[data-theme="dark"] .quick-action-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

[data-theme="dark"] .quick-action-btn:hover {
    background: var(--secondary);
    color: var(--primary-dark);
}

/* ========================================
   تنسيقات خاصة بصفحة التقارير
   ======================================== */
[data-theme="dark"] .report-card {
    background: var(--bg-white);
}

[data-theme="dark"] .report-header {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .report-stat {
    background: var(--bg-light);
}

/* ========================================
   تنسيقات خاصة بصفحة الملف الشخصي
   ======================================== */
[data-theme="dark"] .profile-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

[data-theme="dark"] .profile-avatar {
    background: var(--secondary);
    color: var(--primary-dark);
}

[data-theme="dark"] .profile-info {
    background: var(--bg-light);
}

[data-theme="dark"] .info-row {
    border-bottom-color: var(--border-color);
}

/* ========================================
   تنسيقات خاصة بالتقويم
   ======================================== */
[data-theme="dark"] .calendar-day {
    background: var(--bg-white);
}

[data-theme="dark"] .calendar-day.today {
    border-color: var(--secondary);
}

[data-theme="dark"] .weekday {
    background: var(--primary-dark);
}

[data-theme="dark"] .appointment {
    background: var(--bg-light);
}

[data-theme="dark"] .appointment.pending {
    background: var(--warning-light);
    color: var(--warning);
}

[data-theme="dark"] .appointment.completed {
    background: var(--success-light);
    color: var(--success);
}

/* ========================================
   تنسيقات خاصة بصفحة الشكاوى
   ======================================== */
[data-theme="dark"] .complaint-card {
    background: var(--bg-white);
}

[data-theme="dark"] .complaint-text {
    background: var(--bg-light);
    color: var(--text-dark);
}

[data-theme="dark"] .severity-high {
    background: var(--danger-light);
    color: var(--danger);
}

[data-theme="dark"] .severity-medium {
    background: var(--warning-light);
    color: var(--warning);
}

[data-theme="dark"] .severity-low {
    background: var(--success-light);
    color: var(--success);
}

/* ========================================
   تنسيقات خاصة بالتدقيق
   ======================================== */
[data-theme="dark"] .audit-item {
    background: var(--bg-white);
    border-color: var(--border-color);
}

[data-theme="dark"] .audit-item.pending {
    border-right-color: var(--warning);
}

[data-theme="dark"] .audit-item.approved {
    border-right-color: var(--success);
}

[data-theme="dark"] .audit-item.rejected {
    border-right-color: var(--danger);
}

/* ========================================
   تحسينات إضافية
   ======================================== */
[data-theme="dark"] .border {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .bg-light {
    background: var(--bg-light) !important;
}

[data-theme="dark"] .bg-white {
    background: var(--bg-white) !important;
}

[data-theme="dark"] .text-dark {
    color: var(--text-dark) !important;
}

[data-theme="dark"] .text-light {
    color: var(--text-light) !important;
}

[data-theme="dark"] hr {
    border-color: var(--border-color);
}

/* ========================================
   توافق مع المتصفحات القديمة
   ======================================== */
[data-theme="dark"] .old-browser-warning {
    background: var(--warning-light);
    color: var(--warning);
}

/* ========================================
   تأثيرات انتقالية سلسة
   ======================================== */
[data-theme="dark"] * {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}