/* ==========================================
   نظام إدارة البيانات - أنماط موحدة
   ========================================== */

/* ==================== المتغيرات اللونية ==================== */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    --light-bg: #f5f7fa;
    --dark-text: #333333;
    --border-radius: 15px;
    --shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* ==================== العام ==================== */
* {
    text-align: right;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    background: var(--primary-gradient);
    min-height: 100vh;
    font-family: 'Segoe UI', 'Tahoma', Geneva, Verdana, sans-serif;
    color: var(--dark-text);
}

/* ==================== شريط التنقل ==================== */
.navbar {
    background: var(--primary-gradient);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
    color: white !important;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand i {
    margin-left: 10px;
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.8) !important;
    margin: 0 10px;
    padding: 8px 12px !important;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: white !important;
    background: rgba(255,255,255,0.2);
}

/* ==================== حاويات وأقسام ==================== */
.container {
    max-width: 1400px;
    margin-top: 20px;
}

.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.card-header {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1.3rem;
}

.card-body {
    padding: 2rem;
}

/* ==================== بطاقات الإحصائيات ==================== */
.stats-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    border-left: 5px solid var(--primary-color);
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.stats-card h5 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-card h5 i {
    margin-left: 8px;
    font-size: 1.2rem;
}

.stats-card .number {
    font-size: 2.5rem;
    color: var(--secondary-color);
    font-weight: 700;
    line-height: 1;
}

/* ==================== التبويبات ==================== */
.nav-tabs {
    border-bottom: 3px solid var(--primary-color);
    margin-bottom: 30px;
    background: transparent;
}

.nav-tabs .nav-link {
    color: rgba(255,255,255,0.7);
    border: none;
    padding: 12px 24px;
    position: relative;
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 10px 10px 0 0;
    margin: 0 5px;
}

.nav-tabs .nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.nav-tabs .nav-link.active {
    color: white;
    background: var(--primary-gradient);
    border: none;
    box-shadow: 0 5px 15px rgba(102,126,234,0.3);
}

.nav-tabs .nav-link i {
    margin-left: 8px;
}

/* ==================== الجداول ==================== */
.table {
    border-radius: 10px;
    overflow: hidden;
    background: white;
    margin-bottom: 0;
}

.table thead {
    background: var(--primary-gradient);
    color: white;
}

.table thead th {
    border: none;
    padding: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.3s ease;
}

.table tbody tr:hover {
    background-color: #f5f5f5;
    transform: scale(1.01);
}

.table tbody td {
    padding: 1rem 1.2rem;
    vertical-align: middle;
}

.table-responsive {
    border-radius: var(--border-radius);
}

/* ==================== الأزرار ==================== */
.btn {
    border: none;
    border-radius: 25px;
    padding: 10px 24px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102,126,234,0.4);
    color: white;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.8rem;
}

.btn i {
    margin-left: 6px;
}

/* ==================== حقول الإدخال والبحث ==================== */
.search-box,
.form-control {
    background: white;
    border-radius: 25px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.search-box:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(102,126,234,0.2);
    background: white;
}

.search-box::placeholder {
    color: #999;
}

.form-select {
    border-radius: 25px !important;
    padding: 12px 20px !important;
    border: 2px solid #e0e0e0 !important;
}

.form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 15px rgba(102,126,234,0.2) !important;
}

/* ==================== قسم الفلاتر ==================== */
.filter-section {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
}

/* ==================== الشارات والتصنيفات ==================== */
.badge {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
}

.badge-custom {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
    background: var(--primary-gradient);
    color: white;
}

.badge-success {
    background: #4caf50;
}

.badge-danger {
    background: #f44336;
}

.badge-info {
    background: #2196f3;
}

.badge-warning {
    background: #ff9800;
}

/* ==================== النوافذ المنبثقة ==================== */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
}

.modal-header {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-header .modal-title {
    font-weight: 600;
    font-size: 1.3rem;
}

.modal-body {
    padding: 2rem;
}

.btn-close-white {
    filter: brightness(0) invert(1);
}

/* ==================== الحالات الفارغة ==================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.empty-state i {
    font-size: 5rem;
    margin-bottom: 20px;
    color: #ddd;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.2rem;
    color: #666;
    margin-top: 20px;
}

/* ==================== المسارات ==================== */
.breadcrumb {
    background: transparent;
    padding: 20px 0;
    margin-bottom: 30px;
}

.breadcrumb-item {
    color: rgba(255,255,255,0.7);
}

.breadcrumb-item.active {
    color: #ffc107;
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.5);
}

/* ==================== العناوين ==================== */
.section-title {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    letter-spacing: 1px;
}

h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* ==================== الحروف والنصوص ==================== */
strong {
    color: var(--dark-text);
    font-weight: 600;
}

.text-muted {
    color: #999 !important;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ==================== التجاوب مع الأجهزة المختلفة ==================== */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .stats-card {
        margin-bottom: 15px;
    }

    .stats-card .number {
        font-size: 2rem;
    }

    .nav-tabs {
        gap: 5px;
    }

    .nav-tabs .nav-link {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .table thead th {
        padding: 0.8rem;
        font-size: 0.75rem;
    }

    .table tbody td {
        padding: 0.8rem;
        font-size: 0.85rem;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.75rem;
    }

    .filter-section {
        padding: 15px;
    }

    .card-body {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 0.9rem;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .stats-card {
        padding: 15px;
    }

    .stats-card h5 {
        font-size: 0.8rem;
    }

    .stats-card .number {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .table thead th {
        padding: 0.5rem;
    }

    .table tbody td {
        padding: 0.5rem;
    }

    .search-box,
    .form-control {
        font-size: 0.85rem;
        padding: 10px 15px;
    }

    .btn {
        padding: 6px 12px;
        font-size: 0.7rem;
    }
}

/* ==================== الرسوم المتحركة ==================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.card {
    animation: slideIn 0.5s ease forwards;
}

.nav-link {
    animation: fadeIn 0.3s ease forwards;
}

/* ==================== عناصر إضافية ==================== */
.row {
    display: flex;
    flex-wrap: wrap;
}

.col {
    flex: 1 1 auto;
    padding: 0.5rem;
}

/* تحسينات الوصول (Accessibility) */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* دعم الوضع الليلي (اختياري) */
@media (prefers-color-scheme: dark) {
    body {
        --dark-text: #f5f5f5;
    }
    
    .card,
    .stats-card,
    .filter-section,
    .search-box,
    .form-control {
        background: #2a2a2a;
        color: #f5f5f5;
    }
    
    .table {
        background: #2a2a2a;
        color: #f5f5f5;
    }
    
    .table tbody tr {
        border-bottom-color: #444;
    }
    
    .table tbody tr:hover {
        background-color: #3a3a3a;
    }
}
