/*
 * Coding Ireland proprietary interactive activity
 * Copyright (c) 2017-2026 Coding Ireland. All rights reserved.
 *
 * Part of the Coding Ireland online learning platform. Licensed for use only
 * as delivered on the platform. Copying, redistributing, or adapting this
 * file, in whole or in part, for use in any other product or service is not
 * permitted. Ref: CI-maths-symmetry-tool
 */
/*
 * symmetry-tool — square grid with one or more mirror lines drawn
 * across it. In explore mode, tapping a cell shades it AND its mirror
 * reflection (so the pattern is always symmetric). In complete mode,
 * one half is pre-shaded and the learner mirrors the other half.
 */

.maths-activity .sym-stage {
    background: #fffaf0;
    border: 1px solid var(--maths-border, #e0e7ef);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(20, 40, 80, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    align-items: center;
}

.maths-activity .sym-svg {
    width: 100%;
    max-width: 480px;
    height: auto;
    background: #fff;
    border-radius: 10px;
    user-select: none;
    touch-action: none;
}

.maths-activity .sym-cell {
    fill: #fff;
    stroke: #e0e7ef;
    stroke-width: 1;
    cursor: pointer;
    transition: fill 120ms ease-out;
}

.maths-activity .sym-cell:hover { fill: #fff8e1; }

.maths-activity .sym-cell.sym-shaded {
    fill: #d84315;
    stroke: #8d2a0b;
}

.maths-activity .sym-cell.sym-shaded:hover { fill: #bf360c; }

.maths-activity .sym-cell.sym-prefilled {
    fill: #1565c0;
    stroke: #0b3a73;
}

.maths-activity .sym-cell.sym-prefilled:hover { fill: #0d47a1; }

.maths-activity .sym-mirror-line {
    stroke: #2E7D32;
    stroke-width: 3;
    stroke-dasharray: 8 5;
    stroke-linecap: round;
    pointer-events: none;
}

/* find-lines: a line the LEARNER is proposing, not one we are asserting. Amber
   and thinner than the green mirror line so a proposal never reads as the
   teacher's answer already drawn on the board. */
.maths-activity .sym-candidate-line {
    stroke: #C77700;
    stroke-width: 4;
    stroke-dasharray: 3 6;
}

.maths-activity .sym-lines-panel {
    background: #fff;
    border: 1px solid var(--maths-border, #e0e7ef);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    width: 100%;
    max-width: 480px;
    margin: 0 auto 0.75rem;
    text-align: center;
}

.maths-activity .sym-lines-label {
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 0.55rem;
    color: #1d2939;
}

.maths-activity .sym-lines-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
}

.maths-activity .sym-line-btn {
    border: 2px solid #C77700;
    background: #fff;
    color: #C77700;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.maths-activity .sym-line-btn:hover { background: #fff4e5; }
.maths-activity .sym-line-btn.is-on { background: #C77700; color: #fff; }

.maths-activity .sym-lines-count {
    margin-top: 0.5rem;
    font-size: 0.82rem;
    color: #4a5160;
}

.maths-activity .sym-status {
    background: #fff;
    border: 1px solid var(--maths-border, #e0e7ef);
    border-radius: 12px;
    padding: 0.625rem 1rem;
    width: 100%;
    max-width: 480px;
    text-align: center;
    font-weight: 800;
    transition: background-color 220ms ease-out, border-color 220ms ease-out, color 220ms ease-out;
}

.maths-activity .sym-status.sym-symmetric {
    background: #e8f5e9;
    border-color: #66bb6a;
    color: #1b5e20;
}

.maths-activity .sym-status.sym-asymmetric {
    background: #fff8e1;
    border-color: #f0c14b;
    color: #8d4e0b;
}

.maths-activity .sym-mode-chip {
    display: inline-block;
    background: var(--maths-primary, #2E7D32);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    margin-top: 0.25rem;
}

.maths-activity .sym-target-label {
    font-weight: 800;
    color: #8d4e0b;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.maths-activity .sym-target-prompt { flex: 1; font-weight: 700; color: #1f2937; }

.maths-activity .sym-your-turn {
    margin-top: 1.25rem;
    background: #f1f8e9;
    border: 1px solid #aed581;
    border-radius: 14px;
    padding: 1rem 1.25rem;
}

.maths-activity .sym-your-turn-label {
    font-weight: 800;
    color: #33691e;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.maths-activity .sym-your-turn-list { margin: 0; padding-left: 1.25rem; color: #1f2937; font-weight: 600; }
.maths-activity .sym-your-turn-list li { margin-bottom: 0.25rem; }

/* Display mode */
/* Display mode — read-only symmetry grid. Target panel, callout and
 * challenge runner hidden; cells locked. SVG capped so the grid
 * doesn't dominate the lesson page. Your-turn prompts stay — those are
 * display-only discussion prompts.
 */
body.display-mode .sym-target-panel,
body.display-mode .sym-callout,
body.display-mode #challengeRunner { display: none !important; }

body.display-mode .sym-cell { cursor: default !important; pointer-events: none; }

body.display-mode .sym-stage {
    padding: 0.75rem;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

body.display-mode .sym-svg {
    max-width: 320px;
}

/* ---------- Competition sizing ----------
 * The grid and its panels are capped at 480px, the smallest of the three, and the status text under
 * it was smaller again. Both are read from the back of a classroom here. */
html.mcr-compete .maths-activity .sym-svg { max-width: min(820px, 66vh); }
html.mcr-compete .maths-activity .sym-lines-panel,
html.mcr-compete .maths-activity .sym-status { max-width: min(820px, 66vh); font-size: 1.15rem; }

/* ---------- Competition layout (board) ----------
 * The live "Not symmetric yet" box under the grid goes. It told the class the moment the pattern
 * was right, so a class could tap squares until it changed instead of working it out, and
 * "symmetric", under a down arrow, is a word a 2nd class reads past. Check says right or wrong.
 */
html.mcr-compete .maths-activity .sym-status { display: none !important; }
/* ---------- end competition layout ---------- */
