/**
 * My Custom MCQ Quiz - Stylesheet
 * Version: 4.5.2 (Updated for detailed review)
 */

/* --- GENERAL QUIZ STYLES --- */
.mcq-quiz-container { max-width: 700px; margin: 20px auto; padding: 20px; border: 1px solid #e0e0e0; border-radius: 12px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: #ffffff; box-shadow: 0 5px 25px rgba(0,0,0,0.07); }
.mcq-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 15px; }
.mcq-header h2 { margin: 0; font-size: 1.6em; color: #333; }
.mcq-header-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.mcq-timer { font-size: 1.2em; font-weight: bold; color: #d9534f; }
#mcq-progress-container { margin-bottom: 25px; }
#mcq-progress-bar-outer { width: 100%; background-color: #e9ecef; border-radius: 5px; height: 10px; overflow: hidden; }
#mcq-progress-bar-inner { width: 0%; height: 100%; background-color: #0073aa; transition: width 0.4s ease; }
#mcq-progress-text { text-align: right; font-size: 0.9em; color: #666; margin-top: 5px; }
#mcq-participant-info input { width: 100%; padding: 12px; margin-bottom: 10px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box; }

/* --- BUTTONS --- */
#mcq-start-quiz-btn, #mcq-retake-btn, #mcq-prev-btn, #mcq-next-btn, #mcq-submit-btn, .mcq-results-buttons button, .mcq-performance-load-button { display: inline-block; padding: 12px 25px; font-size: 1em; font-weight: bold; cursor: pointer; color: white; border: none; border-radius: 8px; transition: all 0.2s; -webkit-appearance: none; margin-top: 5px; }
#mcq-start-quiz-btn:hover, #mcq-retake-btn:hover, #mcq-prev-btn:hover, #mcq-next-btn:hover, #mcq-submit-btn:hover, .mcq-results-buttons button:hover, .mcq-performance-load-button:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
#mcq-start-quiz-btn, #mcq-next-btn { background-color: #0073aa; }
#mcq-submit-btn { background: linear-gradient(45deg, #28a745, #218838); }
#mcq-prev-btn { background-color: #6c757d; }
#mcq-submit-now-btn { padding: 8px 15px; font-size: 0.9em; background: #dc3545; border-radius: 6px; font-weight: bold; margin-top: 0; color:white; border:none; cursor:pointer; }
#mcq-submit-now-btn:hover { background: #c82333; transform: translateY(-1px); box-shadow: 0 2px 5px rgba(0,0,0,0.15); }
.mcq-results-buttons button { margin-right: 10px; margin-top: 15px; }
#mcq-view-results-btn, #mcq-view-paginated-review-btn { background-color: #0073aa; }
#mcq-view-full-review-btn { background-color: #17a2b8; }
#mcq-retake-btn { background-color: #6c757d; margin-right: 0; }
.mcq-performance-load-button { background-color: #28a745; padding: 15px 30px; font-size: 1.2em; }
.mcq-performance-load-button:hover { background-color: #218838; }

/* --- QUESTIONS & OPTIONS --- */
.mcq-question-slide { min-height: 150px; }
.mcq-question-text { font-size: 1.4em; margin-bottom: 25px; line-height: 1.4; font-weight: bold; color: #222; }
.mcq-options { list-style: none; padding: 0; }
.mcq-options li { margin-bottom: 12px; }
.mcq-options label { display: block; cursor: pointer; padding: 15px; border: 2px solid #ddd; border-radius: 8px; background-color: #fff; transition: all 0.2s ease-in-out; }
.mcq-options label:hover { border-color: #99c7e3; background-color: #f8fcff; }
.mcq-options input[type="radio"] { display: none; }
.mcq-options input[type="radio"] + span { display: block; position: relative; padding-left: 35px; }
.mcq-options input[type="radio"] + span::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border: 2px solid #ccc; border-radius: 50%; background: #fff; }
.mcq-options input[type="radio"] + span::after { content: ''; position: absolute; left: 5px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; border-radius: 50%; background: #0073aa; opacity: 0; transition: opacity 0.2s; }
.mcq-options input[type="radio"]:checked + span::before { border-color: #0073aa; }
.mcq-options input[type="radio"]:checked + span::after { opacity: 1; }

/* --- RESULTS & REVIEW STYLES --- */
#mcq-navigation { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; border-top: 1px solid #eee; padding-top: 20px; }
#mcq-results-area #mcq-score { font-size: 1.8em; font-weight: bold; text-align: center; margin-bottom: 20px; }
#mcq-review-wrapper, #mcq-full-review-wrapper { margin-top: 25px; border-top: 1px solid #eee; padding-top: 25px; }
.mcq-review-question-text { font-size: 1.3em; font-weight: bold; margin-bottom: 15px; color: #222; }
.mcq-review-answers p { padding: 10px; border-radius: 5px; margin: 5px 0; }
.mcq-review-answers .incorrect { background-color: #f8d7da; border: 1px solid #f5c6cb; }
.mcq-review-answers .correct { background-color: #d4edda; border: 1px solid #c3e6cb; }
.mcq-review-explanation { margin-top: 20px; padding: 15px; background: #eef7ff; border-left: 4px solid #0073aa; border-radius: 4px; }
.mcq-review-explanation h4 { margin: 0 0 10px 0; }
.mcq-review-explanation-content p, .mcq-review-explanation-content a { margin: 0; }
#mcq-review-navigation { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
#mcq-review-navigation button { background-color: #6c757d; }
#mcq-review-progress { font-size: 0.9em; color: #666; }
#mcq-full-review-wrapper h4 { margin-top: 0; }
.mcq-full-review-list { list-style: none; padding: 0; }
.mcq-full-review-item { padding: 15px; border-radius: 8px; margin-bottom: 15px; border: 1px solid #ddd; }
.mcq-full-review-item.correct { background-color: #f0f8f2; border-left: 5px solid #28a745; }
.mcq-full-review-item.incorrect { background-color: #fdf2f2; border-left: 5px solid #dc3545; }
.mcq-full-review-item p { margin: 0 0 8px 0; }
.mcq-full-review-item p:last-child { margin-bottom: 0; }
.mcq-full-review-qtext strong { font-size: 1.1em; }
.mcq-full-review-correct { font-weight: bold; color: #155724; }

/* --- NEW: STYLES FOR DETAILED 'ALL QUESTIONS' REVIEW --- */
.mcq-full-review-options {
    list-style: none;
    padding: 0;
    margin: 15px 0 5px 0;
}
.mcq-full-review-options li {
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    margin-bottom: 6px;
    border-radius: 6px;
    background-color: #f9f9f9;
}
.mcq-full-review-options .review-correct-answer {
    background-color: #d4edda;
    border-color: #c3e6cb;
    font-weight: bold;
    color: #155724;
}
.mcq-full-review-options .review-user-incorrect {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}
.review-option-label {
    font-size: 0.9em;
    font-style: italic;
    color: #555;
    margin-left: 8px;
}
.mcq-full-review-unanswered {
    font-style: italic;
    color: #6c757d;
    margin-top: 10px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
}

/* --- LEADERBOARD & PERFORMANCE STYLES --- */
.mcq-leaderboard-container, .mcq-performance-dashboard { margin-top: 20px; background: #ffffff; border-radius: 12px; padding: 25px; box-shadow: 0 5px 25px rgba(0,0,0,0.07); border: 1px solid #e0e0e0; }
.mcq-leaderboard-container h3, .mcq-performance-dashboard h3 { text-align: center; font-size: 1.8em; color: #333; margin-bottom: 25px; font-weight: bold; border-bottom: 2px solid #f0f0f0; padding-bottom: 15px; margin-top:0; }
.mcq-leaderboard-table { width: 100%; border-collapse: collapse; }
.mcq-leaderboard-table th, .mcq-leaderboard-table td { padding: 15px; text-align: left; border-bottom: 1px solid #f0f0f0; }
.mcq-leaderboard-table th { background: linear-gradient(45deg, #0073aa, #005a87); color: white; font-size: 1em; text-transform: uppercase; }
.mcq-leaderboard-table tbody tr:nth-child(even) { background-color: #f8f9fa; }
.mcq-leaderboard-table tbody tr:hover { background-color: #e9ecef; }
.mcq-leaderboard-table tbody tr:first-child { background-color: #fff3cd; font-weight: bold; }
.mcq-leaderboard-table tbody tr:first-child td:first-child::before { content: '🏆 '; }
.mcq-leaderboard-table td:first-child { font-weight: bold; font-size: 1.2em; color: #0073aa; }
.mcq-my-performance { display: flex; gap: 20px; justify-content: center; text-align: center; margin-bottom: 30px; padding-bottom: 30px; border-bottom: 1px solid #f0f0f0; flex-wrap: wrap; }
.mcq-perf-stat { background: #f8f9fa; padding: 20px; border-radius: 8px; border: 1px solid #e9ecef; }
.mcq-perf-value { display: block; font-size: 2em; font-weight: bold; color: #0073aa; }
.mcq-perf-label { font-size: 0.9em; color: #666; }
.mcq-performance-table .mcq-current-user-highlight { background-color: #eef7ff; font-weight: bold; }
.mcq-guest-label { font-size: 0.8em; color: #6c757d; font-style: italic; }
#mcq-performance-loader { text-align: center; padding: 20px; }
#mcq-performance-loader .spinner { float: none; vertical-align: middle; margin-left: 10px; visibility: hidden; }
#mcq-performance-loader .spinner.is-active { visibility: visible; }
.mcq-leaderboard-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid #eee; flex-wrap: wrap; gap: 10px; }
.mcq-last-updated { margin: 0; font-size: 0.9em; color: #666; }
.mcq-admin-refresh-wrapper { display: flex; align-items: center; }
.mcq-admin-refresh-wrapper .spinner { float: none; visibility: hidden; }
.mcq-admin-refresh-wrapper .spinner.is-active { visibility: visible; }
.mcq-refresh-status { color: green; margin-left: 10px; font-style: italic; }

/* --- LOGIN PROMPT --- */
.mcq-login-prompt { margin-top: 20px; background: #fff8e1; border: 1px solid #ffecb3; border-left: 5px solid #ffc107; padding: 20px; border-radius: 8px; text-align: center; }
.mcq-login-prompt p { margin: 0 0 15px 0; font-size: 1.1em; color: #665b3d; }
.mcq-login-prompt p:last-child { margin-bottom: 0; }
.mcq-login-button { display: inline-block; padding: 10px 20px; background-color: #0073aa; color: white !important; text-decoration: none; border-radius: 5px; font-weight: bold; margin: 5px; }
.mcq-login-button:hover { background-color: #005a87; }

/* --- ADMIN PREVIEW --- */
.mcq-admin-preview-container { max-width: 700px; margin: 20px auto; padding: 25px; border: 2px dashed #0073aa; border-radius: 12px; background: #f8fcff; }
.mcq-admin-preview-title { margin-top: 0; font-size: 1.6em; color: #005a87; text-align: center; border-bottom: 1px solid #e0e0e0; padding-bottom: 15px; margin-bottom: 15px; }
.mcq-preview-question { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #ddd; }
.mcq-preview-question .mcq-question-text { font-size: 1.4em; margin-bottom: 20px; font-weight: bold; color: #222; }
.mcq-admin-preview-container .mcq-options li { padding: 12px; border: 1px solid #e0e0e0; border-radius: 8px; margin-bottom: 8px; background-color: #fff; list-style-type: none; }
.mcq-correct-preview { background-color: #d4edda !important; border-color: #c3e6cb !important; font-weight: bold; color: #155724; }
.mcq-correct-preview::before { content: '✔ '; color: #28a745; margin-right: 8px; }


/* --- AGGRESSIVE MOBILE RESPONSIVE STYLES --- */
@media screen and (max-width: 767px) {
    body.mcq-quiz-active-mobile .mcq-full-width-override { max-width: none !important; width: 100% !important; padding: 0 !important; margin: 0 !important; }
    .mcq-quiz-container, .mcq-leaderboard-container, .mcq-performance-dashboard { width: 100%; max-width: 100%; padding: 15px; margin: 0; border-left: none; border-right: none; border-radius: 0; box-shadow: none; box-sizing: border-box; }
    .mcq-header { flex-direction: column; align-items: flex-start; }
    .mcq-header-controls { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
    .mcq-header h2 { font-size: 1.4em; }
    .mcq-question-text { font-size: 1.2em; }
    .mcq-options label { padding: 12px; }
    .mcq-results-buttons { display: flex; flex-direction: column; gap: 10px; }
    .mcq-results-buttons button { width: 100%; text-align: center; margin-left: 0; margin-right: 0; }
    .mcq-performance-load-button, #mcq-start-quiz-btn { width: 100%; }
    .mcq-my-performance { flex-direction: column; }
    .mcq-leaderboard-table th, .mcq-leaderboard-table td { padding: 10px 8px; font-size: 0.9em; }
}