/* AP CSP topic MCQ (collaboration-style quiz UI) */

.ap-csp-mcq-root {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--app-dashboard-bg, var(--bg-tertiary, #eeede8));
    color: var(--app-dashboard-fg, #1a1a1a);
}

.ap-csp-mcq-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.ap-csp-mcq-back {
    font: inherit;
    font-size: 14px;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
}

.ap-csp-mcq-back:hover {
    background: rgba(0, 0, 0, 0.06);
}

.ap-csp-mcq-title {
    font-size: 15px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.ap-csp-mcq-body {
    flex: 1;
    overflow: auto;
    padding: 1rem 1rem 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.ap-csp-mcq-root {
    --ap-csp-mcq-bg: #ffffff;
    --ap-csp-mcq-bg-secondary: #f5f5f3;
    --ap-csp-mcq-bg-tertiary: #eeede8;
    --ap-csp-mcq-text: #1a1a1a;
    --ap-csp-mcq-text-secondary: #6b6b67;
    --ap-csp-mcq-text-tertiary: #9a9a95;
    --ap-csp-mcq-border: rgba(0, 0, 0, 0.12);
    --ap-csp-mcq-border-mid: rgba(0, 0, 0, 0.22);
    --ap-csp-mcq-correct-bg: #e1f5ee;
    --ap-csp-mcq-correct-text: #085041;
    --ap-csp-mcq-correct-border: #5dcaa5;
    --ap-csp-mcq-correct-accent: #1d9e75;
    --ap-csp-mcq-wrong-bg: #fcebeb;
    --ap-csp-mcq-wrong-text: #791f1f;
    --ap-csp-mcq-wrong-border: #f09595;
    --ap-csp-mcq-wrong-accent: #e24b4a;
    --ap-csp-mcq-blue-bg: #e6f1fb;
    --ap-csp-mcq-blue-text: #0c447c;
    --ap-csp-mcq-blue-accent: #378add;
    --ap-csp-mcq-purple-bg: #eeedfe;
    --ap-csp-mcq-purple-text: #3c3489;
    --ap-csp-mcq-purple-border: #afa9ec;
}

@media (prefers-color-scheme: dark) {
    .ap-csp-mcq-root {
        --ap-csp-mcq-bg: #1e1e1c;
        --ap-csp-mcq-bg-secondary: #2a2a28;
        --ap-csp-mcq-bg-tertiary: #333331;
        --ap-csp-mcq-text: #f0efe8;
        --ap-csp-mcq-text-secondary: #a0a09a;
        --ap-csp-mcq-text-tertiary: #6a6a65;
        --ap-csp-mcq-border: rgba(255, 255, 255, 0.1);
        --ap-csp-mcq-border-mid: rgba(255, 255, 255, 0.2);
        --ap-csp-mcq-correct-bg: #04342c;
        --ap-csp-mcq-correct-text: #9fe1cb;
        --ap-csp-mcq-correct-border: #0f6e56;
        --ap-csp-mcq-wrong-bg: #501313;
        --ap-csp-mcq-wrong-text: #f7c1c1;
        --ap-csp-mcq-wrong-border: #a32d2d;
        --ap-csp-mcq-blue-bg: #042c53;
        --ap-csp-mcq-blue-text: #b5d4f4;
        --ap-csp-mcq-purple-bg: #26215c;
        --ap-csp-mcq-purple-text: #cecbf6;
        --ap-csp-mcq-purple-border: #534ab7;
    }
}

.ap-csp-mcq-wrap {
    width: 100%;
    max-width: 660px;
}

.ap-csp-mcq-quiz-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ap-csp-mcq-quiz-title {
    font-size: 11px;
    font-weight: 500;
    color: var(--ap-csp-mcq-text-tertiary);
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.ap-csp-mcq-counter {
    font-size: 13px;
    color: var(--ap-csp-mcq-text-secondary);
    font-weight: 500;
}

.ap-csp-mcq-progress-bar {
    height: 3px;
    background: var(--ap-csp-mcq-border);
    border-radius: 99px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.ap-csp-mcq-progress-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--ap-csp-mcq-correct-accent);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ap-csp-mcq-card {
    background: var(--ap-csp-mcq-bg);
    border: 0.5px solid var(--ap-csp-mcq-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
}

.ap-csp-mcq-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 99px;
    border: 0.5px solid var(--ap-csp-mcq-purple-border);
    background: var(--ap-csp-mcq-purple-bg);
    color: var(--ap-csp-mcq-purple-text);
    margin-bottom: 8px;
}

.ap-csp-mcq-qnum {
    font-size: 10px;
    font-weight: 500;
    color: var(--ap-csp-mcq-text-tertiary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.ap-csp-mcq-qtext {
    font-size: 15px;
    font-weight: 500;
    color: var(--ap-csp-mcq-text);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.ap-csp-mcq-options {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.ap-csp-mcq-opt {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 0.5px solid var(--ap-csp-mcq-border);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    font-size: 14px;
    color: var(--ap-csp-mcq-text);
    line-height: 1.5;
    user-select: none;
}

.ap-csp-mcq-opt:hover:not(.is-locked) {
    background: var(--ap-csp-mcq-bg-secondary);
    border-color: var(--ap-csp-mcq-border-mid);
}

.ap-csp-mcq-opt.is-selected {
    border-color: var(--ap-csp-mcq-blue-accent);
    background: var(--ap-csp-mcq-blue-bg);
    color: var(--ap-csp-mcq-blue-text);
}

.ap-csp-mcq-opt.is-correct {
    border-color: var(--ap-csp-mcq-correct-border);
    background: var(--ap-csp-mcq-correct-bg);
    color: var(--ap-csp-mcq-correct-text);
}

.ap-csp-mcq-opt.is-wrong {
    border-color: var(--ap-csp-mcq-wrong-border);
    background: var(--ap-csp-mcq-wrong-bg);
    color: var(--ap-csp-mcq-wrong-text);
}

.ap-csp-mcq-opt-letter {
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    border: 0.5px solid var(--ap-csp-mcq-border-mid);
    background: var(--ap-csp-mcq-bg-secondary);
    color: var(--ap-csp-mcq-text-secondary);
    flex-shrink: 0;
    margin-top: 1px;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.ap-csp-mcq-opt.is-correct .ap-csp-mcq-opt-letter {
    background: var(--ap-csp-mcq-correct-accent);
    border-color: var(--ap-csp-mcq-correct-accent);
    color: #fff;
}

.ap-csp-mcq-opt.is-wrong .ap-csp-mcq-opt-letter {
    background: var(--ap-csp-mcq-wrong-accent);
    border-color: var(--ap-csp-mcq-wrong-accent);
    color: #fff;
}

.ap-csp-mcq-opt.is-selected .ap-csp-mcq-opt-letter {
    background: var(--ap-csp-mcq-blue-accent);
    border-color: var(--ap-csp-mcq-blue-accent);
    color: #fff;
}

.ap-csp-mcq-feedback {
    display: none;
    font-size: 13px;
    margin-top: 0.75rem;
    padding: 9px 12px;
    border-radius: 8px;
    line-height: 1.55;
    border: 0.5px solid;
}

.ap-csp-mcq-feedback.is-visible {
    display: block;
}

.ap-csp-mcq-feedback.is-correct-fb {
    background: var(--ap-csp-mcq-correct-bg);
    color: var(--ap-csp-mcq-correct-text);
    border-color: var(--ap-csp-mcq-correct-border);
}

.ap-csp-mcq-feedback.is-wrong-fb {
    background: var(--ap-csp-mcq-wrong-bg);
    color: var(--ap-csp-mcq-wrong-text);
    border-color: var(--ap-csp-mcq-wrong-border);
}

.ap-csp-mcq-nav {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 1rem;
}

.ap-csp-mcq-nav button {
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 8px;
    border: 0.5px solid var(--ap-csp-mcq-border-mid);
    background: transparent;
    color: var(--ap-csp-mcq-text);
    cursor: pointer;
    transition: background 0.12s, opacity 0.12s;
}

.ap-csp-mcq-nav button:hover:not(:disabled) {
    background: var(--ap-csp-mcq-bg-secondary);
}

.ap-csp-mcq-btn-primary {
    background: var(--ap-csp-mcq-text) !important;
    color: var(--ap-csp-mcq-bg) !important;
    border-color: var(--ap-csp-mcq-text) !important;
}

.ap-csp-mcq-btn-primary:hover:not(:disabled) {
    opacity: 0.8;
}

.ap-csp-mcq-nav button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.ap-csp-mcq-root .hidden {
    display: none !important;
}

.ap-csp-mcq-score-card {
    background: var(--ap-csp-mcq-bg);
    border: 0.5px solid var(--ap-csp-mcq-border);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    text-align: center;
}

.ap-csp-mcq-score-big {
    font-size: 56px;
    font-weight: 600;
    color: var(--ap-csp-mcq-text);
    letter-spacing: -0.02em;
    line-height: 1;
}

.ap-csp-mcq-score-msg {
    font-size: 14px;
    color: var(--ap-csp-mcq-text-secondary);
    margin-top: 6px;
    margin-bottom: 1.5rem;
}

.ap-csp-mcq-score-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.ap-csp-mcq-score-stat {
    background: var(--ap-csp-mcq-bg-secondary);
    border-radius: 8px;
    padding: 14px;
}

.ap-csp-mcq-score-stat-num {
    font-size: 24px;
    font-weight: 600;
}

.ap-csp-mcq-score-stat-lbl {
    font-size: 11px;
    color: var(--ap-csp-mcq-text-secondary);
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ap-csp-mcq-score-stat--correct .ap-csp-mcq-score-stat-num {
    color: var(--ap-csp-mcq-correct-accent);
}

.ap-csp-mcq-score-stat--wrong .ap-csp-mcq-score-stat-num {
    color: var(--ap-csp-mcq-wrong-accent);
}

.ap-csp-mcq-reset-btn {
    width: 100%;
    padding: 11px;
    font-size: 14px;
}

@media (max-width: 500px) {
    .ap-csp-mcq-body {
        padding: 0.75rem;
    }

    .ap-csp-mcq-qtext {
        font-size: 14px;
    }

    .ap-csp-mcq-opt {
        font-size: 13px;
    }
}
