/* ============================================================
   MCQ answer card (.sol-*)
   One stylesheet for every page that shows a solved question:
   the exam review (exam.js), the solution pages (solution.js)
   and the bookmark details page (details.js).
   Markup: .sol-mcq > .sol-content (.sol-question, .sol-more, .sol-changeable, .sol-opts > .sol-option, .sol-exp)
                      + .sol-actions
   Option states: .green = correct answer, .red = the student's wrong choice.
   ============================================================ */

.sol-mcq {
    position: relative;
    margin: 8px 0;
    color: var(--text-dark, #000);
    background: var(--surface-1, #fff);
    border: 1px solid rgba(0, 0, 0, .05);
    border-radius: 16px;
}
.sol-mcq::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 16px 0 0 16px;
    background: linear-gradient(180deg, #129ae8, #7c3aed);
}
.sol-mcq p img { max-width: 100%; border-radius: 10px; }

.sol-content { padding: 0 14px 12px 18px; }

.sol-question {
    margin: 0 34px 0 0;
    padding-top: 14px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
    color: var(--text-dark, #000);
}

/* question number badge */
.sol-num {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    margin-right: 8px;
    padding: 0 7px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    vertical-align: 1px;
    color: #fff;
    border-radius: 9px;
    background: linear-gradient(135deg, #129ae8, #7c3aed);
    box-shadow: 0 4px 10px rgba(18, 154, 232, .3);
}

/* three-dot menu */
.sol-more { position: absolute; top: 8px; right: 6px; }
.sol-more > button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    line-height: 1;
    color: var(--text-light, #555);
    border-radius: 50%;
    text-decoration: none;
}
.sol-more > button:hover, .sol-more > button:focus { text-decoration: none; }
.sol-more > button:hover { background: var(--hover-bg, #f1f1f1); color: var(--text-dark, #000); }

.sol-changeable {
    display: inline-block;
    margin: 6px 0 2px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #b35a1f;
    background: #fdf3e2;
}

/* options */
.sol-opts { margin-top: 10px; padding: 0; font-size: 15px; }
.sol-option {
    margin-bottom: 8px;
    padding: 10px 14px;
    line-height: 1.5;
    color: var(--text-dark, #000);
    border: 1px solid var(--border-color, #cfd4da);
    border-radius: 12px;
    background: var(--surface-1, #fff);
    transition: background-color .2s, border-color .2s, box-shadow .2s;
}
.sol-option.green {
    color: #fff;
    border-color: #16a34a;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    box-shadow: 0 6px 14px rgba(22, 163, 74, .3);
    animation: sol-pulse .8s;
}
.sol-option.red {
    color: #fff;
    border-color: #dc2626;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: 0 6px 14px rgba(220, 38, 38, .25);
}
/* study room: options are tappable until one is chosen */
.sol-option.pulse { animation: sol-pulse .8s; }
@keyframes sol-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }
.sol-option img, .sol-exp img { display: block; max-width: 100%; border-radius: 10px; }

/* explanation */
.sol-exp {
    display: none;
    margin: 12px 0 0;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-dark, #000);
    border: 1px solid color-mix(in srgb, #16a34a 45%, transparent);
    border-left-width: 4px;
    border-radius: 12px;
    background: color-mix(in srgb, #16a34a 9%, var(--surface-1, #fff));
}
.sol-exp.show { display: block; }
.sol-exp .sol-exp-btns { margin-top: 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sol-exp .sol-exp-btns .btn { border-radius: 999px; font-weight: 600; }

/* action row: answer / explanation / bookmark / report */
.sol-actions {
    padding: 10px 14px 12px 18px;
    border-top: 1px solid var(--border-color, rgba(160, 160, 160, .2));
}
.sol-actions .row { margin: 0; }
.sol-actions .col-3 { padding: 0 3px; }
.sol-actions .col-3:first-child { padding-left: 0; }
.sol-actions .col-3:last-child { padding-right: 0; }
.sol-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 7px 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark, #000);
    background: color-mix(in srgb, var(--text-dark, #000) 4%, var(--surface-1, #fff));
    border: 1px solid var(--border-color, #d5d9de);
    border-radius: 10px;
    transition: background-color .18s, color .18s, border-color .18s, transform .18s;
}
.sol-actions .btn:hover:not(:disabled) {
    color: #129ae8;
    border-color: #129ae8;
    background: color-mix(in srgb, #129ae8 8%, var(--surface-1, #fff));
    transform: translateY(-1px);
}
.sol-actions .btn:disabled { opacity: .6; }
.sol-actions .material-symbols-outlined { font-size: 19px; vertical-align: middle; }
.sol-bm.on .material-symbols-outlined { color: #dc3545; font-variation-settings: 'FILL' 1; }

/* AI explanation popup (shared by the same pages) */
.ai-warning {
    margin-top: 10px;
    padding: .5rem;
    font-size: 10px;
    text-align: center;
    color: #888;
    background: #f1f1f1;
    border: 1px solid #888;
    border-radius: 8px;
}
#ai_explanation h1 { font-size: 20px; }
#ai_explanation h2 { font-size: 18px; }
#ai_explanation h3 { font-size: 16px; }
#ai_explanation h4 { font-size: 14px; }
