/* ================================================================
   line-relations.css
   ----------------------------------------------------------------
   Styling for the "How Lines Relate to Each Other" skill-quiz
   (F.1-F.5) on the Class 6 Math page. Same idea as lines.css and
   patterns.css before it: every skill here shares ONE generic quiz
   modal (see line-relations.js) instead of one bespoke widget per
   skill. This file is self-contained (its own "rel-" prefixed
   classes) rather than depending on lines.css, so it doesn't matter
   which order these skill-modules get added to a page in — it only
   styles the small set of reusable "visual" building blocks a
   line-relationship question can show above its answer chips: a
   labelled diagram box / row-of-three (intersecting, parallel,
   perpendicular pairs), a right-angle corner mark, parallel
   direction ticks, and a single line drawn at an angle for the
   horizontal / vertical / slanting skill. 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.
   ================================================================ */

/* ---- Outer visual-question wrapper. Deliberately its own class
   (not the Pattern skills' external "pat-visual-wrap") so this
   module never depends on a rule defined in a different stylesheet
   loading correctly — it's self-contained end to end. The max-width
   / max-height here is a hard ceiling: even if a browser fails to
   pick up a rule further down for some reason, a diagram can never
   balloon past a sane size and blow out the modal. ---- */
.rel-visual-wrap {
    width: 100%;
    max-width: 480px;
    max-height: 320px;
    margin: 4px auto 6px;
    text-align: center;
    overflow: hidden;
    box-sizing: border-box;
}

/* ---- Shared diagram frame ---- */
.rel-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;
}
.rel-diagram-box svg {
    width: 100%;
    max-width: 220px;
    height: auto;
    display: block;
}
.rel-diagram-caption {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 13px;
    color: #6b7280;
    letter-spacing: 0.02em;
}

/* ---- Row of diagrams (intersecting / parallel / perpendicular trio) ---- */
.rel-diagram-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 12px;
    margin: 16px auto 8px;
    max-width: 560px;
}
.rel-diagram-row .rel-diagram-box {
    flex: 1 1 150px;
    max-width: 180px;
}

/* ---- Single centered diagram (definition / real-world questions) ---- */
.rel-diagram-single {
    display: flex;
    justify-content: center;
    margin: 18px auto 8px;
}
.rel-diagram-single .rel-diagram-box {
    max-width: 300px;
    width: 100%;
    padding: 16px 14px 12px;
}

/* ---- Answer chips: same override pattern as #patternOptions /
   #lineOptions — relation answers are short phrases ("Parallel
   lines", "Point of intersection") rather than single digits. ---- */
.rel-options-wrap {
    margin: 14px auto 0;
    max-width: 480px;
    box-sizing: border-box;
}

#relOptions.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;
}
#relOptions .rel-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;
}
#relOptions .rel-opt-btn.is-correct-choice {
    border-color: #10b981;
    background: color-mix(in srgb, #10b981 14%, white);
    color: #0d7a53;
}
#relOptions .rel-opt-btn.is-wrong-choice {
    border-color: #ef4444;
    background: color-mix(in srgb, #ef4444 14%, white);
    color: #b91c1c;
}
#relOptions .rel-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. */
#relQuizCard .bq-feedback.is-correct { color: #0d7a53; }
#relQuizCard .bq-feedback.is-wrong { color: #b91c1c; }
#relSummaryCard .bq-star {
    font-size: 28px;
    color: #d1d5db;
    margin: 0 2px;
}
#relSummaryCard .bq-star.filled { color: #f5b942; }

/* ---- Mobile responsiveness ---- */
@media (max-width: 560px) {
    .rel-visual-wrap { max-height: 260px; }
    .rel-diagram-row { gap: 8px; }
    .rel-diagram-row .rel-diagram-box { flex: 1 1 100px; max-width: 32%; padding: 8px 5px 6px; }
    .rel-diagram-caption { font-size: 11px; }
    .rel-diagram-single .rel-diagram-box { max-width: 88%; padding: 12px 8px 10px; }
}

@media (max-width: 400px) {
    .rel-diagram-row .rel-diagram-box { min-width: 84px; padding: 6px 4px 5px; }
    .rel-diagram-single .rel-diagram-box { max-width: 96%; padding: 10px 6px 8px; }
    #relOptions .rel-opt-btn { min-width: 52px !important; min-height: 42px !important; padding: 8px 12px !important; font-size: 14px; }
}