/* الأنماط العامة */
:root {
    --primary: #2A5CAA;
    --primary-dark: #1E4480;
    --primary-light: #4A7EC9;
    --secondary: #FF6B35;
    --secondary-light: #FF9E7A;
    --dark: #2C3E50;
    --light: #F8F9FA;
    --gray: #6C757D;
    --gray-light: #E9ECEF;
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --info: #17A2B8;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius: 10px;
    --radius-sm: 6px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Tajawal', sans-serif;
    background-color: #F5F7FB;
    color: var(--dark);
    line-height: 1.8;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 200px);
}

/* الهيدر */
header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    padding: 1.5rem;
    border-radius: 0 0 25px 25px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.05)"/></svg>');
    background-size: cover;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
}

.logo i {
    font-size: 2rem;
    color: var(--secondary-light);
}

.logo-text h1 {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
}

.logo-text p {
    font-size: 0.9rem;
    opacity: 0.9;
}

nav ul {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    list-style: none;
    padding: 1rem 0;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 0.7rem 1.2rem;
    border-radius: 50px;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav ul li a:hover, nav ul li a.active {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

/* الأقسام */
.section {
    background: white;
    margin: 2rem 0;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 5px solid var(--primary);
    transition: var(--transition);
}

.section:hover {
    box-shadow: var(--shadow-lg);
}

h1, h2, h3 {
    color: var(--dark);
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

h2 {
    color: var(--primary-dark);
    margin-bottom: 1.8rem;
    padding-bottom: 1.2rem;
    border-bottom: 3px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

h2 i {
    color: var(--secondary);
}

/* النماذج */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.8rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: var(--gray);
}

.input-with-icon input, .input-with-icon select {
    padding-right: 45px;
}

input, select, textarea {
    width: 100%;
    padding: 0.9rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    font-family: 'Tajawal', sans-serif;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(42, 92, 170, 0.2);
}

/* الأزرار */
.btn {
    background: var(--primary);
    color: white;
    padding: 0.9rem 1.8rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    font-weight: 600;
    min-height: 48px;
    text-decoration: none;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(42, 92, 170, 0.3);
}

.btn-secondary {
    background: var(--secondary);
}

.btn-secondary:hover {
    background: #E55A2B;
}

.btn-success {
    background: var(--success);
}

.btn-danger {
    background: var(--danger);
}

.btn-warning {
    background: var(--warning);
    color: var(--dark);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

/* الجداول */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    min-width: 800px;
}

th, td {
    padding: 1.2rem;
    text-align: right;
    border-bottom: 1px solid var(--gray-light);
}

th {
    background: var(--primary);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

tr:hover {
    background-color: rgba(42, 92, 170, 0.03);
}

tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.01);
}

.status {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status.available { 
    background: rgba(40, 167, 69, 0.15); 
    color: var(--success); 
}
.status.sold { 
    background: rgba(220, 53, 69, 0.15); 
    color: var(--danger); 
}
.status.pending { 
    background: rgba(255, 193, 7, 0.15); 
    color: #b38b00; 
}
.status.maintenance { 
    background: rgba(23, 162, 184, 0.15); 
    color: var(--info); 
}

/* الرسائل */
.alert {
    padding: 1.2rem;
    margin: 1.2rem 0;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    border-right: 5px solid transparent;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
    border-right-color: var(--success);
}

.alert-error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
    border-right-color: var(--danger);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #b38b00;
    border-right-color: var(--warning);
}

.alert i {
    font-size: 1.5rem;
}

/* الإحصائيات */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.stat-card {
    background: white;
    padding: 1.8rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-top: 4px solid;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card:nth-child(1) { border-top-color: var(--primary); }
.stat-card:nth-child(2) { border-top-color: var(--secondary); }
.stat-card:nth-child(3) { border-top-color: var(--success); }
.stat-card:nth-child(4) { border-top-color: var(--info); }

.stat-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.stat-card:nth-child(2) i { color: var(--secondary); }
.stat-card:nth-child(3) i { color: var(--success); }
.stat-card:nth-child(4) i { color: var(--info); }

.stat-value {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0.5rem 0;
    line-height: 1;
}

.stat-desc {
    color: var(--gray);
    font-size: 0.95rem;
}

/* الفلاتر والبحث */
.filters {
    background: var(--gray-light);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
}

.search-box input {
    padding-right: 45px;
}

.search-box i {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    color: var(--gray);
}

/* تذييل الصفحة */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--gray);
    font-size: 0.9rem;
    border-top: 1px solid var(--gray-light);
    margin-top: 3rem;
}

/* عرض التبويبات */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-light);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.tab {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--gray);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: var(--transition);
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* كروت السيارة */
.car-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.car-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.car-card-img {
    height: 180px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.car-card-body {
    padding: 1.5rem;
}

.car-card-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.car-card-details {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-light);
}

/* صفحة رئيسية إضافية */
.welcome-section {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.quick-action-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-decoration: none;
    color: var(--dark);
}

.quick-action-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.quick-action-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

/* تخصيص شريط التمرير */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}


/* تحسينات للهواتف المحمولة */
@media (max-width: 992px) {
    .header-content {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .logo-text h1 {
        font-size: 1.5rem;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .section {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.8rem;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .welcome-section {
        padding: 2rem 1rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    nav ul li a {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }
}