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

/* ========================================
   الوضع الليلي - المتغيرات
   ======================================== */
[data-theme="dark"] {
    --primary: #004481;
    --primary-dark: #003366;
    --primary-light: #0a5c9e;
    --secondary: #ffd700;
    --secondary-dark: #e6c200;
    
    --text-dark: #e0e0e0;
    --text-gray: #b0b0b0;
    --text-light: #808080;
    --text-white: #ffffff;
    
    --bg-light: #1a1a2e;
    --bg-white: #16213e;
    --bg-dark: #0f0f1f;
    
    --border-color: #2a2a3a;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* ========================================
   الخلفيات الأساسية
   ======================================== */
[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));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

[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 {
    background: var(--bg-white);
    border-color: var(--border-color);
}

[data-theme="dark"] .footer {
    background: var(--primary-dark);
    border-top: 1px solid 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 {
    color: var(--text-dark);
}

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

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

[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);
}

/* ========================================
   النماذج
   ======================================== */
[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='%23b0b0b0' 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"] table {
    color: var(--text-dark);
}

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

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

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

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

[data-theme="dark"] .btn-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-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"] .card-header {
    border-bottom-color: var(--border-color);
}

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

/* ========================================
   شريط التبويبات
   ======================================== */
[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"] .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"] .dropdown-content {
    background: var(--bg-white);
    box-shadow: var(--shadow-hover);
}

[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;
}

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

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

[data-theme="dark"] .badge-success {
    background: #1e3a2a;
    color: #8bc34a;
}

[data-theme="dark"] .badge-danger {
    background: #3a1e1e;
    color: #f44336;
}

[data-theme="dark"] .badge-warning {
    background: #3a2e1e;
    color: #ffc107;
}

[data-theme="dark"] .badge-info {
    background: #1e2e3a;
    color: #17a2b8;
}

/* ========================================
   مؤشرات التقدم
   ======================================== */
[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"] .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);
}

/* ========================================
   زر تبديل الوضع الليلي
   ======================================== */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    margin-left: 15px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--primary);
    transition: .4s;
    border-radius: 34px;
}

.theme-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    right: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .theme-slider {
    background-color: var(--secondary);
}

input:checked + .theme-slider:before {
    transform: translateX(-30px);
}

.theme-icon {
    position: absolute;
    top: 5px;
    left: 8px;
    color: var(--secondary);
    font-size: 14px;
}

.theme-icon-dark {
    right: 8px;
    left: auto;
    color: var(--primary);
}

/* ========================================
   تنسيقات إضافية للوضع الليلي
   ======================================== */
[data-theme="dark"] .logo {
    color: white;
}

[data-theme="dark"] .logo span {
    color: var(--secondary);
}

[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"] .request-item {
    border-bottom-color: var(--border-color);
}

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

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

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

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

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

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

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

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

[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;
}

/* ========================================
   الرسوم البيانية (Charts)
   ======================================== */
[data-theme="dark"] .chart-card {
    background: var(--bg-white);
}

[data-theme="dark"] .chart-container canvas {
    filter: brightness(0.9);
}