/* ==============================================
   ملف CSS الرئيسي - اختبار نظرية القيادة
   مصمم للقراءة السهلة على جميع الأجهزة
=============================================== */

/* ---------- إعدادات عامة ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* حجم الخط الأساسي - أكبر من المعتاد للقراءة السهلة */
html {
    font-size: 18px;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    line-height: 1.6;
    color: #2c3e50;
}

/* ---------- الحاويات الرئيسية ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ---------- الهيدر (الرأس) ---------- */
.site-header {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo a {
    color: white !important;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: bold;
}

.logo span {
    color: #f39c12;
}

.nav-menu {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-menu a {
    color: white !important;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 1rem;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: #f39c12 !important;
    color: #2c3e50 !important;
}

/* ---------- الأزرار العامة ---------- */
.btn, button, .btn-next, .btn-prev, .btn-primary, .btn-secondary {
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #27ae60;
    color: white;
}

.btn-primary:hover {
    background: #219a52;
    transform: translateY(-3px);
}

.btn-secondary {
    background: #e67e22;
    color: white;
}

.btn-secondary:hover {
    background: #d35400;
    transform: translateY(-3px);
}

/* ---------- بطاقات التصنيفات (Categories) ---------- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.category-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    text-decoration: none;
    color: #2c3e50;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px rgba(0,0,0,0.15);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.category-card h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.category-card p {
    font-size: 1rem;
    color: #7f8c8d;
}

/* ---------- بطاقات الإحصائيات ---------- */
.stats-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin: 40px 0;
}

.stat-card {
    background: white;
    padding: 30px 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    min-width: 180px;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: #27ae60;
}

.stat-label {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin-top: 10px;
}

/* ---------- صفحة الممارسة (practice.php) ---------- */
.question-container {
    background: white;
    border-radius: 25px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.question-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    line-height: 1.4;
    color: #2c3e50;
}

.question-image {
    text-align: center;
    margin-bottom: 25px;
}

.question-image img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 15px;
    border: 1px solid #ddd;
}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 25px 0;
}

.answer-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.answer-option:hover {
    background: #f8f9fa;
    border-color: #3498db;
}

.answer-option.selected,
.answer-option.correct-highlight {
    background: #d4edda;
    border-color: #28a745;
}

.answer-option.incorrect-highlight {
    background: #f8d7da;
    border-color: #dc3545;
}

.answer-text {
    flex: 1;
    font-size: 1.1rem;
}

/* ---------- صندوق الشرح (Feedback) ---------- */
.feedback-box {
    background: #e9ecef;
    padding: 20px;
    border-radius: 15px;
    margin: 25px 0;
    border-left: 6px solid #27ae60;
}

.feedback-box h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.feedback-text {
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
}

/* ---------- صفحة الاختبار الفعلي (test.php) ---------- */
.exam-container {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 20px;
}

.exam-header {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    color: white;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 30px;
}

.exam-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.question-counter, .timer {
    font-size: 1.1rem;
    background: rgba(255,255,255,0.2);
    padding: 8px 18px;
    border-radius: 30px;
}

.timer {
    background: #e67e22;
}

/* ---------- صفحة النتائج ---------- */
.result-container {
    max-width: 600px;
    margin: 60px auto;
    padding: 0 20px;
}

.result-card {
    background: white;
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.score-number {
    font-size: 3.5rem;
    font-weight: bold;
    color: #27ae60;
    margin: 20px 0;
}

.pass-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 15px;
    font-size: 1.2rem;
    margin: 20px 0;
}

.fail-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 15px;
    font-size: 1.2rem;
    margin: 20px 0;
}

/* ---------- صفحة تسجيل الدخول (admin/login.php) ---------- */
.login-box {
    background: white;
    padding: 40px;
    border-radius: 20px;
    width: 350px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.login-box input {
    width: 100%;
    padding: 14px;
    margin: 12px 0;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
}

.login-box button {
    width: 100%;
    background: #27ae60;
    color: white;
    padding: 14px;
    border-radius: 10px;
    font-size: 1.1rem;
}

/* ---------- إخلاء المسؤولية والتذييل ---------- */
.disclaimer {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #6c757d;
    text-align: center;
    margin: 30px 0;
}

/* ==============================================
   تحسينات خاصة للجوال (Mobile)
   ============================================== */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }
    
    .container {
        padding: 15px;
    }
    
    .site-header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .logo a {
        font-size: 1.2rem;
    }
    
    .nav-menu {
        justify-content: center;
        gap: 8px;
    }
    
    .nav-menu a {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .question-text {
        font-size: 1.3rem;
    }
    
    .answer-text {
        font-size: 1rem;
    }
    
    .answer-option {
        padding: 12px 15px;
    }
    
    .stat-card {
        padding: 20px 25px;
        min-width: 140px;
    }
    
    .stat-number {
        font-size: 2.2rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    .category-card h3 {
        font-size: 1.2rem;
    }
    
    .btn, button, .btn-next, .btn-prev {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .exam-stats {
        flex-direction: column;
        text-align: center;
    }
    
    .result-card {
        padding: 25px;
    }
    
    .score-number {
        font-size: 2.5rem;
    }
}

/* للشاشات الصغيرة جداً (أقل من 480px) */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-container {
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px 20px;
    }
    
    .login-box {
        width: 90%;
        padding: 25px;
    }
}

/* للأجهزة اللوحية */
@media (min-width: 769px) and (max-width: 1024px) {
    html {
        font-size: 17px;
    }
    
    .container {
        padding: 25px;
    }
}

/* للشاشات الكبيرة */
@media (min-width: 1025px) {
    html {
        font-size: 18px;
    }
    
    .container {
        padding: 30px;
    }
    
}
