/**
 * =====================================================
 * Yemen Transport System - Admin Panel Styles
 * =====================================================
 * ملف أنماط موحد للوحة الإدارة
 * يقلل من تكرار الأكواد ويحسن الصيانة
 */

/* إعدادات الصفحة للوحة الإدارة */
:root {
    --sidebar-width: 280px;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-color);
    color: var(--white);
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-header svg {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    padding: 10px 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    transition: var(--transition);
    cursor: pointer;
    border-right: 3px solid transparent;
    text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.nav-item.active {
    border-right-color: var(--secondary-color);
    background: rgba(255,255,255,0.15);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* المحتوى الرئيسي */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    background: var(--gray-100);
    padding: 30px;
    min-height: 100vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.btn-add {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: var(--secondary-color);
    color: var(--white);
    border-radius: 10px;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
}

.btn-add:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-add svg {
    width: 20px;
    height: 20px;
}

/* البطاقات */
.card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 25px;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.card-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filters select,
.filters input {
    padding: 10px 15px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--white);
    transition: var(--transition);
    min-width: 150px;
}

.filters select:focus,
.filters input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.card-body {
    padding: 0;
}

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

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

.data-table th,
.data-table td {
    padding: 15px 20px;
    text-align: right;
    border-bottom: 1px solid var(--gray-100);
}

.data-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.9rem;
    white-space: nowrap;
}

.data-table tr:hover {
    background: var(--gray-50);
}

.data-table tbody tr {
    transition: var(--transition);
}

/* شارات الحالة */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-confirmed,
.status-paid,
.status-active,
.status-scheduled,
.status-available,
.status-delivered {
    background: #dcfce7;
    color: #16a34a;
}

.status-cancelled,
.status-inactive,
.status-returned,
.status-out_of_service {
    background: #fee2e2;
    color: #dc2626;
}

.status-pending,
.status-completed,
.status-in_progress {
    background: #fef3c7;
    color: #d97706;
}

/* أزرار الإجراءات */
.action-btns {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    text-decoration: none;
    background: var(--gray-100);
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

.action-btn:hover {
    transform: translateY(-2px);
}

.action-btn.view {
    background: var(--gray-100);
    color: var(--primary-color);
}

.action-btn.edit {
    background: #fef3c7;
    color: #d97706;
}

.action-btn.delete {
    background: #fee2e2;
    color: #dc2626;
}

.action-btn.cancel {
    background: #fee2e2;
    color: #dc2626;
}

.action-btn.toggle {
    background: #fef3c7;
    color: #d97706;
}

.action-btn.track {
    background: #dbeafe;
    color: #2563eb;
}

/* التنبيهات */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-warning {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #d97706;
}

.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* حالة فارغة */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    color: var(--gray-300);
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--gray-600);
}

/* إحصائيات */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

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

.stat-card h4 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 5px 0;
}

.stat-card p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin: 0;
}

/* دعم اللغة العربية */
body {
    font-family: 'Cairo', 'Tajawal', 'Segoe UI', sans-serif;
    direction: rtl;
    text-align: right;
}

/* تصميم متجاوب */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filters {
        width: 100%;
    }
    
    .filters select,
    .filters input {
        flex: 1;
        min-width: 100%;
    }
    
    .data-table th,
    .data-table td {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* تحسينات إضافية */
.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.required {
    color: var(--danger-color);
}

.muted {
    color: var(--gray-500);
    font-size: 0.85rem;
}

/* تأثيرات حركية */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* Tooltip */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: var(--gray-800);
    color: var(--white);
    font-size: 0.8rem;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 100;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}
