/*
 * 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-lcw-options-comparator
 */

/* The browser hides `[hidden]` with a UA rule that ANY author `display:` rule
   outranks -- and several elements here are both `display:`-styled and toggled
   via `el.hidden`. Without this the empty-state message renders underneath a
   fully working activity, and the readout shows its headings with nothing in
   them. The `hidden` PROPERTY is correctly set in both cases, so neither a
   property check nor the console catches it; only looking at the page does. */
[hidden] { display: none !important; }


.oc-activity {
    --oc-ink: #1f2933;
    --oc-muted: #62707d;
    --oc-rule: #dfe4ea;
    --oc-paper: #ffffff;
    --oc-surface: #f6f7f9;
    --oc-lead: #1f6f8b;
}

.oc-container {
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

.oc-question {
    margin: 0;
    padding: .7rem .9rem;
    background: var(--oc-surface);
    border-left: 4px solid var(--oc-lead);
    border-radius: 0 8px 8px 0;
    font-size: .97rem;
    font-weight: 700;
    color: var(--oc-ink);
}

/* The grid can outgrow the frame on a narrow board, and the page itself must
   never scroll sideways -- so the scroll lives here. */
.oc-scroll {
    overflow-x: auto;
    border: 1px solid var(--oc-rule);
    border-radius: 12px;
    background: var(--oc-paper);
}

.oc-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.oc-grid th,
.oc-grid td {
    border: 1px solid var(--oc-rule);
    padding: .6rem .7rem;
    vertical-align: top;
    text-align: left;
}

.oc-corner {
    background: var(--oc-surface);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--oc-muted);
    min-width: 12rem;
}

.oc-opt-head {
    background: var(--oc-surface);
    min-width: 13rem;
}

.oc-opt-label {
    display: block;
    font-size: .98rem;
    font-weight: 800;
    color: var(--oc-ink);
}

.oc-opt-note {
    display: block;
    margin-top: .15rem;
    font-size: .78rem;
    font-weight: 400;
    color: var(--oc-muted);
}

/* --------------------------------------------------------------- criteria -- */

.oc-crit { background: #fbfcfd; }

.oc-crit-label {
    display: block;
    font-weight: 700;
    color: var(--oc-ink);
}

.oc-crit-hint {
    display: block;
    margin-top: .15rem;
    font-size: .78rem;
    font-weight: 400;
    color: var(--oc-muted);
}

.oc-weight {
    display: block;
    margin-top: .5rem;
}

.oc-weight-cap {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--oc-muted);
    margin-bottom: .15rem;
}

.oc-weight-select {
    width: 100%;
    font-family: inherit;
    font-size: .8rem;
    padding: .25rem .35rem;
    border: 1px solid var(--oc-rule);
    border-radius: 6px;
    background: #fff;
    color: var(--oc-ink);
}

/* ------------------------------------------------------------------ cells -- */

.oc-cell-input {
    width: 100%;
    font-family: inherit;
    font-size: .86rem;
    line-height: 1.45;
    padding: .35rem .45rem;
    border: 1px solid var(--oc-rule);
    border-radius: 6px;
    resize: vertical;
    color: var(--oc-ink);
}

.oc-cell-input:focus {
    outline: 2px solid var(--oc-lead);
    outline-offset: -1px;
}

.oc-cell-text {
    margin: 0;
    font-size: .88rem;
    line-height: 1.5;
    color: var(--oc-ink);
    min-height: 1.2rem;
}

.oc-rate {
    display: flex;
    gap: .3rem;
    margin-top: .45rem;
}

.oc-rate-btn {
    flex: 1 1 0;
    padding: .2rem 0;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 800;
    line-height: 1.2;
    border: 1px solid var(--oc-rule);
    border-radius: 6px;
    background: #fff;
    color: var(--oc-muted);
    cursor: pointer;
}

.oc-rate-btn:disabled { cursor: default; }
.oc-rate-btn:hover:not(:disabled) { border-color: var(--oc-muted); }

/* Rating tone is a judgement the student made, not a mark: no green tick, no
   red cross. The shape and the tooltip carry the meaning as well as the colour. */
.oc-rate-btn.is-on.oc-rate-0 { background: #eceff1; border-color: #90a0ad; color: #43525e; }
.oc-rate-btn.is-on.oc-rate-1 { background: #e4eef2; border-color: #5d94a8; color: #1f4f5e; }
.oc-rate-btn.is-on.oc-rate-2 { background: #1f6f8b; border-color: #1f6f8b; color: #fff; }

/* ----------------------------------------------------------------- totals -- */

.oc-total-label {
    background: var(--oc-surface);
    font-size: .82rem;
    font-weight: 800;
    color: var(--oc-muted);
}

.oc-total {
    background: var(--oc-surface);
    font-size: 1.15rem;
    font-weight: 800;
    text-align: center;
    color: var(--oc-ink);
}

.oc-total.is-lead {
    background: rgba(31, 111, 139, .12);
    color: var(--oc-lead);
}

.oc-readout {
    padding: .7rem .9rem;
    background: rgba(31, 111, 139, .08);
    border-radius: 8px;
    font-size: .92rem;
    font-weight: 700;
    color: var(--oc-ink);
}

.oc-prompts {
    margin: 0;
    padding-left: 1.2rem;
    font-size: .88rem;
    line-height: 1.6;
    color: var(--oc-ink);
}

.oc-prompts li { margin-bottom: .3rem; }

.oc-empty {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 2rem;
    color: var(--oc-muted);
    font-size: .95rem;
}

.oc-copy-fallback {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    width: 22rem;
    height: 7rem;
    font-size: .8rem;
    z-index: 20;
}

/* ---------------------------------------------------------- display mode -- */

body.display-mode .oc-grid { font-size: 1rem; }
body.display-mode .oc-cell-text { font-size: .98rem; }
body.display-mode .oc-total { font-size: 1.3rem; }

.oc-mode-display .oc-weight { pointer-events: none; }
