﻿/* ===== Module Quiz (fixed footer pattern + styled read button, minimal gap) ===== */

/* --- Tokens --- */
:root {
    --mq-side-pad: 1rem;
    --mq-btn-min-h: 44px;
    --mq-footer-pad-v: 8px;
    --mq-footer-safe: env(safe-area-inset-bottom, 0px);
}

.mq-container {
    min-height: 100svh;
    height: 100svh;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;

    /* IMPORTANT: keep bottom safe-area OFF here */
    padding: 0 var(--mq-side-pad);
    box-sizing: border-box;
    max-width: 420px;
    margin: 0 auto;
    overflow: hidden; 
    position: relative; /* anchor footer */
}

.mq-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start; /* ⬅️ critical: no vertical centering */
    width: 100%;
    overflow: hidden;
    padding: 0;

    /* only a thin buffer so content doesn't kiss the footer */
    padding-bottom: max(8px, var(--mq-footer-safe));
    box-sizing: border-box;
}

/* Kill stray bottom margins that create a big white band above the footer */
.mq-body > *:last-child { margin-bottom: 0 !important; }
.mq-body .options,
.mq-body .answers,
.mq-body .answer-grid,
.mq-body .choices,
.mq-body .mc-options,
.mq-body .question-wrapper,
.mq-body .content-wrapper,
.mq-body .read-button-wrapper { margin-bottom: 0 !important; padding-bottom: 0 !important; }

.mq-body > .mc-step {
    flex: 1 1 auto;
    min-height: 0;
}

/* Footer pinned just like story quiz */
.mq-footer {
    position: absolute;
    left: 0; right: 0; bottom: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: var(--mq-footer-pad-v) var(--mq-side-pad) var(--mq-footer-safe);
    text-align: center;
    width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 60%);
    z-index: 10;
}

.mq-progress { margin: 0 auto; text-align: center; }

.mq-sensei-image,
.mq-question-image,
.mq-scenario-image {
    height: 240px !important;
    object-fit: contain;
    margin-bottom: 1rem;
    max-width: 100%;
    border-radius: 12px;
    margin: 0 auto 1rem auto;
}

/* ---- Interaction shield ---- */
.mq-shield {
    position: fixed;
    inset: 0;
    background: transparent;
    pointer-events: none;
    z-index: 900;
}
.mq-shield.active { pointer-events: all; }

/* Results styles unchanged */
.mq-results h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.mq-results p { margin-bottom: 1rem; }
.mq-results button {
    padding: 0.6rem 1.25rem;
    font-size: 1rem;
    border: none;
    border-radius: 10px;
    background-color: #00b894;
    color: white;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s;
}
.mq-results button:hover { background-color: #019870; }

/* --- Read button: pill style to match --- */
.read-button-wrapper {
    display: flex;
    justify-content: center;
    padding-bottom: 0;  /* footer handles safe-area */
    margin-top: 1rem;
}
.read-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: var(--mq-btn-min-h);
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    background-color: #5b9cff;
    color: #fff;
    max-width: 280px;
    width: 100%;
    line-height: normal;
    margin: 0;
}
.read-button:hover,
.read-button:focus { background-color: #4786e6; transform: translateY(-1px); }
.read-button:active { transform: scale(0.98); }

.word-span.highlighted {
    background-color: yellow;
    transition: background-color 0.15s ease-in-out;
}
