/**
 * AUTO TESTER - المصرية لفحص السيارات
 * الملف: main.css
 * الوصف: التنسيقات الرئيسية للموقع
 * الإصدار: 1.0
 */

/* ========================================
   المتغيرات الأساسية
   ======================================== */
:root {
    /* الألوان الرئيسية */
    --primary: #002b5c;
    --primary-dark: #001f44;
    --primary-light: #004481;
    --secondary: #ffd700;
    --secondary-dark: #e6c200;
    --secondary-light: #fff3cd;
    
    /* ألوان الحالات */
    --success: #28a745;
    --success-light: #d4edda;
    --danger: #dc3545;
    --danger-light: #f8d7da;
    --warning: #ffc107;
    --warning-light: #fff3cd;
    --info: #17a2b8;
    --info-light: #d1ecf1;
    
    /* ألوان النص */
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    
    /* ألوان الخلفية */
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --bg-dark: #0a0a0f;
    
    /* الحدود */
    --border-color: #e2e8f0;
    --border-radius: 15px;
    --border-radius-sm: 8px;
    --border-radius-lg: 20px;
    
    /* الظلال */
    --shadow: 0 5px 15px rgba(0,0,0,0.05);
    --shadow-hover: 0 10px 25px rgba(0,43,92,0.1);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.1);
    
    /* الترانزیشن */
    --transition: all 0.3s ease;
}

/* ========================================
   إعادة تعيين التنسيقات
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   الحاوية الرئيسية
   ======================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* ========================================
   الطباعة
   ======================================== */
@media print {
    .no-print,
    .navbar,
    .footer,
    .btn {
        display: none !important;
    }
    
    body {
        background: white;
        padding: 20px;
    }
}

/* ========================================
   التمرير
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* ========================================
   التحديد
   ======================================== */
::selection {
    background: var(--secondary);
    color: var(--primary);
}

/* ========================================
   شريط التنقل
   ======================================== */
.navbar {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

.logo span {
    color: var(--secondary);
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255, 215, 0, 0.2);
}

.nav-links a i {
    color: var(--secondary);
}

/* القائمة المنسدلة */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 200px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text-dark) !important;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background: var(--bg-light);
    color: var(--primary) !important;
}

/* قائمة المستخدم */
.user-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    text-align: left;
}

.user-name {
    font-weight: 700;
    font-size: 1rem;
}

.user-role {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* أيقونة الإشعارات */
.notification-bell {
    position: relative;
    cursor: pointer;
    font-size: 1.3rem;
    transition: var(--transition);
}

.notification-bell:hover {
    color: var(--secondary);
    transform: scale(1.1);
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* زر تسجيل الخروج */
.logout-btn {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.logout-btn:hover {
    background: var(--secondary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* زر تسجيل الدخول */
.login-btn {
    background: var(--secondary);
    color: var(--primary) !important;
    padding: 8px 25px !important;
    border-radius: 50px;
    font-weight: 700;
}

.login-btn:hover {
    background: white;
    color: var(--primary) !important;
}

/* ========================================
   الأزرار
   ======================================== */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-size: 1rem;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 15px 40px;
    font-size: 1.2rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: var(--primary);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-dark), var(--secondary));
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning);
    color: var(--text-dark);
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ========================================
   البطاقات
   ======================================== */
.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.card-header h2,
.card-header h3 {
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header i {
    color: var(--secondary);
}

.card-body {
    margin-bottom: 20px;
}

.card-footer {
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

/* ========================================
   النماذج
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-weight: 600;
}

.form-group label i {
    color: var(--secondary);
    margin-left: 5px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.form-control.error {
    border-color: var(--danger);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: none;
    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='%236c757d' 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");
    background-repeat: no-repeat;
    background-position: left 15px center;
    background-size: 16px;
    padding-left: 45px;
}

/* ========================================
   الجداول
   ======================================== */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

th {
    padding: 15px;
    text-align: center;
    font-weight: 600;
}

td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background: var(--bg-light);
}

/* ========================================
   التذييل
   ======================================== */
.footer {
    background: var(--primary-dark);
    color: white;
    padding: 60px 0 20px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.footer-logo span {
    color: var(--secondary);
}

.footer-about p {
    color: var(--text-light);
    line-height: 1.8;
}

.footer-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--secondary);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: var(--secondary);
    transform: translateX(-5px);
}

.contact-info {
    list-style: none;
}

.contact-info li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--text-light);
}

.contact-info i {
    color: var(--secondary);
    width: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--secondary);
    color: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: var(--text-light);
}

/* ========================================
   الإشعارات المنبثقة (Toast)
   ======================================== */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 30px;
    border-radius: 50px;
    background: white;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.toast-success {
    background: var(--success-light);
    color: var(--success);
    border: 2px solid var(--success);
}

.toast-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 2px solid var(--danger);
}

.toast-warning {
    background: var(--warning-light);
    color: var(--warning);
    border: 2px solid var(--warning);
}

.toast-info {
    background: var(--info-light);
    color: var(--info);
    border: 2px solid var(--info);
}

.toast-hide {
    animation: slideUp 0.3s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* ========================================
   حالات التحميل
   ======================================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--secondary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-container {
    text-align: center;
    padding: 40px;
}

.loader-container .spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top-color: var(--secondary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

/* ========================================
   حالات الخطأ والفارغ
   ======================================== */
.error-container,
.empty-container {
    text-align: center;
    padding: 60px 20px;
}

.error-container i,
.empty-container i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.error-container h3,
.empty-container h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

.error-container p,
.empty-container p {
    color: var(--text-gray);
}

.btn-retry {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 50px;
    margin-top: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-retry:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

/* ========================================
   الشارات (Badges)
   ======================================== */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
    border: 1px solid var(--info);
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.badge-secondary {
    background: var(--secondary);
    color: var(--primary);
}

/* ========================================
   مؤشرات التقدم
   ======================================== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.8rem;
    color: var(--text-gray);
}

/* ========================================
   شريط التبويبات
   ======================================== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.tab {
    padding: 10px 25px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-gray);
}

.tab:hover {
    border-color: var(--secondary);
    color: var(--primary);
}

.tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-color: transparent;
}

.tab.active i {
    color: var(--secondary);
}

.tab i {
    color: var(--secondary);
}

/* ========================================
   النوافذ المنبثقة (Modal)
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--secondary);
    transform: scale(1.1);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   الصفحة الرئيسية (Home)
   ======================================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 20px;
}

.hero-title span {
    color: var(--secondary);
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 40px;
}

/* ========================================
   الاستجابة للشاشات
   ======================================== */
@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 540px;
    }
    
    .navbar {
        padding: 1rem;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .user-menu {
        width: 100%;
        justify-content: center;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .user-info {
        display: none;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        width: 100%;
        justify-content: center;
    }
}

/* ========================================
   الطباعة
   ======================================== */
@media print {
    .navbar,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
        padding: 20px;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}