/* منصة اختباري التعليمية - الأنماط الرئيسية */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --success-light: #34d399;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f1f5f9;
    --dark-bg: #1e293b;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    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: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
    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: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* الإحصائيات */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transform: rotate(-45deg);
}

.stat-card.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    color: white;
}

.stat-card.danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
}

.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: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-light) 0%, var(--success-color) 100%);
    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(99, 102, 241, 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-md);
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    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: rgba(99, 102, 241, 0.05);
}

/* شارات الحالة */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.8rem;
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%) !important;
    color: white;
}

.badge.bg-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%) !important;
}

/* بطاقات الاختبارات */
.quiz-card {
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: var(--transition);
}

.quiz-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.quiz-card .card-img-top {
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
}

.quiz-card .quiz-price {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
}

.quiz-card .quiz-free {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

/* الشريط الجانبي */
.sidebar {
    background: var(--card-bg);
    border-radius: 0;
    box-shadow: var(--shadow-lg);
    border-left: 1px solid var(--border-color);
}

.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: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: var(--primary-color);
    transform: translateX(-4px);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.sidebar .nav-link i {
    width: 28px;
    font-size: 1.1rem;
}

/* رابط الإحالة */
.referral-box {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.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: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.15) 100%);
    color: #059669;
    border-right: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%);
    color: #dc2626;
    border-right: 4px solid var(--danger-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(79, 70, 229, 0.15) 100%);
    color: var(--primary-dark);
    border-right: 4px solid var(--primary-color);
}

/* صفحة تسجيل الدخول */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 50%, #a855f7 100%);
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: float 60s linear infinite;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-xl), 0 30px 60px rgba(0,0,0,0.2);
    max-width: 450px;
    width: 100%;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(20px);
}

/* Responsive */
@media (max-width: 768px) {
    .stat-card .stat-value {
        font-size: 2rem;
    }

    .auth-card {
        margin: 1rem;
        padding: 2rem;
    }

    .sidebar {
        width: 100% !important;
        min-height: auto !important;
    }
}

/* الأسئلة */
.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: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.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(99, 102, 241, 0.1);
}

.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: linear-gradient(90deg, var(--primary-color) 0%, var(--success-color) 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
    position: relative;
}

.upload-progress-bar .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@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: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    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: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    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: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
}
