/* ================================================================
   angles.css
   ----------------------------------------------------------------
   Styling for the "What is an Angle? (Foundations)" skill-quiz
   (G.1-G.5) on the Class 6 Math page. Exactly like lines-angles.css,
   every skill here shares ONE generic quiz modal (see angles.js)
   instead of one bespoke widget per skill — this file only styles
   the small set of reusable "visual" building blocks an angle
   question can show above its answer chips: a single labelled-angle
   diagram, a row of 2-3 diagrams side by side (comparing doors /
   spotting the vertex), and a row of big real-world icon cards.
   Loaded as a plain stylesheet link alongside quiz-popup-theme.css /
   quiz-modal-responsive.css, which already supply the shared
   .quiz-overlay / .quiz-modal / .card / .bq-* / .quiz-number-opt /
   .slot-dot rules every skill popup on the site uses.
   ================================================================ */

/* ---- Shared diagram frame ---- */
.ang-diagram-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: #f8f9fb;
    border: 2px solid var(--line, #e2e8f0);
    border-radius: 14px;
    padding: 10px 8px 8px;
}
.ang-diagram-box svg {
    width: 100%;
    max-width: 220px;
    height: auto;
    display: block;
}
.ang-diagram-caption {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 13px;
    color: #6b7280;
    letter-spacing: 0.02em;
}

/* ---- Row of 2 (comparing doors) or 3 (spot-the-part) diagrams ---- */
.ang-diagram-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 12px;
    margin: 16px auto 8px;
    max-width: 480px;
}
.ang-diagram-row .ang-diagram-box {
    flex: 1 1 160px;
    max-width: 210px;
}

/* ---- Single centered diagram (Intro, Parts, Naming) ---- */
.ang-diagram-single {
    display: flex;
    justify-content: center;
    margin: 18px auto 8px;
}
.ang-diagram-single .ang-diagram-box {
    max-width: 300px;
    width: 100%;
    padding: 16px 14px 12px;
}

/* ---- Real-world icon-spotting cards (G.5) ---- */
.ang-icon-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 12px;
    margin: 16px auto 8px;
    max-width: 480px;
}
.ang-icon-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 120px;
    max-width: 150px;
    background: #f8f9fb;
    border: 2px solid var(--line, #e2e8f0);
    border-radius: 14px;
    padding: 18px 8px 12px;
}
.ang-icon-box i {
    font-size: 34px;
    color: var(--secondary, #1d4ed8);
}
.ang-icon-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    letter-spacing: 0.02em;
}

/* ---- Notation pill text used inside answer options (∠ABC) ---- */
.ang-notation {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
}

/* ---- G.6 "Mind the Mistake, Mend the Mistake!" protractor diagram.
   The protractor's number rings need more breathing room than the
   other single-diagram skills, so it gets a slightly wider frame
   inside the same .ang-diagram-box shell. ---- */
.ang-diagram-single .ang-diagram-box.ang-protractor-box {
    max-width: 340px;
}
.ang-protractor-box svg {
    max-width: 300px;
}

/* ---- G.7 "Counting Angles in Nested Triangles" (HOTS) fractal-
   triangle diagram. The Figure-3 diagram packs in up to 21 small
   angle-arcs, so it gets a bit more room than the other single-
   diagram skills — same pattern as the G.6 protractor box override
   above — so the smallest arcs stay legible instead of cramping
   into the default 300px frame. ---- */
.ang-diagram-single .ang-diagram-box.ang-fractal-box {
    max-width: 320px;
}
.ang-fractal-box svg {
    max-width: 280px;
}

/* ---- Answer chips: reuse the shared quiz-number-opt button, but
   angle answers are often labels/notation ("Vertex", "∠ABC",
   "Door A") rather than a single digit, so override the shared
   fixed circle sizing to a pill that grows to fit its own text and
   wraps if needed — same pattern as lines-angles.css' #lineOptions
   override. ---- */
.ang-options-wrap {
    margin: 14px auto 0;
    max-width: 480px;
    box-sizing: border-box;
}

/* Scoped to #angleOptions so these out-specificity the shared quiz
   theme's ".quiz-number-opt" / ".quiz-number-options" rules (built
   for single-digit 0-9 answers). !important guards against any
   theme rule loaded after this file. */
