/*
 * 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-calendar
 */
/*
 * calendar activity skin. Layered on the shared maths-activity.css.
 * A Monday-start month grid, a count control row (explore), a result readout,
 * and the shared target panel (challenge). Display mode hides the controls.
 */

.cal-mode-chip {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: var(--maths-surface-alt);
    color: var(--maths-primary-dark);
    font-weight: 800;
    font-size: 0.8rem;
}

/* ---- Month + grid ---- */
.cal-stage {
    max-width: 560px;
    margin: 0 auto;
}

.cal-month-label {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--maths-primary);
    margin-bottom: 0.5rem;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.cal-head {
    text-align: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--maths-ink-muted);
    padding-bottom: 0.2rem;
}

.cal-blank { aspect-ratio: 1 / 1; }

.cal-day {
    aspect-ratio: 1 / 1;
    border: 2px solid var(--maths-border);
    border-radius: 10px;
    background: var(--maths-surface);
    color: var(--maths-ink);
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.cal-day:hover { background: var(--maths-surface-alt); border-color: var(--maths-primary); }

.cal-day.start {
    background: var(--maths-primary);
    border-color: var(--maths-primary);
    color: #fff;
}

.cal-day.result {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
}

.cal-day.end {
    background: var(--maths-accent);
    border-color: var(--maths-accent-dark);
    color: #fff;
}

.cal-day.pick {
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.35);
    border-color: #2e7d32;
}

/* ---- Count controls (explore) ---- */
.cal-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.cal-controls[hidden] { display: none; }

.cal-controls-label { font-weight: 800; color: var(--maths-ink-muted); }

.cal-stepper {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cal-step-btn {
    width: 42px;
    height: 42px;
    border: 2px solid var(--maths-border);
    border-radius: 10px;
    background: var(--maths-surface);
    color: var(--maths-primary);
    font-size: 1.4rem;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
}

.cal-step-btn:hover { background: var(--maths-surface-alt); border-color: var(--maths-primary); }

.cal-step-value {
    min-width: 2rem;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--maths-ink);
    font-variant-numeric: tabular-nums;
}

.cal-toggle {
    display: inline-flex;
    border: 2px solid var(--maths-border);
    border-radius: 10px;
    overflow: hidden;
}

.cal-toggle-btn {
    background: var(--maths-surface);
    border: none;
    padding: 0.5rem 0.9rem;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--maths-ink);
    cursor: pointer;
    min-height: 42px;
}

.cal-toggle-btn[aria-pressed="true"] {
    background: var(--maths-primary);
    color: #fff;
}

/* ---- Readout ---- */
.cal-readout {
    max-width: 560px;
    margin: 0.9rem auto 0;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--maths-primary-dark);
    background: var(--maths-surface-alt);
    border: 1px solid var(--maths-border);
    border-radius: 12px;
    padding: 0.7rem 1rem;
}

.cal-readout[hidden] { display: none; }

/* ---- Target panel (challenge) ---- */
.cal-target-prompt {
    flex: 0 0 100%;
    font-weight: 800;
    color: #6b4500;
    font-size: 1.1rem;
}

.cal-answer-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.cal-answer-label { font-weight: 700; color: #6b4500; }

.cal-answer-input {
    width: 6rem;
    font-size: 1.3rem !important;
    font-weight: 800;
    text-align: center;
    padding: 0.3rem 0.5rem !important;
    min-height: 48px;
}

.cal-check-btn { white-space: nowrap; }

/* ---- Your turn ---- */
.cal-your-turn {
    max-width: 560px;
    margin: 1rem auto 0;
    background: #fff8e1;
    border: 1px solid #f0c14b;
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
}

.cal-your-turn[hidden] { display: none; }

.cal-your-turn-label { font-weight: 800; color: #8a5a00; margin-bottom: 0.4rem; }
.cal-your-turn-list { margin: 0; padding-left: 1.2rem; color: var(--maths-ink); }
.cal-your-turn-list li { margin: 0.2rem 0; }

/* ---- Display mode ---- */
body.display-mode .cal-controls { display: none; }
body.display-mode .cal-day { cursor: default; }

@media (max-width: 640px) {
    .cal-day { font-size: 0.95rem; border-radius: 8px; }
    .cal-month-label { font-size: 1.2rem; }
    .cal-readout { font-size: 1rem; }
}
