/* منصة اختباري التعليمية - الأنماط الرئيسية */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');
:root {
    /* نظام الألوان الموحد - الأخضر الزمردي كهوية Brand */
    --primary-color: #10b981;
    --primary-light: #34d399;
    --primary-lighter: #d1fae5;
    --primary-dark: #059669;
    --primary-darker: #047857;
    /* ألوان دلالية */
    --secondary-color: #64748b;
    --success-color: #10b981;
    --success-light: #34d399;
    --info-color: #0ea5e9;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    /* الخلفيات والأسطح */
    --light-bg: #f8f9fa;
    --dark-bg: #1e293b;
    --card-bg: #ffffff;
    --surface: #f8f9fa;
    --surface-container: #edeeef;
    /* النصوص */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    /* الحدود والظلال */
    --border-color: #e2e8f0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
    /* الحواف */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    line-height: 1.6;
}
main {
    flex: 1;
}
/* تحسين التمرير */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
/* البطاقات */
.card {
    border: none;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}
.card-header {
    background: var(--dark-bg);
    color: white;
    border: none;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}
.card-body {
    padding: 1.5rem;
}
/* الإحصائيات */
.stat-card {
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    display: none;
}
.stat-card.success {
    background: var(--success-color);
}
.stat-card.warning {
    background: var(--warning-color);
    color: #1e293b;
}
.stat-card.danger {
    background: var(--danger-color);
}
.stat-card .stat-value {
    font-size: 2.75rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.stat-card .stat-label {
    opacity: 0.95;
    font-size: 1rem;
    font-weight: 500;
    margin-top: 0.5rem;
}
/* الأزرار */
.btn {
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}
.btn:active::after {
    width: 300px;
    height: 300px;
}
.btn-primary {
    background: var(--primary-color);
    box-shadow: none;
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}
.btn-success {
    background: var(--success-color);
    box-shadow: none;
}
.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}
.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}
.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}
/* النماذج */
.form-control, .form-select {
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    transition: var(--transition);
    background: var(--card-bg);
    font-size: 1rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15);
    outline: none;
}
.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.form-check-label {
    font-weight: 500;
}
/* الجداول */
.table {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.table thead {
    background: var(--dark-bg);
    color: white;
}
.table th {
    padding: 1rem 1.25rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}
.table td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}
.table tbody tr:hover {
    background: var(--light-bg);
}
/* شارات الحالة */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.8rem;
}
.badge.bg-success {
    background: var(--success-color) !important;
}
.badge.bg-warning {
    background: var(--warning-color) !important;
    color: var(--dark-bg);
}
.badge.bg-danger {
    background: var(--danger-color) !important;
}
.badge.bg-primary {
    background: var(--primary-color) !important;
}
/* بطاقات الاختبارات */
.quiz-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}
.quiz-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.quiz-card .card-img-top {
    height: 180px;
    object-fit: cover;
    background: var(--dark-bg);
}
.quiz-card .quiz-price {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--dark-bg);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
}
.quiz-card .quiz-free {
    background: var(--success-color);
}
/* الشريط الجانبي */
.sidebar {
    background: var(--card-bg);
    width: 280px;
    min-height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    box-shadow: var(--shadow-sm);
    border-left: 1px solid var(--border-color);
    z-index: 1000;
    overflow-y: auto;
}
.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: center;
    background: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
}
.sidebar-header h5 {
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.5rem;
}
.sidebar-nav {
    padding: 1rem 0;
}
.sidebar .nav-link {
    color: var(--text-primary);
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    margin: 4px 12px;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
}
.sidebar .nav-link:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}
.sidebar .nav-link.active {
    background: var(--dark-bg);
    color: white;
}
.sidebar .nav-link i {
    width: 28px;
    font-size: 1.1rem;
}
/* المحتوى الرئيسي */
.main-content {
    margin-right: 280px;
    padding: 2rem;
    min-height: 100vh;
    background: var(--light-bg);
    width: calc(100% - 280px);
}
/* أيقونة الإحصائيات */
.stat-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
/* بطاقة الإحصائيات info */
.stat-card.info {
    background: var(--info-color);
}
/* رابط الإحالة */
.referral-box {
    background: var(--dark-bg);
    color: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
}
.referral-box input {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    backdrop-filter: blur(10px);
}
.referral-box input::placeholder {
    color: rgba(255,255,255,0.7);
}
/* التنبيهات */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.alert-success {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
    border-right: 4px solid var(--success-color);
}
.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-right: 4px solid var(--danger-color);
}
.alert-info {
    background: rgba(14, 165, 233, 0.08);
    color: var(--info-color);
    border-right: 4px solid var(--info-color);
}
/* صفحة تسجيل الدخول */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
    position: relative;
}
.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    max-width: 420px;
    width: 100%;
    border: 1px solid var(--border-color);
}
/* Responsive */
@media (max-width: 991px) {
    .sidebar {
        width: 100% !important;
        position: relative !important;
        min-height: auto !important;
    }
    .main-content {
        margin-right: 0 !important;
        width: 100% !important;
        padding: 1rem;
    }
    .d-flex > .sidebar + .main-content {
        margin-right: 0;
    }
}
@media (max-width: 768px) {
    .stat-card .stat-value {
        font-size: 2rem;
    }
    .auth-card {
        margin: 1rem;
        padding: 2rem;
    }
    .sidebar-header {
        padding: 1.5rem 1rem;
    }
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* الأسئلة */
.question-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}
.question-card:hover {
    box-shadow: var(--shadow-lg);
}
.question-number {
    background: var(--dark-bg);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}
