/* --- Global Variables --- */
:root {
    --mpp-primary: #1a73e8;
    --mpp-correct: #28a745;
    --mpp-wrong: #dc3545;
    --mpp-seen: #0d6efd;
    --mpp-not-seen: #6c757d;
    /* ⭐ UPDATED: Highlight color is now black */
    --mpp-current-highlight: #000000;
    --mpp-text-dark: #212529;
    --mpp-text-light: #6c757d;
    --mpp-bg-light: #f8f9fa;
    --mpp-bg-white: #ffffff;
    --mpp-border-color: #dee2e6;
    --mpp-radius: 8px;
}

/* --- Wrapper and Top Bar --- */
#mpp-quiz-wrapper {
    background: var(--mpp-bg-white);
    max-width: 1400px;
    margin: 20px auto;
    border: 1px solid var(--mpp-border-color);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.mpp-top-bar {
    background-color: var(--mpp-primary);
    padding: 8px 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
}
.mpp-slider-nav {
    color: white;
    text-decoration: none;
    padding: 0 10px;
    font-size: 1.2rem;
    opacity: 0.8;
    cursor: pointer;
}
.mpp-top-slider {
    flex-grow: 1;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.mpp-top-slider::-webkit-scrollbar { display: none; }
.mpp-top-slider-btn {
    flex-shrink: 0;
    width: 38px; height: 38px;
    border-radius: var(--mpp-radius);
    border: 1px solid rgba(255,255,255,0.3);
    background-color: rgba(255,255,255,0.15);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mpp-top-slider-btn:hover { background-color: rgba(255,255,255,0.25); }
.mpp-top-slider-btn.current {
    border-color: var(--mpp-current-highlight);
    background-color: rgba(255,255,255,0.2);
    color: var(--mpp-current-highlight);
    font-weight: 700;
}
.mpp-top-slider-btn.correct { background-color: var(--mpp-correct); border-color: var(--mpp-correct); }
.mpp-top-slider-btn.wrong { background-color: var(--mpp-wrong); border-color: var(--mpp-wrong); }
.mpp-top-slider-btn.seen { /* Keep default transparent blue style */ }

/* --- Main Container --- */
#mpp-quiz-container { display: flex; height: 80vh; max-height: 700px; }
.mpp-quiz-main {
    flex: 3; display: flex; flex-direction: column;
    padding: 20px; min-width: 0; height: 100%;
}
.mpp-question-meta-header {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: 15px; margin-bottom: 15px; flex-shrink: 0;
}
.mpp-stopwatch, .mpp-score { font-size: 0.9rem; color: var(--mpp-text-light); }
.mpp-tag {
    display: inline-block; padding: 4px 10px; font-size: 0.75rem; font-weight: 500;
    color: var(--mpp-primary); background-color: #e9f4ff; border-radius: 12px; margin-left: 8px;
}
.mpp-question-area { flex-grow: 1; overflow-y: auto; padding-right: 15px; }
.mpp-question-header { font-size: 0.9rem; color: var(--mpp-text-light); margin-bottom: 16px; }
.mpp-question-text { font-size: 1.05rem; line-height: 1.7; margin-bottom: 24px; color: var(--mpp-text-dark); }
.mpp-question-text p { margin: 0 0 1em 0; }
.mpp-question-text p:last-child { margin-bottom: 0; }

/* --- Options --- */
.mpp-options-form { margin-top: 16px; }
.mpp-options-form .mpp-option {
    display: grid; grid-template-columns: auto 1fr auto;
    align-items: center; gap: 15px; padding: 16px; background-color: var(--mpp-bg-white);
    border: 1px solid var(--mpp-border-color); border-radius: var(--mpp-radius);
    margin-bottom: 12px; cursor: pointer; transition: all 0.2s ease;
}
.mpp-options-form .mpp-option:hover { border-color: var(--mpp-primary); box-shadow: 0 2px 8px #0000001a; }
.mpp-option .mpp-option-char {
    width: 32px; height: 32px; line-height: 32px; text-align: center; border-radius: 50%;
    background-color: var(--mpp-bg-light); border: 1px solid var(--mpp-border-color);
    font-weight: 500; transition: all 0.2s ease;
}
.mpp-option.selected .mpp-option-char { background-color: var(--mpp-primary); color: white; border-color: var(--mpp-primary); }
.mpp-option-label { font-size: 0.95rem; color: var(--mpp-text-dark); }
.mpp-answer-status { font-size: 0.8rem; font-weight: 500; padding: 3px 8px; border-radius: 4px; color: transparent; }
.mpp-answer-status.correct { background-color: #e7f8e7; color: #155724; }
.mpp-answer-status.wrong { background-color: #f8d7da; color: #721c24; }
.mpp-option.correct { border-color: var(--mpp-correct) !important; background-color: #f6fef6; }
.mpp-option.wrong { border-color: var(--mpp-wrong) !important; background-color: #fff8f8; }

/* --- Explanation & Controls --- */
.mpp-explanation-wrapper { margin-top: 24px; padding: 20px; background-color: #eef7ff; border-left: 4px solid var(--mpp-primary); border-radius: var(--mpp-radius); }
.mpp-explanation-wrapper h4 { margin-top: 0; color: #005a87; }
.mpp-explanation-text { color: var(--mpp-text-dark); line-height: 1.6; }
.mpp-controls { display: flex; justify-content: space-between; padding-top: 20px; margin-top: auto; flex-shrink: 0; }
.mpp-btn { padding: 10px 24px; border-radius: var(--mpp-radius); cursor: pointer; font-size: 0.95rem; font-weight: 500; transition: all 0.2s ease; border: 1px solid var(--mpp-border-color); }
.mpp-btn:disabled { cursor: not-allowed; opacity: 0.6; }
.mpp-btn-primary { background-color: var(--mpp-primary); color: white; border-color: var(--mpp-primary); }
.mpp-btn-primary:hover:not(:disabled) { background-color: #005a87; border-color: #005a87; }
.mpp-btn-secondary { background-color: var(--mpp-bg-white); color: var(--mpp-text-dark); }
.mpp-btn-secondary:hover:not(:disabled) { background-color: var(--mpp-bg-light); }

/* --- Sidebar (Right) --- */
.mpp-sidebar { flex: 1; display: flex; flex-direction: column; background: #fdfdfd; border-left: 1px solid var(--mpp-border-color); padding: 20px; transition: margin-right 0.3s ease; }
.mpp-sidebar-header { padding-bottom: 16px; border-bottom: 1px solid var(--mpp-border-color); flex-shrink: 0; }
.mpp-sidebar-header h3 { margin: 0 0 16px 0; color: var(--mpp-text-dark); }
.mpp-legend { font-size: 0.85rem; color: var(--mpp-text-light); }
.mpp-legend div { margin-bottom: 8px; display: flex; align-items: center; }
.mpp-legend .dot { height: 12px; width: 12px; border-radius: 50%; margin-right: 10px; }
.dot.correct { background-color: var(--mpp-correct); }
.dot.wrong { background-color: var(--mpp-wrong); }
.dot.seen { background-color: var(--mpp-seen); }
.dot.not-seen { background-color: var(--mpp-not-seen); }
.mpp-question-palette { flex-grow: 1; overflow-y: auto; padding: 16px 5px 5px 0; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 10px; }
.mpp-palette-btn { flex-shrink: 0; width: 42px; height: 42px; border-radius: var(--mpp-radius); border: 2px solid transparent; cursor: pointer; font-size: 1rem; font-weight: 500; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; }
.mpp-palette-btn:hover { transform: scale(1.08); }
.mpp-palette-btn.current { border-color: var(--mpp-current-highlight); }
.mpp-palette-btn.not-seen { background-color: var(--mpp-not-seen); color: white; }
.mpp-palette-btn.seen { background-color: var(--mpp-seen); color: white; }
.mpp-palette-btn.correct { background-color: var(--mpp-correct); color: white; }
.mpp-palette-btn.wrong { background-color: var(--mpp-wrong); color: white; }

/* --- Mobile Toggle & Responsiveness --- */
.mpp-mobile-palette-toggle { display: none; }
@media (max-width: 992px) {
    #mpp-quiz-container { position: relative; overflow-x: hidden; height: auto; max-height: none; }
    .mpp-sidebar {
        position: absolute; top: 0; right: 0; width: 280px; height: 100%;
        margin-right: -280px; z-index: 100; box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        background-color: var(--mpp-bg-white);
    }
    .mpp-sidebar.visible { margin-right: 0; }
    .mpp-mobile-palette-toggle {
        display: block; position: fixed; bottom: 20px; right: 20px;
        z-index: 101; padding: 10px 20px; background: var(--mpp-primary);
        color: white; border: none; border-radius: 50px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }
    .mpp-question-area { padding-right: 0; }
}
@media (max-width: 480px) {
    .mpp-controls { flex-direction: column; gap: 10px; }
    .mpp-btn { width: 100%; }
}