/*
 * 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-zone-gauge
 */
/*
 * zone-gauge — compute a value from named inputs, then read which coloured
 * band it lands in. BMI, heart-rate zones, tax bands.
 */

.maths-activity .zg-layout {
    display: grid;
    grid-template-columns: minmax(240px, 300px) 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* ---- Inputs ---- */

.maths-activity .zg-inputs {
    background: #f7f9fc;
    border: 1px solid #e2e8f2;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.maths-activity .zg-inputs-head {
    font-weight: 800;
    color: #47506b;
}

.maths-activity .zg-input-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.maths-activity .zg-input-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.maths-activity .zg-input-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #47506b;
}

.maths-activity .zg-input {
    width: 6.5rem;
    border: 2px solid #d7deeb;
    border-radius: 10px;
    padding: 0.35rem 0.55rem;
    font: inherit;
    font-weight: 700;
    text-align: right;
    color: #23293a;
    background: #fff;
}

.maths-activity .zg-input:focus {
    outline: none;
    border-color: #2f7d6d;
}

.maths-activity .zg-formula {
    font-size: 0.85rem;
    font-weight: 700;
    color: #6b7590;
    background: #eef2f8;
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
}

.maths-activity .zg-working {
    background: #23293a;
    color: #e8edf6;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
}

/* ---- Gauge ---- */

.maths-activity .zg-gauge-wrap {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.maths-activity .zg-value-card {
    background: #fff;
    border: 1px solid #e2e8f2;
    border-radius: 12px;
    padding: 0.85rem 1rem;
}

.maths-activity .zg-value-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #8b94ad;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.maths-activity .zg-value {
    font-size: 2.1rem;
    font-weight: 800;
    color: #23293a;
    line-height: 1.15;
}

.maths-activity .zg-zone-name {
    font-size: 1.05rem;
    font-weight: 800;
}

.maths-activity .zg-gauge {
    position: relative;
    padding-top: 34px;   /* room for the marker flag above the bands */
}

.maths-activity .zg-bands {
    position: relative;
    height: 30px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #d7deeb;
    background: #eef2f8;
}

.maths-activity .zg-band {
    position: absolute;
    top: 0;
    bottom: 0;
}

.maths-activity .zg-marker {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    transition: left 0.18s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.maths-activity .zg-marker-flag {
    background: #23293a;
    color: #fff;
    font-weight: 800;
    font-size: 0.82rem;
    border-radius: 6px;
    padding: 0.15rem 0.45rem;
    white-space: nowrap;
}

/* The pointer under the flag. */
.maths-activity .zg-marker::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #23293a;
}

.maths-activity .zg-axis {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #8b94ad;
    margin-top: 0.3rem;
}

.maths-activity .zg-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.maths-activity .zg-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #47506b;
}

.maths-activity .zg-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

/* ---- Target + your turn ---- */

.maths-activity .zg-target-panel {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.maths-activity .zg-target-label {
    font-weight: 800;
    color: #2f7d6d;
}

.maths-activity .zg-target-prompt {
    font-weight: 600;
    color: #23293a;
}

.maths-activity .zg-callout.is-correct {
    color: #1d6b4f;
    font-weight: 700;
}

.maths-activity .zg-callout.is-wrong {
    color: #a33a2a;
    font-weight: 700;
}

.maths-activity .zg-mode-chip {
    display: inline-block;
    margin-top: 0.4rem;
    background: #eef2f8;
    color: #47506b;
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.maths-activity .zg-your-turn {
    margin-top: 1.1rem;
    border: 1px dashed #c9d3e4;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    background: #fbfcfe;
}

.maths-activity .zg-your-turn-label {
    font-weight: 800;
    color: #47506b;
    margin-bottom: 0.35rem;
}

.maths-activity .zg-your-turn-list {
    margin: 0;
    padding-left: 1.15rem;
}

/* ---- Display mode ---- */

body.display-mode .zg-target-panel,
body.display-mode .zg-callout,
body.display-mode .zg-your-turn,
body.display-mode #challengeRunner {
    display: none !important;
}

body.display-mode .zg-layout {
    grid-template-columns: minmax(200px, 250px) 1fr;
    gap: 1rem;
    align-items: center;
}

body.display-mode .zg-inputs {
    padding: 0.75rem 0.85rem;
    gap: 0.5rem;
}

body.display-mode .zg-value {
    font-size: 1.7rem;
}

body.display-mode .zg-value-card {
    padding: 0.65rem 0.8rem;
}

body.display-mode .zg-working {
    font-size: 0.85rem;
    padding: 0.45rem 0.6rem;
}

@media (max-width: 820px) {
    .maths-activity .zg-layout {
        grid-template-columns: 1fr;
    }
}