#angleOptions.quiz-number-options {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100%;
    box-sizing: border-box;
}
#angleOptions .ang-opt-btn {
    width: auto !important;
    height: auto !important;
    min-width: 64px !important;
    min-height: 48px !important;
    max-width: 100%;
    flex: 0 1 auto !important;
    border-radius: 16px !important;
    padding: 10px 18px !important;
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: normal !important;
    line-height: 1.25 !important;
    text-align: center !important;
    box-sizing: border-box;
}
#angleOptions .ang-opt-btn.is-correct-choice {
    border-color: #10b981;
    background: color-mix(in srgb, #10b981 14%, white);
    color: #0d7a53;
}
#angleOptions .ang-opt-btn.is-wrong-choice {
    border-color: #ef4444;
    background: color-mix(in srgb, #ef4444 14%, white);
    color: #b91c1c;
}
#angleOptions .ang-opt-btn:disabled {
    cursor: default;
    transform: none;
}

/* Feedback + summary stars, scoped so they render correctly even if
   the shared theme file doesn't already style these modifier
   classes. */
#angleQuizCard .bq-feedback.is-correct { color: #0d7a53; }
#angleQuizCard .bq-feedback.is-wrong { color: #b91c1c; }
#angleSummaryCard .bq-star {
    font-size: 28px;
    color: #d1d5db;
    margin: 0 2px;
}
#angleSummaryCard .bq-star.filled { color: #f5b942; }

/* ---- Mobile responsiveness (incl. Android phone browsers) ---- */
@media (max-width: 560px) {
    .ang-diagram-row { gap: 8px; }
    .ang-diagram-row .ang-diagram-box { flex: 1 1 130px; max-width: 47%; padding: 8px 5px 6px; }
    .ang-diagram-caption { font-size: 11px; }
    .ang-diagram-single .ang-diagram-box { max-width: 100%; padding: 12px 8px 10px; }
    .ang-diagram-single .ang-diagram-box.ang-fractal-box { max-width: 100%; }
    .ang-fractal-box svg { max-width: 100%; }
    .ang-icon-row { gap: 8px; }
    .ang-icon-box { flex: 1 1 90px; max-width: 32%; padding: 12px 6px 8px; }
    .ang-icon-box i { font-size: 26px; }
    .ang-icon-label { font-size: 10.5px; }
    #angleOptions .ang-opt-btn {
        min-width: 44%;
        padding: 10px 12px !important;
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    .ang-diagram-row .ang-diagram-box { min-width: 130px; max-width: 100%; }
    .ang-icon-box { min-width: 85px; }
}
/* ---- Force the 4 answer chips onto ONE row, on phones AND desktop,
   for skills whose options are short mistake-labels / degree values
   (currently G.6, "Mind the Mistake, Mend the Mistake!"). Placed
   last in the file and double-qualified on both classes so it
   reliably beats the shared #angleOptions .ang-opt-btn rules above
   (which wrap onto 2-per-row on narrow screens). Each chip flexes to
   an equal 1/4 share of the row and NEVER truncates its text — if a
   label is too wide for its share it wraps onto a second short line
   inside the same chip instead of clipping (the old width:0 +
   overflow:hidden version cut "Wrong scale" down to a bare "9"). */
#angleOptions.quiz-number-options.ang-opts-oneline {
    flex-wrap: nowrap !important;
    gap: 6px !important;
    align-items: stretch !important;
}
#angleOptions.quiz-number-options.ang-opts-oneline .ang-opt-btn {
    flex: 1 1 0% !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 46px !important;
    padding: 8px 5px !important;
    font-size: 13px !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    border-radius: 14px !important;
}
@media (max-width: 560px) {
    #angleOptions.quiz-number-options.ang-opts-oneline .ang-opt-btn {
        font-size: 11.5px !important;
        padding: 7px 3px !important;
        min-height: 42px !important;
        border-radius: 12px !important;
    }
}
@media (max-width: 400px) {
    #angleOptions.quiz-number-options.ang-opts-oneline .ang-opt-btn {
        font-size: 10.5px !important;
        padding: 6px 2px !important;
        min-height: 40px !important;
    }
}