.option-item {
    background: var(--light-bg);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}
.option-item:hover {
    border-color: var(--primary-light);
    background: white;
    transform: translateX(-4px);
}
.option-item.selected {
    border-color: var(--primary-color);
    background: rgba(16, 185, 129, 0.08);
}
.option-item.correct {
    border-color: var(--success-color);
    background: rgba(16, 185, 129, 0.15);
}
.option-item.wrong {
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.15);
}
/* شريط تقدم الرفع */
.upload-progress-container {
    background: var(--light-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1rem;
    border: 2px dashed var(--border-color);
}
.upload-progress-bar {
    height: 12px;
    border-radius: 6px;
    background: var(--light-bg);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.upload-progress-bar .progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 6px;
    transition: width 0.3s ease;
    position: relative;
}
.upload-progress-bar .progress-fill::after {
    display: none;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.upload-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}
.upload-stat {
    text-align: center;
    padding: 0.75rem;
    background: white;
    border-radius: var(--radius-md);
}
.upload-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}
.upload-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}
/* باقات الاسعار */
.pricing-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
}
.pricing-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}
.pricing-card.featured {
    border-color: var(--primary-color);
    transform: scale(1.05);
}
.pricing-card.featured::before {
    content: 'الأفضل';
    position: absolute;
    top: 20px;
    left: -35px;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 3rem;
    font-size: 0.8rem;
    font-weight: 600;
    transform: rotate(-45deg);
}
.pricing-amount {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
}
.pricing-period {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
/* تأثيرات حركية */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}
/* تحسينات عامة */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-primary);
}
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary-dark);
}
/* تحسين حقول الملفات */
input[type="file"] {
    padding: 0.5rem;
}
input[type="file"]::file-selector-button {
    background: var(--dark-bg);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    margin-left: 1rem;
    transition: var(--transition);
}
input[type="file"]::file-selector-button:hover {
    background: var(--primary-color);
}
/* ============================================
   شريط التنقل الرئيسي - Navbar
   ============================================ */
.navbar {
    background: var(--dark-bg) !important;
    box-shadow: var(--shadow-sm);
    padding: 0.5rem 0;
}
.navbar-brand {
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.navbar-brand i {
    font-size: 1.5rem;
}
.navbar .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
}
.navbar .nav-link:hover {
    color: var(--primary-light) !important;
}
.navbar .dropdown-menu {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
    margin-top: 0.5rem;
    animation: dropdownFade 0.3s ease;
}
@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.navbar .dropdown-item {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition);
}
.navbar .dropdown-item:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}
.navbar .dropdown-item i {
    width: 24px;
}
/* زر إنشاء حساب في Navbar */
.navbar .btn-light {
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.navbar .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
/* ============================================
   الفوتر
   ============================================ */
.footer, footer {
    background: var(--dark-bg);
    color: white;
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}
.footer h5, footer h5 {
    color: white;
    font-weight: 700;
    margin-bottom: 1.5rem;
}
.footer h5::after, footer h5::after {
    display: none;
}
.footer a, footer a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
    display: inline-block;
}
.footer a:hover, footer a:hover {
    color: white;
    transform: translateX(-5px);
}
.footer .social-links a, footer .social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-left: 0.5rem;
    transition: var(--transition);
}
.footer .social-links a:hover, footer .social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}
/* ============================================
   الصفحة الرئيسية - Hero Section
   ============================================ */
