/* =============================================
   ملف: assets/css/main.css
   الأنماط الأساسية للموقع
   ============================================= */

/* ===== المتغيرات ===== */
:root {
    --primary: #2C3E6B;
    --primary-light: #4A6FA5;
    --primary-dark: #1a2634;
    --secondary: #6C8EBF;
    --accent: #27AE60;
    --danger: #E74C3C;
    --warning: #F39C12;
    --info: #17a2b8;
    --gradient: linear-gradient(135deg, #2C3E6B, #4A6FA5);
    --gradient-light: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
    --shadow-hover: 0 15px 40px rgba(0,0,0,0.12);
    --radius: 12px;
    --transition: all 0.3s ease;
}

/* ===== الأساسيات ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Poppins', sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
    direction: rtl;
}

a {
    text-decoration: none;
    color: var(--primary);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== الحاويات ===== */
.section-padding {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
}

.section-title p {
    color: #666;
    font-size: 18px;
    margin-top: 10px;
}

/* ===== الأزرار ===== */
.btn {
    padding: 10px 25px;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Tajawal', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.btn-primary {
    background: var(--gradient);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(44, 62, 107, 0.3);
}

.btn-success {
    background: var(--accent);
    color: white;
}

.btn-success:hover {
    background: #219a52;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d68910;
    transform: translateY(-2px);
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 35px;
    font-size: 18px;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* ===== التنبيهات ===== */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #ffe5e5;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===== البطاقات ===== */
.card {
    background: white;
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

/* ===== النماذج ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e1e8ed;
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
    font-family: 'Tajawal', sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ===== الشارات ===== */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #ffe5e5;
    color: #c0392b;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-primary {
    background: #d1ecf1;
    color: var(--primary);
}

/* ===== الجداول ===== */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
}

.table thead {
    background: #f8f9fa;
}

.table th {
    text-align: right;
    padding: 12px 15px;
    color: var(--primary);
    font-weight: 600;
    border-bottom: 2px solid #e1e8ed;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* ===== الحالة الفارغة ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 60px;
    color: #e1e8ed;
    margin-bottom: 15px;
}

.empty-state h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

/* ===== الصفحات ===== */
.page-header {
    background: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.page-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.page-header h1 {
    color: var(--primary);
    font-size: 24px;
}

.page-header .breadcrumb {
    color: #666;
    font-size: 14px;
}

.page-header .breadcrumb a {
    color: var(--primary-light);
}

/* ===== التحميل ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== الاستجابة ===== */
@media (max-width: 992px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .section-title h2 {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 50px 0;
    }
    
    .section-title h2 {
        font-size: 24px;
    }
    
    .page-header .container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .section-title h2 {
        font-size: 20px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ===== الأدوات ===== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
.gap-30 { gap: 30px; }

.w-100 { width: 100%; }

/* ===== سكرول مخصص ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ===== اختيار النص ===== */
::selection {
    background: var(--primary-light);
    color: white;
}