/*
 * 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-lunchbox-builder
 */
.lb-stage { font-family: 'Nunito', system-ui, sans-serif; color: #1f2a37; }

/* ---- Layout ------------------------------------------------------------- */
.lb-main {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 16px;
}
@media (max-width: 720px) { .lb-main { grid-template-columns: 1fr; } }

/* ---- The lunchbox ------------------------------------------------------- */
.lb-box-wrap {
    border: 2px solid #d7b27a;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff8ec, #fdeccf);
    box-shadow: 0 8px 20px -12px rgba(120, 80, 20, .5);
    overflow: hidden;
}
.lb-box-lid {
    background: linear-gradient(180deg, #f0c073, #e3a948);
    color: #5a3c0c; font-weight: 800; font-size: 14px;
    padding: 9px 14px; letter-spacing: .01em;
    display: flex; align-items: center; gap: 8px;
    border-bottom: 2px solid #d7b27a;
}
.lb-box {
    min-height: 150px;
    display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start;
    padding: 14px;
    transition: background .14s ease, box-shadow .14s ease;
}
.lb-box.lb-over {
    background: #fff3d6;
    box-shadow: inset 0 0 0 3px rgba(224, 138, 30, .25);
}
.lb-box-hint {
    text-align: center; color: #a98a52; font-weight: 700; font-size: 13px;
    padding: 0 14px 12px;
}
.lb-box-hint.is-full { color: #b91c1c; }
.lb-box-hint[hidden] { display: none; }

/* ---- Food chips (shelf + box) ------------------------------------------- */
.lb-shelf-wrap { margin-bottom: 12px; }
.lb-shelf-label,
.lb-readout-title {
    font-weight: 800; font-size: 12px; color: #64748b; margin-bottom: 7px;
    text-transform: uppercase; letter-spacing: .08em;
}
.lb-shelf {
    min-height: 56px; display: flex; flex-wrap: wrap; gap: 10px; padding: 12px;
    background: linear-gradient(180deg, #f1f5f9, #e7eef6);
    border: 1px dashed #cbd5e1; border-radius: 14px;
    transition: background .14s ease, box-shadow .14s ease;
}
.lb-shelf.lb-over { background: #eef0ff; box-shadow: inset 0 0 0 3px rgba(99, 102, 241, .15); }

.lb-chip {
    --lb-hue: #6b7280;
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(180deg, #ffffff, #f5f8fc);
    border: 1.5px solid #d3dce6; border-left: 5px solid var(--lb-hue);
    border-radius: 12px; padding: 8px 12px;
    font-weight: 800; font-size: 14px; color: #1f2a37;
    cursor: grab; user-select: none; touch-action: none;
    box-shadow: 0 2px 6px rgba(15, 42, 80, .12);
    transition: transform .12s ease, box-shadow .12s ease, border-color .14s ease;
}
.lb-chip:hover { transform: translateY(-2px); box-shadow: 0 8px 16px -6px rgba(15, 42, 80, .32); }
.lb-chip:active { cursor: grabbing; }
.lb-chip.lb-dragging { opacity: .35; }
.lb-chip-dot {
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--lb-hue); flex: none;
}
.lb-chip-name { white-space: nowrap; }
.lb-chip-kcal {
    font-size: 11px; font-weight: 800; color: #64748b;
    background: #eef2f7; border-radius: 999px; padding: 1px 7px;
}
.lb-chip-kcal::after { content: ' kcal'; font-weight: 700; color: #94a3b8; }

/* ---- Read-outs: food groups -------------------------------------------- */
.lb-readout {
    display: flex; flex-direction: column; gap: 16px;
    background: #ffffff; border: 1px solid #e2e8f0; border-radius: 14px;
    padding: 14px;
    box-shadow: 0 6px 16px -12px rgba(15, 42, 80, .4);
}
.lb-meters { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lb-meter {
    --lb-hue: #6b7280;
    display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px;
    padding: 6px 10px; border-radius: 10px;
    background: #f6f9fc; border: 1px solid #e7eef6;
    font-weight: 700; font-size: 13px;
}
.lb-meter-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--lb-hue); }
.lb-meter-name { color: #1f2a37; }
.lb-meter-count { font-weight: 800; color: var(--lb-hue); font-variant-numeric: tabular-nums; }
.lb-meter.is-empty { opacity: .55; }
.lb-meter.is-empty .lb-meter-dot { background: #cbd5e1; }
.lb-meter.is-empty .lb-meter-count { color: #94a3b8; }

/* ---- Read-outs: energy bar --------------------------------------------- */
.lb-energy-bar {
    position: relative;
    display: flex; height: 22px; border-radius: 999px; overflow: hidden;
    background: #eef2f7; border: 1px solid #e2e8f0;
}
.lb-energy-seg { height: 100%; min-width: 2px; transition: width .25s ease; }
.lb-energy-guide {
    position: absolute; top: -4px; bottom: -4px; width: 2px;
    background: #334155;
}
.lb-energy-guide::after {
    content: '▾'; position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
    color: #334155; font-size: 11px;
}
.lb-energy-total {
    margin-top: 7px; font-weight: 800; font-size: 13px; color: #334155;
    font-variant-numeric: tabular-nums;
}

.lb-summary {
    font-weight: 800; font-size: 13px; color: #475569;
    border-top: 1px dashed #e2e8f0; padding-top: 11px;
}

/* ---- Talk-about-it prompts (display-only; never typed) ------------------ */
.lb-your-turn {
    background: linear-gradient(180deg, #fffdf4, #fef7e3);
    border: 1px solid #f3e2a8; border-radius: 12px; padding: 11px 15px;
}
.lb-your-turn-label { font-weight: 800; color: #92691a; font-size: 13px; margin-bottom: 5px; }
.lb-your-turn-label i { margin-right: 5px; }
.lb-your-turn ul { margin: 0; padding-left: 20px; }
.lb-your-turn li { font-weight: 700; color: #6b4e12; margin: 3px 0; font-size: 14px; }

/* ---- Display mode: read-only IWB snapshot ------------------------------- */
/* The shelf is hidden by JS; centre the packed box + read-outs and lock drag. */
body.display-mode .lb-chip { cursor: default; }
body.display-mode .lb-box-hint { display: none; }
body.display-mode .lb-main { grid-template-columns: minmax(0, 1.3fr) minmax(240px, 1fr); }
.activity-container.display-mode .lb-chip:hover { transform: none; box-shadow: 0 2px 6px rgba(15, 42, 80, .12); }