.hero-section {
    background: var(--dark-bg);
    color: white;
    padding: 4rem 0;
    margin: -1.5rem -12px 2rem -12px;
    width: calc(100% + 24px);
}
.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
}
.hero-section p {
    font-size: 1.1rem;
    opacity: 0.9;
}
/* ============================================
   بطاقات الدورات والاختبارات المحسنة
   ============================================ */
.course-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    height: 100%;
}
.course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.course-card .card-img-top, .quiz-card .card-img-top {
    height: 200px;
    object-fit: cover;
    position: relative;
}
.course-card .card-img-top::after, .quiz-card .card-img-top::after {
    display: none;
}
.course-card .card-body, .quiz-card .card-body {
    padding: 1.5rem;
}
.course-card .card-title, .quiz-card .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.course-card .card-text, .quiz-card .card-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* شارة السعر */
.price-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 2;
}
.price-badge.free {
    background: var(--success-color);
}
/* شارة المعلم */
.teacher-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--light-bg);
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.teacher-badge img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}
/* ============================================
   صفحة تفاصيل الاختبار/الدورة
   ============================================ */
.detail-header {
    background: var(--dark-bg);
    color: white;
    padding: 3rem 0;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
}
.detail-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: white;
}
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
}
.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.9;
}
.detail-meta-item i {
    font-size: 1.1rem;
}
/* ============================================
   أيقونات الميزات
   ============================================ */
.feature-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}
.feature-icon.primary {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
}
.feature-icon.success {
    background: rgba(30, 96, 85, 0.1);
    color: var(--success-color);
}
.feature-icon.warning {
    background: rgba(246, 156, 8, 0.1);
    color: var(--warning-color);
}
.feature-box:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}
/* ============================================
   نتائج الاختبار
   ============================================ */
.result-card {
    text-align: center;
    padding: 3rem 2rem;
}
.result-score {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    position: relative;
}
.result-score.excellent {
    background: var(--success-color);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}
.result-score.good {
    background: var(--primary-color);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}
.result-score.average {
    background: var(--warning-color);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.3);
}
.result-score.poor {
    background: var(--danger-color);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}
.result-score::after {
    content: '%';
    font-size: 1.5rem;
    font-weight: 600;
}
/* ============================================
   الملف الشخصي
   ============================================ */
.profile-header {
    background: var(--dark-bg);
    color: white;
    padding: 3rem;
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
.profile-header::before {
    display: none;
}
.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.profile-name {
    font-size: 1.75rem;
    font-weight: 800;
    margin-top: 1rem;
}
.profile-role {
    opacity: 0.9;
    font-size: 1rem;
}
/* ============================================
   القسم الفارغ
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}
.empty-state i {
    font-size: 5rem;
    opacity: 0.3;
    margin-bottom: 1.5rem;
}
.empty-state h4 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}
.empty-state p {
    margin-bottom: 1.5rem;
}
/* ============================================
   التحميل - Loading
   ============================================ */
.loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-bg);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.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;
    backdrop-filter: blur(5px);
}
/* ============================================
   الموديال - Modal
   ============================================ */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}
.modal-header {
    background: var(--dark-bg);
    color: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.25rem 1.5rem;
}
.modal-header .btn-close {
    filter: brightness(0) invert(1);
}
.modal-body {
    padding: 1.5rem;
}
.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}
/* ============================================
   التصفح - Pagination
   ============================================ */
.pagination {
    gap: 0.25rem;
}
.page-link {
    border: none;
    border-radius: var(--radius-md) !important;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-weight: 600;
    transition: var(--transition);
}
.page-link:hover {
    background: var(--light-bg);
    color: var(--primary-color);
    transform: translateY(-2px);
}
.page-item.active .page-link {
    background: var(--primary-color);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
/* ============================================
   التبويبات - Tabs
   ============================================ */
.nav-tabs {
    border: none;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.nav-tabs .nav-link {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    font-weight: 600;
    transition: var(--transition);
}
.nav-tabs .nav-link:hover {
    border-color: var(--primary-light);
    color: var(--primary-color);
}
.nav-tabs .nav-link.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}
/* ============================================
   شريط البحث
   ============================================ */
.search-box {
    position: relative;
}
.search-box input {
    padding-right: 3rem;
    border-radius: 50px;
    background: var(--card-bg);
}
.search-box i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}
/* ============================================
   التقييم بالنجوم
   ============================================ */
