/* MCQ Exams Page */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #818cf8;
    --success-color: #10b981;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 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);
    --transition: all 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Page Header */
.page-header {
    text-align: center;
    padding: 5rem 2rem;
    margin: 0 auto 3rem;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 0 0 1rem;
    position: relative;
    display: inline-block;
}

.page-header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
}

.page-header p {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Exams Grid */
.exams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0 4rem;
}

@media (min-width: 1200px) {
    .exams-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 900px) and (max-width: 1199px) {
    .exams-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 600px) and (max-width: 899px) {
    .exams-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .exams-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        padding: 3rem 1.5rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
}

/* Exam Card */
.exam-card {
    background: #fff;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.exam-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0.8;
}

.exam-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.exam-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 1.5rem 1.5rem 1rem;
    line-height: 1.4;
}

.exam-card > p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 1.5rem 1.25rem;
    flex-grow: 1;
}

.exam-details {
    background: var(--bg-light);
    padding: 1.25rem 1.5rem;
    margin: 0 0 1.5rem;
    border-radius: 0.5rem;
    border-left: 3px solid var(--primary-color);
}

.exam-details p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0.5rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.exam-details p strong {
    color: var(--text-color);
    min-width: 80px;
    display: inline-block;
}

.btn-start-exam {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    margin: 0 1.5rem 1.5rem;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-start-exam:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.text-muted {
    color: var(--text-light);
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
    padding: 0 1.5rem 1.5rem;
    margin: 0;
}

.no-exams {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-light);
    border-radius: 0.75rem;
    border: 1px dashed var(--border-color);
}

.no-exams p {
    font-size: 1.125rem;
    color: var(--text-light);
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
}

/* Setup Notice */
.setup-notice {
    max-width: 800px;
    margin: 3rem auto;
    padding: 2.5rem;
    background: #fff3f3;
    border-left: 4px solid #ff4d4f;
    border-radius: 0.5rem;
    text-align: center;
}

.setup-notice h2 {
    color: #ff4d4f;
    margin-top: 0;
    margin-bottom: 1rem;
}

.setup-notice p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn-setup {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 20px;
}

/* Take Exam Page */
.exam-container {
    max-width: 800px;
    margin: 20px auto;
}

.exam-header {
    background: #007bff;
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
}

.exam-header h1 {
    margin: 0 0 10px 0;
}

.exam-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exam-quotations {
    margin-top: 15px;
    font-size: 0.95em;
    line-height: 1.6;
    font-style: italic;
}

#exam-form {
    background: white;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-info-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.user-info-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.question-content h3 {
    margin-bottom: 15px;
    color: #333;
}

.options .option {
    display: block;
    padding: 10px;
    margin: 5px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.options .option:hover {
    background: #f0f0f0;
}

.options .option input {
    margin-right: 10px;
}

.exam-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.btn-nav, .btn-submit-exam {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: white;
}

.btn-nav {
    background: #007bff;
}

.btn-submit-exam {
    background: #28a745;
}

/* Exam Result Page */
.result-container {
    max-width: 800px;
    margin: 40px auto;
}

.result-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 8px 8px 0 0;
    text-align: center;
}

.result-header h1 {
    margin: 0 0 10px 0;
}

.result-content {
    background: white;
    padding: 30px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.score-card {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.score-display {
    font-size: 3em;
    font-weight: bold;
    color: #007bff;
    margin: 10px 0;
}

.percentage-display {
    font-size: 1.5em;
    color: #666;
    margin: 10px 0;
}

.feedback {
    font-weight: bold;
    margin: 10px 0;
}

.feedback-excellent { color: #28a745; }
.feedback-good { color: #ffc107; }
.feedback-neutral { color: #dc3545; }

.question-review-section h3 {
    color: #333;
    margin-bottom: 15px;
}

.question-review {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.question-review.correct { background: #d4edda; }
.question-review.incorrect { background: #f8d7da; }

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.review-header h4 {
    margin: 0;
    color: #333;
}

.status-badge {
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
}

.question-review.correct .status-badge { background: #28a745; }
.question-review.incorrect .status-badge { background: #dc3545; }

.review-options {
    margin-left: 20px;
}

.review-option {
    margin: 5px 0;
}

.correct-tick { color: #28a745; }
.your-answer { color: #dc3545; }
.no-answer { margin-top: 10px; color: #dc3545; font-style: italic; }

.result-actions {
    text-align: center;
    margin-top: 30px;
}

.result-actions .btn-primary,
.result-actions .btn-secondary {
    display: inline-block;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 4px;
    margin: 0 10px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}
