/* =====================================================================
   PJOK EduManager — tampilan "Lab" futuristik untuk Lab Gizi & Lab Gerak
   Menyatu dengan palet utama (biru → ungu → kuning) di style.css
   ===================================================================== */

.lab-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 28px 28px 24px;
    margin: 16px 0 24px;
    color: #e8edff;
    background:
        radial-gradient(600px circle at 90% -10%, rgba(246,195,67,.35), transparent 60%),
        radial-gradient(500px circle at 0% 110%, rgba(6,182,212,.35), transparent 60%),
        linear-gradient(135deg, #0b1440 0%, #1e1b5a 50%, #3b1d6e 100%);
    box-shadow: 10px 10px 24px var(--shadow-dark), -9px -9px 20px var(--shadow-light);
}
.lab-hero::after {             /* grid holografik */
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.9), transparent 85%);
    pointer-events: none;
}
.lab-hero > * { position: relative; z-index: 1; }
.lab-hero h4 { color: #fff; font-weight: 800; margin-bottom: 4px; }
.lab-hero .lab-kicker {
    font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
    color: #f6c343;
}
.lab-hero p { color: #c7d0f5; font-size: .9rem; margin-bottom: 0; max-width: 760px; }
.lab-tp {
    margin-top: 14px; padding: 12px 14px; border-radius: 14px;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
    font-size: .82rem; color: #dfe5ff;
}
.lab-tp b { color: #fff; }

/* ---------- Navigasi misi ---------- */
.mission-nav { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.mission-tab {
    flex: 1 1 170px;
    display: flex; align-items: center; gap: 10px;
    border: none; text-align: left;
    padding: 12px 14px; border-radius: 16px;
    background: linear-gradient(150deg, #ffffff 0%, var(--card-bg) 100%);
    box-shadow: 6px 6px 14px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    color: #334155; font-weight: 700; font-size: .82rem;
    transition: transform .15s ease, box-shadow .15s ease;
}
.mission-tab:hover { transform: translateY(-2px); }
.mission-tab .mt-num {
    width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px;
    display: grid; place-items: center;
    background: #eef2ff; color: var(--primary-dark); font-weight: 800;
}
.mission-tab small { display: block; font-weight: 600; color: var(--text-muted); font-size: .7rem; }
.mission-tab.active {
    background: linear-gradient(120deg, var(--primary) 0%, var(--accent-purple) 60%, #b07cf7 100%);
    color: #fff;
    box-shadow: 0 8px 22px rgba(139, 92, 246, .45);
}
.mission-tab.active small { color: #e0e7ff; }
.mission-tab.active .mt-num { background: rgba(255,255,255,.2); color: #fff; }
.mission-tab .mt-done { margin-left: auto; color: var(--accent-green); font-size: 1.1rem; }
.mission-tab.active .mt-done { color: #bbf7d0; }

.mission-pane { display: none; animation: labFade .25s ease; }
.mission-pane.active { display: block; }
@keyframes labFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Panel HUD (gelap) ---------- */
.hud {
    border-radius: var(--radius-md);
    padding: 18px;
    color: #e2e8ff;
    background: linear-gradient(160deg, #0f1a4a 0%, #1c1752 100%);
    box-shadow: inset 0 0 0 1px rgba(125, 150, 255, .25), 0 10px 24px rgba(15, 23, 74, .35);
}
.hud .hud-label { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #93a4e8; font-weight: 800; }
.hud .hud-value { font-size: 1.8rem; font-weight: 800; color: #fff; line-height: 1.1; }
.hud small, .hud .text-muted { color: #a9b6ea !important; }
.hud hr { border-color: rgba(255,255,255,.15); }
.hud-glow { text-shadow: 0 0 18px rgba(96, 165, 250, .65); }

/* ---------- Kotak info / tugas ---------- */
.task-box {
    border-radius: 14px; padding: 14px 16px; margin-bottom: 14px;
    background: rgba(37, 99, 235, .06);
    border-left: 4px solid var(--primary);
    font-size: .86rem;
}
.task-box.think  { background: rgba(139, 92, 246, .08); border-color: var(--accent-purple); }
.task-box.safe   { background: rgba(245, 158, 11, .10); border-color: var(--accent-yellow-deep); }
.task-box.good   { background: rgba(16, 185, 129, .09); border-color: var(--accent-green); }
.task-box.warn   { background: rgba(244, 63, 94, .08);  border-color: #f43f5e; }
.task-box .tb-title { font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; display: block; }

.lab-note { font-size: .74rem; color: var(--text-muted); }

/* ---------- Kartu pilihan (makanan, gerakan, produk) ---------- */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pick {
    position: relative;
    border: none; text-align: left;
    padding: 10px 12px; border-radius: 14px;
    background: linear-gradient(150deg, #ffffff 0%, var(--card-bg) 100%);
    box-shadow: 4px 4px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light);
    font-size: .8rem; color: #1e2333;
    transition: transform .12s ease;
}
.pick:hover { transform: translateY(-2px); }
.pick .pk-emoji { font-size: 1.5rem; line-height: 1; display: block; margin-bottom: 4px; }
.pick .pk-name { font-weight: 700; display: block; }
.pick .pk-sub { color: var(--text-muted); font-size: .7rem; display: block; }
.pick.selected { box-shadow: 0 0 0 2px var(--accent-purple), 4px 4px 10px var(--shadow-dark); }
.pick .pk-count {
    position: absolute; top: 6px; right: 8px;
    min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
    background: var(--accent-purple); color: #fff; font-size: .7rem; font-weight: 800;
    display: none; align-items: center; justify-content: center;
}
.pick.selected .pk-count { display: inline-flex; }

/* ---------- Chip & badge ---------- */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 999px;
    background: #eef2ff; color: #3730a3; font-size: .74rem; font-weight: 700;
    margin: 2px;
}
.chip button { border: 0; background: none; color: inherit; padding: 0; line-height: 1; font-size: .9rem; }
.chip.green { background: #dcfce7; color: #166534; }
.chip.amber { background: #fef3c7; color: #92400e; }
.chip.red   { background: #ffe4e6; color: #9f1239; }

/* ---------- Lampu lalu lintas gizi ---------- */
.traffic { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tl {
    border-radius: 12px; padding: 10px 8px; text-align: center; font-size: .72rem; font-weight: 700;
    background: #f1f5f9; color: #334155;
}
.tl b { display: block; font-size: 1.05rem; }
.tl.low  { background: #dcfce7; color: #166534; }
.tl.mid  { background: #fef3c7; color: #92400e; }
.tl.high { background: #ffe4e6; color: #9f1239; }
@media (max-width: 575.98px) { .traffic { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Label gizi (tiruan format Informasi Nilai Gizi) ---------- */
.ing-label {
    background: #fff; color: #111; border: 2px solid #111; border-radius: 6px;
    padding: 10px 12px; font-family: Arial, Helvetica, sans-serif; font-size: .78rem;
    max-width: 320px;
}
.ing-label .ing-title { font-weight: 900; font-size: 1rem; border-bottom: 6px solid #111; padding-bottom: 2px; margin-bottom: 4px; }
.ing-label .ing-row { display: flex; justify-content: space-between; border-bottom: 1px solid #111; padding: 2px 0; gap: 8px; }
.ing-label .ing-row.thick { border-bottom-width: 4px; }
.ing-label .ing-row.indent span:first-child { padding-left: 12px; }
.ing-label .ing-hl { cursor: pointer; border-radius: 3px; transition: background .15s; }
.ing-label .ing-hl:hover, .ing-label .ing-hl.found { background: #fde68a; }

/* ---------- Meter / bar ---------- */
.meter { height: 12px; border-radius: 999px; background: #e2e8f0; overflow: hidden; position: relative; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #06b6d4, #2563eb, #8b5cf6); transition: width .4s ease; }
.meter.warn > span { background: linear-gradient(90deg, #f59e0b, #f43f5e); }
.meter .meter-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #0f172a; }
.hud .meter { background: rgba(255,255,255,.12); }

/* ---------- Piring Isi Piringku ---------- */
.plate-wrap { display: flex; justify-content: center; }
.plate-svg { width: 100%; max-width: 280px; height: auto; filter: drop-shadow(6px 8px 14px rgba(37,60,130,.25)); }

/* ---------- Skor cincin ---------- */
.score-ring { width: 120px; height: 120px; display: block; margin: 0 auto; }

/* ---------- Mode latihan (layar penuh) ---------- */
.workout-overlay {
    position: fixed; inset: 0; z-index: 2000;
    display: none; flex-direction: column; align-items: center; justify-content: center;
    padding: 20px; text-align: center; color: #fff;
    background:
        radial-gradient(800px circle at 50% 0%, rgba(139,92,246,.45), transparent 60%),
        linear-gradient(160deg, #070d2e 0%, #1a1350 100%);
}
.workout-overlay.show { display: flex; }
.wo-phase { font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: #f6c343; font-weight: 800; }
.wo-name { font-size: clamp(1.5rem, 5vw, 2.6rem); font-weight: 800; margin: 6px 0; }
.wo-cue { color: #c7d0f5; max-width: 560px; font-size: .95rem; min-height: 2.6em; }
.wo-timer { font-size: clamp(4rem, 18vw, 8rem); font-weight: 900; line-height: 1; margin: 10px 0; text-shadow: 0 0 30px rgba(96,165,250,.7); font-variant-numeric: tabular-nums; }
.wo-ring { width: min(70vw, 260px); height: min(70vw, 260px); }
.wo-controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.wo-controls .btn { min-width: 120px; }
.wo-stop { background: #f43f5e !important; color: #fff !important; }
.wo-progress { width: min(560px, 90vw); margin-top: 18px; }

/* ---------- Jam 24 jam (audit) ---------- */
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* ---------- Sistem tubuh (mesin waktu) ---------- */
.body-sys { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.sys-card { border-radius: 14px; padding: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.sys-card .sys-icon { font-size: 1.5rem; }
.sys-card .sys-name { font-weight: 800; color: #fff; font-size: .9rem; }
.sys-card .sys-text { font-size: .78rem; color: #c7d0f5; min-height: 3.6em; }
.sys-card .meter { margin-top: 8px; }

/* ---------- Kuis ---------- */
.quiz-q { margin-bottom: 18px; }
.quiz-q .qq-text { font-weight: 700; font-size: .9rem; margin-bottom: 8px; }
.quiz-opt {
    display: block; width: 100%; text-align: left; border: none;
    padding: 9px 12px; margin-bottom: 6px; border-radius: 12px; font-size: .84rem;
    background: linear-gradient(145deg, #ffffff, #eef1f9);
    box-shadow: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
}
.quiz-opt.correct { background: #dcfce7; color: #166534; font-weight: 700; }
.quiz-opt.wrong { background: #ffe4e6; color: #9f1239; }
.quiz-opt:disabled { opacity: 1; }
.quiz-why { font-size: .78rem; color: var(--text-muted); display: none; margin-top: 4px; }
.quiz-q.answered .quiz-why { display: block; }

/* ---------- Cetak ---------- */
.print-only { display: none; }
@media print {
    .lab-hero, .mission-nav, .no-print, .workout-overlay { display: none !important; }
    .mission-pane { display: none !important; }
    .mission-pane.print-target { display: block !important; }
    .print-only { display: block !important; }
    .report-panel:not(.print-target) { display: none !important; }
    .neu-panel, .hud { box-shadow: none !important; }
    .hud { background: #fff !important; color: #111 !important; border: 1px solid #999; }
    .hud .hud-value, .hud .hud-label, .hud small { color: #111 !important; text-shadow: none; }
}