.rating {
    display: inline-flex;
    gap: 0.25rem;
}
.rating i {
    color: #fbbf24;
    font-size: 1rem;
}
.rating i.empty {
    color: #d1d5db;
}
/* ============================================
   تأثيرات التمرير
   ============================================ */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}
.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}
/* ============================================
   تحسينات الموبايل
   ============================================ */
@media (max-width: 991px) {
    .navbar-collapse {
        background: white;
        border-radius: var(--radius-lg);
        padding: 1rem;
        margin-top: 1rem;
        box-shadow: var(--shadow-lg);
    }
    .navbar .nav-link {
        color: var(--text-primary) !important;
    }
    .navbar .nav-link:hover {
        background: var(--light-bg);
    }
    .hero-section h1 {
        font-size: 2rem;
    }
}
@media (max-width: 576px) {
    .stat-card {
        padding: 1.25rem;
    }
    .stat-card .stat-value {
        font-size: 1.75rem;
    }
    .card-body {
        padding: 1rem;
    }
    .upload-stats {
        grid-template-columns: 1fr;
    }
    .result-score {
        width: 140px;
        height: 140px;
        font-size: 2.5rem;
    }
    .profile-header {
        padding: 2rem 1.5rem;
        text-align: center;
    }
    .profile-avatar {
        width: 100px;
        height: 100px;
    }
}
/* ============================================
   أدوات مساعدة
   ============================================ */
.text-gradient {
    color: var(--primary-color);
}
.bg-gradient-primary {
    background: var(--primary-color);
}
.hover-lift {
    transition: var(--transition);
}
.hover-lift:hover {
    transform: translateY(-5px);
}
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
/* تحسين الظل للعناصر */
.shadow-soft {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}
.shadow-glow {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.25);
}
/* ============================================
   تنسيق خاص للوحة التحكم
   ============================================ */
.dashboard-welcome {
    background: var(--dark-bg);
    color: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
.dashboard-welcome::before {
    display: none;
}
.dashboard-welcome h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.quick-action-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}
.quick-action-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}
.quick-action-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}
/* ============================================
   تنسيق صفحة تفاصيل الاختبار/الدورة
   ============================================ */
.detail-header {
    background: var(--dark-bg);
    color: white;
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
.detail-header::before {
    display: none;
}
.detail-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}
.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}
.detail-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    opacity: 0.9;
}
.detail-meta-item i {
    font-size: 1.1rem;
}
/* شارة السعر */
.price-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--warning-color);
    color: #1e293b;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
    z-index: 10;
}
.price-badge.free {
    background: var(--success-color);
    color: white;
}
/* شارة المعلم */
.teacher-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.teacher-badge i {
    font-size: 1.2rem;
    color: var(--primary-color);
}
/* بطاقة بدء الاختبار */
.quiz-start-card .card-header {
    background: var(--dark-bg);
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.25rem 1.5rem;
}
.quiz-start-card .card-header h5 {
    color: white;
    margin: 0;
}
/* تقدم الاختبار */
.quiz-progress .progress {
    background: var(--light-bg);
    overflow: hidden;
}
.quiz-progress .progress-bar {
    background: var(--primary-color);
}
/* خيارات الأسئلة */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.options-list .option-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--light-bg);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}
.options-list .option-item:hover {
    background: white;
    border-color: var(--primary-light);
    transform: translateX(-5px);
}
.options-list .option-item.selected {
    background: rgba(16, 185, 129, 0.08);
    border-color: var(--primary-color);
}
.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.option-text {
    flex: 1;
}
.options-list.true-false .option-item {
    justify-content: center;
    font-weight: 600;
}
/* بطاقة الشراء */
.purchase-card {
    border: 2px solid var(--warning-color);
}
.price-display {
    padding: 1rem;
    background: rgba(246, 156, 8, 0.1);
    border-radius: var(--radius-md);
    display: inline-block;
}
/* ============================================
   تنسيق بطاقات الدورات
   ============================================ */
.course-card {
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}
.course-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}
.course-card .card-img-top {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.course-card .card-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
}
/* ============================================
   تحسينات إضافية للاستجابة
   ============================================ */
@media (max-width: 768px) {
    .detail-header {
        padding: 1.5rem;
        margin-top: 0 !important;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }
    .detail-header h1 {
        font-size: 1.5rem;
    }
    .detail-meta {
        gap: 1rem;
    }
    .detail-meta-item {
        font-size: 0.85rem;
    }
    .options-list .option-item {
        padding: 0.875rem 1rem;
    }
    .option-letter {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
}
