/* Linux Lab - Shared Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #0c0c0c; }

body {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 13.5px;
  color: #cdd6f4;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ TOPBAR ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#topbar {
  background: #181825;
  border-bottom: 1px solid #313244;
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  flex-shrink: 0;
  z-index: 10;
}
#topbar-title { color: #cdd6f4; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
#topbar-phase { color: #a6adc8; font-size: 11px; flex: 1; }
#topbar-score {
  color: #a6e3a1; font-size: 12px; font-weight: 700;
  background: #1e1e2e; border: 1px solid #313244;
  padding: 2px 10px; border-radius: 4px;
}
#topbar-prog-wrap { width: 160px; height: 4px; background: #313244; border-radius: 2px; }
#topbar-prog      { height: 100%; background: #89b4fa; border-radius: 2px; transition: width .4s; width: 0; }
#topbar-counter   { color: #a6adc8; font-size: 11px; white-space: nowrap; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━ MAIN LAYOUT ━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#main {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ TERMINAL ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#terminal-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #1e1e2e;
}

#output {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px 8px;
  min-height: 0;
  scroll-behavior: smooth;
}
#output::-webkit-scrollbar { width: 7px; }
#output::-webkit-scrollbar-track { background: transparent; }
#output::-webkit-scrollbar-thumb { background: #313244; border-radius: 4px; }

.line {
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 1.4em;
}
.ln-default { color: #cdd6f4; }
.ln-dim     { color: #9399b2; }
.ln-green   { color: #a6e3a1; }
.ln-red     { color: #f38ba8; }
.ln-blue    { color: #89b4fa; }
.ln-yellow  { color: #f9e2af; }
.ln-cyan    { color: #89dceb; }
.ln-dir     { color: #89b4fa; font-weight: 700; }
.ln-exec    { color: #a6e3a1; }
.ln-echo    { color: #cdd6f4; }

.prompt-echo { color: #9399b2; }

#input-row {
  display: flex;
  align-items: center;
  padding: 7px 16px 9px;
  border-top: 1px solid #313244;
  background: #181825;
  flex-shrink: 0;
  gap: 0;
}
.ps-user   { color: #a6e3a1; }
.ps-at     { color: #9399b2; }
.ps-host   { color: #a6e3a1; }
.ps-colon  { color: #9399b2; }
.ps-path   { color: #89b4fa; }
.ps-dollar { color: #cdd6f4; margin-right: 6px; }

#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #cdd6f4;
  font-family: inherit;
  font-size: 13.5px;
  caret-color: #cdd6f4;
}
#cmd-input:disabled { opacity: .35; }
#cmd-input::placeholder { color: #7f849c; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SIDEBAR ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#sidebar {
  width: 340px;
  flex-shrink: 0;
  background: #181825;
  border-left: 1px solid #313244;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#sidebar-scroll::-webkit-scrollbar { width: 5px; }
#sidebar-scroll::-webkit-scrollbar-thumb { background: #313244; border-radius: 3px; }

.sb-phase {
  font-size: 10px; letter-spacing: .12em;
  color: #a6adc8; text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1px solid #313244;
}

.sb-task-num {
  font-size: 11px; color: #a6adc8;
  margin-bottom: 2px;
}
.sb-task-pts {
  display: inline-block;
  font-size: 11px; color: #f9e2af;
  background: #2a2a3e; border: 1px solid #45475a;
  padding: 1px 8px; border-radius: 3px;
  margin-bottom: 10px;
}

.sb-desc {
  color: #cdd6f4; font-size: 12px; line-height: 1.7;
  background: #1e1e2e; border: 1px solid #313244;
  border-left: 3px solid #89b4fa;
  padding: 10px 12px; border-radius: 4px;
}

.sb-score-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #1e1e2e; border: 1px solid #313244;
  padding: 8px 12px; border-radius: 4px;
}
.sb-score-label { color: #a6adc8; font-size: 11px; }
.sb-score-val   { color: #a6e3a1; font-size: 15px; font-weight: 700; }

#feedback-area {
  font-size: 12px; line-height: 1.6; padding: 9px 12px;
  border-radius: 4px; border: 1px solid transparent;
  display: none;
}
#feedback-area.fb-pass {
  display: block;
  background: #1a2e1f; border-color: #a6e3a1; color: #a6e3a1;
}
#feedback-area.fb-fail {
  display: block;
  background: #2e1a1a; border-color: #f38ba8; color: #f38ba8;
}

#check-btn {
  width: 100%; padding: 10px;
  background: #313244; color: #cdd6f4;
  border: 1px solid #45475a;
  border-radius: 5px; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 700;
  letter-spacing: .03em;
  transition: background .15s, border-color .15s, color .15s;
}
#check-btn:hover:not(:disabled) {
  background: #45475a; border-color: #89b4fa; color: #89b4fa;
}
#check-btn:disabled { opacity: .35; cursor: default; }
#check-btn.active {
  background: #1e3a2e; border-color: #a6e3a1; color: #a6e3a1;
}
#check-btn.active:hover:not(:disabled) {
  background: #264d3a; border-color: #a6e3a1;
}

#sidebar-footer { padding: 12px 16px; border-top: 1px solid #313244; flex-shrink: 0; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━ SIDEBAR MCQ ━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.mcq-question {
  color: #cdd6f4; font-size: 12px; line-height: 1.7;
  background: #1e1e2e; border: 1px solid #313244;
  border-left: 3px solid #cba6f7;
  padding: 10px 12px; border-radius: 4px;
  margin-bottom: 12px;
}

.mcq-opt {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 12px; margin-bottom: 7px;
  border-radius: 5px; cursor: pointer;
  border: 1px solid #313244;
  background: #181825;
  transition: background .12s, border-color .12s;
  font-size: 12.5px; line-height: 1.55;
}
.mcq-opt:hover:not(.locked) {
  background: #252540; border-color: #89b4fa;
}
.mcq-opt.selected:not(.locked) {
  background: #1e2a3e; border-color: #89b4fa; color: #89b4fa;
}
.mcq-opt.selected:not(.locked) .mcq-key {
  background: #89b4fa; color: #000;
}
.mcq-opt.correct { background: #1a2e1f; border-color: #a6e3a1 !important; color: #a6e3a1; }
.mcq-opt.wrong   { background: #2e1a1a; border-color: #f38ba8 !important; color: #f38ba8; }
.mcq-opt.locked  { cursor: default; }

.mcq-key {
  flex-shrink: 0; width: 22px; height: 22px;
  background: #313244; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #cdd6f4; margin-top: 1px;
}
.correct .mcq-key { background: #a6e3a1; color: #000; }
.wrong   .mcq-key { background: #f38ba8; color: #000; }

#mcq-view .mcq-opt {
  font-size: 11px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

#mcq-view .mcq-key {
  width: 20px; height: 20px;
  font-size: 10px;
}

.mcq-explain {
  display: none;
  font-size: 11px; color: #bac2de; line-height: 1.6;
  margin-top: 12px; padding: 10px;
  background: #1e1e2e; border: 1px solid #313244;
  border-radius: 4px;
}
.mcq-explain.show { display: block; }

#mcq-continue-btn {
  display: none; margin-top: 12px; width: 100%;
  padding: 9px; background: #1e3a2e;
  color: #a6e3a1; border: 1px solid #a6e3a1;
  border-radius: 5px; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 700;
  transition: background .15s;
}
#mcq-continue-btn:hover { background: #264d3a; }
#mcq-continue-btn.show { display: block; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ RESULTS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
#results-screen {
  display: none;
  position: fixed; inset: 0;
  background: #1e1e2e;
  overflow-y: auto;
  padding: 40px 32px 60px;
  z-index: 200;
}
#results-screen::-webkit-scrollbar { width: 7px; }
#results-screen::-webkit-scrollbar-thumb { background: #313244; border-radius: 4px; }

.rs-wrap { max-width: 600px; margin: 0 auto; }
.rs-header-label { color: #a6adc8; font-size: 11px; letter-spacing: .1em; margin-bottom: 6px; }
.rs-title { color: #cdd6f4; font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.rs-sub   { color: #a6adc8; font-size: 12px; margin-bottom: 32px; }

.rs-score-card {
  background: #181825; border: 1px solid #313244;
  border-radius: 8px; padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.rs-big { font-size: 36px; font-weight: 700; }
.rs-big em { font-style: normal; }
.rs-pct { color: #a6adc8; font-size: 14px; margin-top: 2px; }
.rs-grade { font-size: 14px; font-weight: 700; padding: 5px 14px; border-radius: 4px; }

.rs-section {
  font-size: 10px; letter-spacing: .1em; color: #a6adc8;
  text-transform: uppercase; margin-bottom: 10px; margin-top: 24px;
  padding-bottom: 6px; border-bottom: 1px solid #313244;
}

.cmd-row {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid #1e1e2e;
}
.cmd-name { color: #89b4fa; font-size: 12px; width: 72px; flex-shrink: 0; }
.cmd-bar  { flex: 1; height: 6px; background: #313244; border-radius: 3px; overflow: hidden; }
.cmd-fill { height: 100%; border-radius: 3px; transition: width .8s .1s; }
.cmd-frac { color: #a6adc8; font-size: 11px; width: 52px; text-align: right; flex-shrink: 0; }
.cmd-tag  {
  font-size: 10px; padding: 2px 7px; border-radius: 3px; flex-shrink: 0;
  font-weight: 700; letter-spacing: .04em;
}
.tag-great    { background: #1a2e1f; color: #a6e3a1; }
.tag-ok       { background: #2e2a1a; color: #f9e2af; }
.tag-review   { background: #2e1a1a; color: #f38ba8; }

.rs-review-cmds { color: #f38ba8; font-size: 12px; line-height: 2; margin-top: 6px; }
.rs-note { color: #a6adc8; font-size: 12px; line-height: 1.7; margin-top: 6px; }

.rs-btn-row {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.rs-retry-btn, .rs-nav-btn {
  display: inline-block;
  padding: 10px 24px;
  background: #1e1e2e;
  border: 1px solid #89b4fa;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: background .15s;
  text-decoration: none;
}

.rs-retry-btn {
  color: #89b4fa;
}
.rs-retry-btn:hover { background: #252545; }

.rs-nav-btn {
  color: #a6e3a1;
  border-color: #a6e3a1;
}
.rs-nav-btn:hover { background: #1a2e1f; }

.rs-home-btn {
  color: #a6adc8;
  border-color: #6c7086;
}
.rs-home-btn:hover { background: #252540; color: #cdd6f4; }
