/* shared-styles.css - ملف الأنماط المشترك لجميع أجزاء الباب الثالث */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 40px;
}

.brand-mini {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    border-radius: 10px;
    color: white;
    font-weight: bold;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 3px solid #1e3a8a;
    padding-bottom: 20px;
}

.header h1 {
    color: #1e293b;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.mode-badge {
    display: inline-block;
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
}

.mode-badge.learning {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.mode-badge.exam {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* Timer (Exam Mode Only) */
.timer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-radius: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #991b1b;
}

.timer-icon {
    font-size: 2rem;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 30px;
}

.progress-text {
    text-align: center;
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.progress-bar {
    width: 100%;
    height: 25px;
    background: #e2e8f0;
    border-radius: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.progress-fill.learning {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

.progress-fill.exam {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

/* Question Card */
.question-card {
    background: #f7fafc;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    border: 2px solid #e2e8f0;
}

.question-number {
    display: inline-block;
    background: #1e3a8a;
    color: white;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: bold;
    margin-bottom: 15px;
}

.category-badge {
    display: inline-block;
    background: #e0f2fe;
    color: #075985;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    margin-right: 10px;
}

.question-text {
    font-size: 1.3rem;
    color: #1e293b;
    margin: 20px 0 25px 0;
    line-height: 1.6;
}

/* Answers */
.answers-container,
.answers-grid {
    display: grid;
    gap: 15px;
    grid-template-columns: 1fr 1fr;
}

.answer-btn {
    background: white;
    border: 2px solid #cbd5e0;
    border-radius: 10px;
    padding: 18px 25px;
    font-size: 1.1rem;
    text-align: right;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.answer-btn:hover:not(:disabled) {
    background: #edf2f7;
    border-color: #1e3a8a;
    transform: translateX(-5px);
}

.answer-btn.selected {
    background: #dbeafe;
    border-color: #3b82f6;
}

.answer-btn.correct {
    background: #d1fae5;
    border-color: #22c55e;
    color: #065f46;
}

.answer-btn.wrong {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

.answer-btn:disabled {
    cursor: not-allowed;
}

/* Feedback Box (Learning Mode) */
.feedback-box {
    margin-top: 20px;
    padding: 20px;
    border-radius: 10px;
    display: none;
}

.feedback-box.correct {
    background: #d1fae5;
    border: 2px solid #22c55e;
    color: #065f46;
}

.feedback-box.wrong {
    background: #fee2e2;
    border: 2px solid #ef4444;
    color: #991b1b;
}

.feedback-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.feedback-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.feedback-text,
.feedback-explanation {
    font-size: 1.1rem;
    line-height: 1.8;
    white-space: pre-line;
}

/* Next Button */
.next-btn {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.next-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(30, 58, 138, 0.4);
}

/* Navigation Buttons (Exam Mode) */
.navigation-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.nav-btn,
.submit-btn {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover,
.submit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(30, 58, 138, 0.4);
}

.submit-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Results Screen (Exam Mode) */
.results-screen {
    display: none;
    text-align: center;
    padding: 40px;
}

.results-card {
    background: #f7fafc;
    border-radius: 15px;
    padding: 40px;
}

.results-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.results-title {
    font-size: 2rem;
    color: #1e293b;
    margin-bottom: 15px;
}

.score-display {
    font-size: 3rem;
    font-weight: bold;
    color: #1e3a8a;
    margin: 20px 0;
}

.percentage-display {
    font-size: 2rem;
    color: #4a5568;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.stat-item {
    background: white;
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
}

.stat-item.correct {
    border-color: #22c55e;
    background: #f0fdf4;
}

.stat-item.wrong {
    border-color: #ef4444;
    background: #fef2f2;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
}

.stat-item.correct .stat-number {
    color: #22c55e;
}

.stat-item.wrong .stat-number {
    color: #ef4444;
}

.stat-label {
    font-size: 1.1rem;
    margin-top: 10px;
    color: #4a5568;
}

.score-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin: 30px auto;
    max-width: 400px;
}

.score-number {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.score-text {
    font-size: 1.2rem;
}

.results-details {
    background: #f7fafc;
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: right;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 1.1rem;
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    color: #4a5568;
}

.result-value {
    font-weight: bold;
    color: #1e293b;
}

.correct-value {
    color: #22c55e;
}

.wrong-value {
    color: #ef4444;
}

.grade-badge {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 20px;
    font-size: 1.3rem;
    font-weight: bold;
    margin: 20px 0;
}

.grade-badge.excellent {
    background: #d1fae5;
    color: #065f46;
}

.grade-badge.very-good {
    background: #bfdbfe;
    color: #1e40af;
}

.grade-badge.good {
    background: #fef3c7;
    color: #92400e;
}

.grade-badge.needs-review {
    background: #fee2e2;
    color: #991b1b;
}

.grade-excellent {
    background: #d1fae5;
    color: #065f46;
}

.grade-good {
    background: #dbeafe;
    color: #1e40af;
}

.grade-pass {
    background: #fef3c7;
    color: #92400e;
}

.grade-fail {
    background: #fee2e2;
    color: #991b1b;
}

/* Completion Screen (Learning Mode) */
.completion-screen {
    display: none;
    text-align: center;
    padding: 40px;
}

.completion-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.completion-title {
    font-size: 2rem;
    color: #1e293b;
    margin-bottom: 15px;
}

.completion-message {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 30px;
    line-height: 1.8;
}

.stats-card {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin: 20px 0;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
}

.stat-label {
    font-size: 1.2rem;
    margin-top: 10px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.home-btn,
.retry-btn,
.exam-btn,
.review-btn {
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    border: none;
}

.home-btn {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
}

.retry-btn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.exam-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.review-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.home-btn:hover,
.retry-btn:hover,
.exam-btn:hover,
.review-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(30, 58, 138, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 25px;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .timer-container {
        font-size: 1.2rem;
    }
}
