/* css/style.css */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --dark-color: #1e1e2f;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --border-radius: 12px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    background: white;
    padding: 20px 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    text-decoration: none;
    color: var(--gray-color);
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

nav a:hover,
nav a.active {
    background: var(--primary-color);
    color: white;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    background: white;
    padding: 60px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
}

.hero-content h2 {
    font-size: 2.5rem;
    color: var(--dark-color);
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--gray-color);
    margin-bottom: 30px;
}

.hero-image i {
    font-size: 15rem;
    color: var(--primary-color);
    opacity: 0.2;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: 'Tajawal', sans-serif;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover {
    background: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,152,0,0.3);
}

.btn-block {
    width: 100%;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.2rem;
}

.btn-platform {
    background: white;
    color: var(--primary-color);
    padding: 15px 35px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 15px;
}

.btn-platform:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Features Section */
.features {
    margin-top: 60px;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    color: white;
    margin-bottom: 40px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background: white;
    padding: 40px 30px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.feature-card p {
    color: var(--gray-color);
}

/* تحسينات الصفحة الرئيسية */
.hero-content h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.highlight {
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0.3;
    border-radius: 4px;
}

.hero-description {
    font-size: 1.3rem;
    color: var(--gray-color);
    margin-bottom: 25px;
}

.features-badges {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.features-badges .badge {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.features-badges .badge i {
    color: var(--primary-color);
}

/* قسم المنصة التعليمية */
.platform-section {
    margin: 80px 0;
}

.platform-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 40px;
    padding: 50px;
    display: grid;
    grid-template-columns: 1fr 0.8fr;
    gap: 40px;
    align-items: center;
    color: white;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.platform-tag {
    background: rgba(255,255,255,0.2);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 20px;
    backdrop-filter: blur(5px);
}

.platform-content h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
}

.platform-description {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.6;
}

.platform-features {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.platform-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.15);
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 1rem;
}

.platform-feature i {
    font-size: 1.2rem;
}

.platform-image i {
    font-size: 12rem;
    color: rgba(255,255,255,0.2);
}

.platform-note {
    font-size: 0.95rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* قسم الإحصائيات */
.stats-section {
    margin: 60px 0;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    background: white;
    padding: 40px;
    border-radius: 30px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.stat-item-large {
    text-align: center;
}

.stat-item-large i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark-color);
    line-height: 1.2;
}

.stat-item-large .stat-label {
    font-size: 1.1rem;
    color: var(--gray-color);
}

/* خطوات الاستخدام */
.how-to-use {
    margin: 80px 0;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.step-card {
    background: white;
    padding: 35px 25px;
    border-radius: 25px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.step-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 20px;
}

.step-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.step-card h4 {
    font-size: 1.3rem;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.step-card p {
    color: var(--gray-color);
    line-height: 1.5;
}

/* قسم الدعوة */
.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 40px;
    padding: 60px;
    text-align: center;
    color: white;
    margin: 60px 0;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* فوتر الموقع */
.footer {
    background: var(--dark-color);
    color: white;
    border-radius: 30px 30px 0 0;
    padding: 50px 30px 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-section h4 i {
    color: var(--primary-color);
}

.footer-section p {
    opacity: 0.8;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.7;
    font-size: 0.9rem;
}

/* تحسينات صفحة عرض الاختبارات */
.exams-showcase {
    padding: 20px 0;
}

.showcase-header {
    text-align: center;
    margin-bottom: 40px;
}

.showcase-header h2 {
    font-size: 2.2rem;
    color: white;
    margin-bottom: 10px;
}

.showcase-header h2 i {
    margin-left: 10px;
}

.showcase-header p {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
}

/* فلترة وبحث */
.exams-filter {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.filter-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 25px;
    border: none;
    background: #f0f2f5;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    font-family: 'Tajawal', sans-serif;
}

.filter-btn:hover {
    background: #e0e0e0;
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* شبكة الاختبارات */
.exams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* بطاقة الاختبار */
.exam-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
    padding-top: 50px;
}

.exam-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.exam-card:hover .btn-start {
    background: var(--primary-color);
    color: white;
}

.exam-checkbox {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 2;
}

.exam-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.exam-card-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exam-icon i {
    font-size: 2.5rem;
    color: white;
    background: rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 15px;
}

.exam-badge {
    padding: 6px 15px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    color: white;
}

.exam-badge.popular {
    background: #ffd700;
    color: #333;
}

.exam-badge.new {
    background: #4caf50;
    color: white;
}

.exam-card-body {
    padding: 20px;
}

.exam-card-body h3 {
    font-size: 1.4rem;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.exam-subject {
    color: var(--gray-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.exam-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.exam-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 0.95rem;
}

.exam-stats i {
    color: var(--primary-color);
}

/* شريط التقدم */
.exam-progress {
    margin-bottom: 20px;
}

.progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: #666;
}

.exam-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.exam-footer span {
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-start {
    padding: 8px 20px;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Tajawal', sans-serif;
}

.btn-start:hover {
    background: var(--primary-color);
    color: white;
}

/* Student Form */
.student-form {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    max-width: 500px;
    margin: 0 auto;
    box-shadow: var(--box-shadow);
}

.student-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group label i {
    margin-left: 8px;
    color: var(--primary-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Tajawal', sans-serif;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* Exam Screen */
.exam-screen {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.exam-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exam-info h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.timer {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timer.warning {
    background: var(--danger-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.questions-container {
    padding: 30px;
}

.question-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.question-text {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.options-list {
    display: grid;
    gap: 15px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.option-item:hover {
    border-color: var(--primary-color);
    background: #f0f4ff;
}

.option-item.selected {
    border-color: var(--primary-color);
    background: #e8f0fe;
}

.option-item input[type="radio"] {
    margin-left: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.option-letter {
    width: 35px;
    height: 35px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-left: 15px;
    color: #666;
}

.option-item.selected .option-letter {
    background: var(--primary-color);
    color: white;
}

.option-text {
    flex: 1;
}

.exam-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #e0e0e0;
}

.question-nav {
    font-size: 1.1rem;
    color: var(--gray-color);
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

/* Results Screen */
.results-screen {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.results-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    align-items: center;
    margin: 40px 0;
}

.score-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-number {
    font-size: 3rem;
    font-weight: 800;
    color: white;
}

.score-details p {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.answers-review {
    margin-top: 40px;
}

.answers-review h3 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

.answer-item {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
}

.answer-item.correct {
    border-color: var(--success-color);
    background: #d4edda;
}

.answer-item.wrong {
    border-color: var(--danger-color);
    background: #f8d7da;
}

.answer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.answer-status {
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.correct .answer-status {
    background: #4caf50;
    color: white;
}

.wrong .answer-status {
    background: #f44336;
    color: white;
}

.student-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.student-summary p {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dark-color);
}

.student-summary i {
    color: var(--primary-color);
}

/* Admin Dashboard */
.admin-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
    background: #f4f7fc;
}

.sidebar {
    background: linear-gradient(180deg, var(--dark-color), #2d2d44);
    color: white;
    padding: 30px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
    font-size: 3rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.sidebar-header h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 5px;
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    margin: 20px;
    border-radius: 12px;
}

.admin-info i {
    font-size: 2rem;
    color: var(--primary-color);
}

.admin-info div {
    display: flex;
    flex-direction: column;
}

.admin-info span {
    font-weight: 700;
    font-size: 1rem;
}

.admin-info small {
    opacity: 0.7;
    font-size: 0.8rem;
}

.sidebar-nav {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    border-right: 4px solid transparent;
}

.sidebar-nav a i {
    font-size: 1.3rem;
    min-width: 25px;
    text-align: center;
}

.sidebar-nav a span {
    flex: 1;
    font-size: 1rem;
}

.sidebar-nav a .badge {
    background: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    margin-right: 5px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-right-color: var(--primary-color);
}

.sidebar-nav a.logout {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-radius: 0;
    color: #ff6b6b;
}

.sidebar-nav a.logout:hover {
    background: rgba(255,107,107,0.1);
    border-right-color: #ff6b6b;
}

.admin-main {
    padding: 30px;
    overflow-y: auto;
}

.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1.2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--primary-color);
}

.date-display {
    background: white;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    color: var(--gray-color);
}

.date-display i {
    color: var(--primary-color);
    margin-left: 8px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stats-grid.secondary {
    margin-top: 20px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    background: #e8f0fe;
    padding: 15px;
    border-radius: 12px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark-color);
}

.stat-label {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.stat-card.primary i { background: #e3f2fd; color: #1976d2; }
.stat-card.success i { background: #e8f5e9; color: #388e3c; }
.stat-card.warning i { background: #fff3e0; color: #f57c00; }
.stat-card.info i { background: #e1f5fe; color: #0288d1; }
.stat-card.purple i { background: #f3e5f5; color: #7b1fa2; }
.stat-card.orange i { background: #fff3e0; color: #f57c00; }
.stat-card.teal i { background: #e0f2f1; color: #00796b; }
.stat-card.pink i { background: #fce4ec; color: #c2185b; }

/* إحصائيات الطلاب */
.students-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: white;
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.stat-box i {
    font-size: 2.5rem;
    color: var(--primary-color);
    background: #e8f0fe;
    padding: 15px;
    border-radius: 12px;
}

.stat-big {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark-color);
    line-height: 1.2;
}

.stat-small {
    font-size: 0.9rem;
    color: var(--gray-color);
}

/* إحصائيات مصغرة */
.stats-mini {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.mini-stat {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mini-label {
    color: var(--gray-color);
    font-size: 0.95rem;
}

.mini-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* تحسينات إدارة الاختبارات */
.exams-toolbar {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.toolbar-left {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-right {
    flex: 1;
    max-width: 300px;
}

.search-box.small {
    position: relative;
}

.search-box.small i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-box.small input {
    width: 100%;
    padding: 10px 35px 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
}

/* شريط البحث */
.search-bar {
    position: relative;
    margin: 20px 0;
}

.search-bar i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-bar input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Tajawal', sans-serif;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.search-box-large {
    position: relative;
    margin: 15px 0;
}

.search-box-large i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-box-large input {
    width: 100%;
    padding: 15px 45px 15px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Tajawal', sans-serif;
}

/* رأس الفلتر */
.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filters-header h4 {
    color: var(--dark-color);
    font-size: 1.1rem;
}

.btn-clear {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-clear:hover {
    text-decoration: underline;
}

/* منصة التتويج */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin: 50px 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 30px;
    min-height: 300px;
}

.podium-item {
    text-align: center;
    color: white;
    position: relative;
    animation: podiumAppear 0.5s ease;
}

.podium-item.first {
    transform: scale(1.1);
}

.podium-item i {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.podium-item i.gold { color: #ffd700; }
.podium-item i.silver { color: #c0c0c0; }
.podium-item i.bronze { color: #cd7f32; }

.podium-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 15px;
    border: 3px solid rgba(255,255,255,0.5);
}

.first .podium-avatar {
    width: 100px;
    height: 100px;
    font-size: 3rem;
    border-color: gold;
}

.podium-name {
    font-weight: 700;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.podium-score {
    font-size: 1.2rem;
    background: rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 30px;
}

@keyframes podiumAppear {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* شبكة التحليلات */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.analytics-card {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.analytics-card h3 {
    margin-bottom: 20px;
    color: var(--dark-color);
    font-size: 1.2rem;
}

/* إحصائيات مفصلة */
.stats-detailed {
    background: white;
    padding: 30px;
    border-radius: 20px;
    margin-top: 30px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-label {
    min-width: 150px;
    color: var(--gray-color);
}

.detail-item .progress-bar {
    flex: 1;
    height: 10px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.detail-item .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

.detail-value {
    min-width: 50px;
    font-weight: 700;
    color: var(--dark-color);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.page-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.page-btn:hover {
    background: var(--primary-color);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: var(--gray-color);
}

/* Tables */
.table {
    width: 100%;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.table thead {
    background: var(--primary-color);
    color: white;
}

.table th,
.table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table-hover tbody tr:hover {
    background: #f0f4ff;
    cursor: pointer;
}

.table td .badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.badge-success { background: #4caf50; color: white; }
.badge-warning { background: #ff9800; color: white; }
.badge-danger { background: #f44336; color: white; }

.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* أزرار الإجراءات */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 8px;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
}

.btn-icon.view:hover { background: #2196f3; }
.btn-icon.edit:hover { background: #4caf50; }
.btn-icon.delete:hover { background: #f44336; }

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

.modal-lg {
    max-width: 800px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header i {
    color: var(--primary-color);
}

.close {
    font-size: 2rem;
    cursor: pointer;
    color: var(--gray-color);
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 2px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Auth Page */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-card {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.auth-header h2 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--gray-color);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.error-message {
    color: var(--danger-color);
    text-align: center;
    margin-bottom: 15px;
    font-weight: 500;
}

/* تبويبات الاختبارات */
.exams-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: white;
    padding: 10px;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 25px;
    border: none;
    background: transparent;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--gray-color);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

/* بطاقات الفلاتر */
.filters-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
}

.filter-group label i {
    margin-left: 5px;
    color: var(--primary-color);
}

.filter-select, .filter-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    transition: all 0.3s ease;
}

.filter-select:focus, .filter-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.stats-summary {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 2px dashed #eee;
}

.stats-summary span {
    color: var(--gray-color);
}

.stats-summary strong {
    color: var(--dark-color);
    font-size: 1.1rem;
}

/* تحسينات نموذج الطالب */
.student-form {
    max-width: 500px;
    margin: 40px auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-header i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.form-header h2 {
    color: var(--dark-color);
    margin-bottom: 10px;
}

.form-header p {
    color: var(--gray-color);
}

.required {
    color: var(--danger-color);
    margin-right: 3px;
}

.form-text {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-color);
    margin-top: 5px;
}

.exam-info-box {
    background: #e8f0fe;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-right: 4px solid var(--primary-color);
}

.exam-info-box h4 {
    color: var(--dark-color);
    margin-bottom: 10px;
}

.exam-info-box p {
    margin: 5px 0;
    color: var(--gray-color);
}

.exam-info-box i {
    color: var(--primary-color);
    margin-left: 8px;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* نافذة تسجيل الطالب */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    padding: 25px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.modal-header i {
    font-size: 2rem;
    color: var(--primary-color);
}

.modal-header h3 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin: 0;
}

.close {
    position: absolute;
    left: 25px;
    top: 25px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* تفاصيل الاختبار في النافذة */
.exam-details-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
}

.exam-details-card h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.exam-details-card p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.details-grid span {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.2);
    padding: 10px;
    border-radius: 10px;
}

.warning-note {
    background: rgba(255,193,7,0.2);
    padding: 12px;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #ffc107;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* شروط الاستخدام */
.terms-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.terms-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.terms-checkbox label {
    color: #666;
    cursor: pointer;
}

.terms-checkbox a {
    color: var(--primary-color);
    text-decoration: none;
}

.terms-checkbox a:hover {
    text-decoration: underline;
}

/* حالات خاصة */
.loading-spinner {
    text-align: center;
    padding: 50px;
    color: white;
    font-size: 1.2rem;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 15px;
}

.no-exams {
    text-align: center;
    padding: 50px;
    background: white;
    border-radius: 20px;
    grid-column: 1 / -1;
}

.no-exams i {
    font-size: 4rem;
    color: #ccc;
    margin-bottom: 15px;
}

.no-exams p {
    color: #666;
    font-size: 1.1rem;
}

/* تحسينات شاشة الاختبار */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.question-number {
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 0.95rem;
}

.question-score {
    color: #4caf50;
    font-weight: 600;
}

/* تحسينات نافذة التعديل */
#edit-questions-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    margin: 15px 0;
    background: #f8f9fa;
    border-radius: 12px;
}

#edit-questions-container .question-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#edit-questions-container .question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

#edit-questions-container .question-header h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* خيارات متجاوبة */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.student-badge {
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.chart-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.chart-card h3 {
    margin-bottom: 20px;
    color: var(--dark-color);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-card h3 i {
    color: var(--primary-color);
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.report-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.report-card h3 {
    margin-bottom: 20px;
    color: var(--dark-color);
}

/* أنيميشن */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.exam-card {
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal {
    animation: fadeIn 0.3s ease;
}

/* تجاوب مع الجوال */
@media (max-width: 1200px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .admin-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        width: 250px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-right: 0;
        width: 100%;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
    }

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 30px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }

    .results-card {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .exam-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .exams-filter {
        flex-direction: column;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .filter-tabs {
        width: 100%;
        justify-content: center;
    }
    
    .exams-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .exams-tabs {
        flex-wrap: wrap;
        border-radius: 10px;
    }
    
    .tab-btn {
        flex: 1;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-summary {
        flex-direction: column;
        gap: 10px;
    }
    
    .student-summary {
        grid-template-columns: 1fr;
    }
    
    .students-stats {
        grid-template-columns: 1fr;
    }
    
    .podium {
        flex-direction: column;
        align-items: center;
    }
    
    .podium-item.first {
        order: -1;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .detail-label {
        min-width: auto;
    }
    
    .detail-item .progress-bar {
        width: 100%;
    }
    
    .stats-mini {
        flex-direction: column;
        gap: 10px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 10px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .platform-card {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 30px;
    }
    
    .platform-features {
        justify-content: center;
    }
    
    .platform-image {
        display: none;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .steps-container {
        grid-template-columns: 1fr;
    }
    
    .cta-section {
        padding: 40px 20px;
    }
    
    .cta-content h2 {
        font-size: 1.8rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-section h4 {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .exams-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-left {
        justify-content: center;
    }
    
    .toolbar-right {
        max-width: 100%;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .btn {
        width: 100%;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .exam-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .timer {
        width: 100%;
        justify-content: center;
    }
    
    .nav-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-buttons .btn {
        width: 100%;
    }
    
    .modal-header {
        flex-direction: column;
        text-align: center;
    }
    
    .close {
        position: static;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .features-badges {
        flex-direction: column;
        align-items: center;
    }
}

/* تحسينات للطباعة */
@media print {
    .sidebar,
    .header,
    .exam-footer,
    .actions,
    .modal-footer,
    .btn,
    .nav-buttons,
    .menu-toggle,
    .exams-toolbar {
        display: none !important;
    }
    
    .admin-container {
        display: block;
    }
    
    .admin-main {
        padding: 0;
    }
    
    .table {
        box-shadow: none;
    }
    
    .results-card {
        break-inside: avoid;
    }
}






/* تحسينات للودينج ومنع التكرار */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#submit-exam {
    position: relative;
    transition: all 0.3s ease;
}

#submit-exam:disabled {
    background: #ccc;
    border-color: #ccc;
}

#submit-exam .fa-spinner {
    margin-left: 8px;
}

/* تحذير عند انتهاء الوقت */
.timer.warning {
    background: var(--danger-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(247, 37, 133, 0.7);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 20px 10px rgba(247, 37, 133, 0.3);
    }
}

/* رسالة تأكيد محسنة */
.modal-confirm {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.confirm-box {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 400px;
    text-align: center;
    animation: slideInUp 0.3s ease;
}

.confirm-box i {
    font-size: 4rem;
    color: var(--warning-color);
    margin-bottom: 15px;
}

.confirm-box h3 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.confirm-box p {
    color: var(--gray-color);
    margin-bottom: 20px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* نافذة التأكيد المدمجة */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.confirm-content {
    background: white;
    padding: 40px;
    border-radius: 25px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: slideInUp 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.confirm-icon {
    margin-bottom: 20px;
}

.confirm-icon i {
    font-size: 5rem;
    color: var(--warning-color);
    animation: pulse 1.5s infinite;
}

.confirm-content h3 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.confirm-content p {
    color: var(--gray-color);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-buttons .btn {
    min-width: 120px;
    padding: 12px 25px;
}

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* تحسينات للزر المعطل */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
}

.btn .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* تحسين استجابة الجوال لنافذة التأكيد */
@media (max-width: 480px) {
    .confirm-content {
        padding: 30px 20px;
    }
    
    .confirm-icon i {
        font-size: 4rem;
    }
    
    .confirm-content h3 {
        font-size: 1.5rem;
    }
    
    .confirm-buttons {
        flex-direction: column;
    }
    
    .confirm-buttons .btn {
        width: 100%;
    }
}



/* تحسينات لإدارة الخيارات */
.question-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.options-count {
    padding: 5px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
}

.options-count:focus {
    outline: none;
    border-color: var(--primary-color);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
    transition: all 0.3s ease;
}

/* إخفاء وإظهار الخيارات */
.option-1, .option-2, .option-3, .option-4 {
    transition: all 0.3s ease;
}

/* تحسينات للجوال */
@media (max-width: 768px) {
    .question-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .options-count {
        width: 100%;
    }
}


/* تحسينات أدوات Excel */
.excel-tools {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.excel-note {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: #fff3cd;
    border-right: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #856404;
}

.excel-note i {
    margin-left: 8px;
    color: #856404;
}