@charset "utf-8";

@font-face {
  font-family: "DejaVuSansMonoSemiCondensed";
  font-style: normal;
  font-weight: normal;
  src: url("https://horstmann.com/fonts/DejaVuSansMonoSemiCondensed.woff")
}

@font-face {
  font-family: "MarkingPen";
  font-style: normal;
  font-weight: normal;
  src: url("https://horstmann.com/fonts/MarkingPen.woff")
}

.pseudo {
  font-family: "MarkingPen";
}

.studentFiles, .providedFiles {
  display: none;
}

.ace_editor {
  /* border: 1px solid #EEE; */
  /* TODO: If we want a border, put all editor divs inside a div with a border */
  min-width: 700px;
}

.ace_gutter {
  width: 4em !important;
}

.ace_gutter-cell {
  padding-right: 1em !important;
}

.ace_gutter-layer {
  display: inline !important;
}

.ace_hidden-cursors {
  opacity: 0
}

.ace_scrollbar {
  display: none;
}

/* ── Page shell — matching code-problem-ai.html ── */
body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f0f4f8;
  margin: 0; padding: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  color: #1e2a3a;
  box-sizing: border-box;
}

/* ── Nav bar ── */
.cc-nav {
  background: #1e3a5f;
  height: 48px; flex-shrink: 0;
  display: flex; align-items: center;
  padding: 0 16px; gap: 12px;
}
.cc-nav-back {
  color: #93c5fd; font-size: 13px; text-decoration: none;
  display: flex; align-items: center; gap: 4px; opacity: 0.85;
  transition: opacity 0.15s;
}
.cc-nav-back:hover { opacity: 1; color: #93c5fd; }
.cc-nav-brand {
  font-size: 17px; font-weight: 700; color: #fff;
  margin-left: auto; letter-spacing: 0.3px;
}

/* ── Two-panel layout ── */
.cc-layout {
  display: flex; flex: 1; overflow: hidden;
}

.cc-left-panel {
  width: 280px; min-width: 280px;
  background: #ffffff;
  border-right: 1.5px solid #e2e8f0;
  display: flex; flex-direction: column;
  overflow: hidden; flex-shrink: 0;
}
.cc-panel-header {
  background: #f8fafc; border-bottom: 1.5px solid #e2e8f0;
  padding: 10px 16px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: #64748b; flex-shrink: 0;
}
.cc-problem-body {
  flex: 1; overflow-y: auto;
  padding: 20px 18px;
  font-size: 13.5px; line-height: 1.65; color: #1e2a3a;
}
.cc-problem-body h1, .cc-problem-body h2 {
  font-size: 15px; font-weight: 600; margin: 0 0 10px;
}
.cc-problem-body p { margin: 0 0 10px; }
.cc-problem-body code {
  background: #f1f5f9; padding: 2px 6px;
  border-radius: 4px; font-size: 12px;
  font-family: 'Roboto Mono', monospace;
}
.cc-problem-body pre {
  background: #f1f5f9; padding: 12px; border-radius: 8px;
  font-size: 12px; overflow-x: auto;
  font-family: 'Roboto Mono', monospace;
}

.cc-right-panel {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background: #ffffff;
}

/* ── Editor header bar (filename + button area) ── */
.cc-editor-header {
  background: #f8fafc; border-bottom: 1.5px solid #e2e8f0;
  height: 42px; flex-shrink: 0;
  display: flex; align-items: center; padding: 0 14px; gap: 10px;
}
.cc-file-label {
  font-size: 12px; font-weight: 600; color: #475569;
  font-family: 'Roboto Mono', monospace;
}

.cc-editor-area {
  flex: 1; overflow: auto; display: flex; flex-direction: column;
}

/* ── horstmann_codecheck widget resets ── */
.horstmann_codecheck {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  flex: 1;
}

/* ── Filename label inside widget: hide (shown in our header) ── */
.codecheckFilename {
  display: none !important;
}

/* ── Embedded inside assignment (iframe with _cc_aid) — no scroll ── */
.in-assignment body { min-height: 100vh; overflow-y: auto; display: flex; flex-direction: column; background: #fff; }
.in-assignment .cc-nav,
.in-assignment .cc-left-panel,
.in-assignment .cc-editor-header { display: none !important; }
.in-assignment .cc-layout { flex: 1; }
.in-assignment .cc-right-panel { flex: 1; display: flex; flex-direction: column; background: #fff; }
.in-assignment .cc-editor-area { display: flex; flex-direction: column; }
.in-assignment .horstmann_codecheck { display: flex; flex-direction: column; }
.in-assignment .horstmann_codecheck form { display: flex; flex-direction: column; }
.in-assignment .horstmann_codecheck .file { display: flex; flex-direction: column; }
.in-assignment form:has(.horstmann_rearrange) .file { flex: none; }
.in-assignment .horstmann_rearrange { flex: none; overflow: visible; border-radius: 0; border-left: none; border-right: none; border-top: none; }
.in-assignment .horstmann_rearrange > div { display: flex; flex-direction: column; }
.in-assignment .horstmann_rearrange .left { flex: none; overflow-y: auto; border-bottom: 3px solid #b0b8be; }
.in-assignment .horstmann_rearrange .right { flex-shrink: 0; overflow: visible; }
.in-assignment form:has(.horstmann_rearrange) .codecheckSubmit { flex-shrink: 0; }
.in-assignment .codecheck-submit-response { flex-shrink: 0; }

.file:has(.horstmann_rearrange) .codecheckFilename {
  display: none;
}

/* Parsons submit button — top placement, LeetCode style */
form:has(.horstmann_rearrange) .codecheckSubmit {
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px 4px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 12px;
}

form:has(.horstmann_rearrange) .codecheckSubmit .hc-button.hc-start {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  order: -1;
}

form:has(.horstmann_rearrange) .codecheckSubmit .hc-button.hc-start:hover:not(.hc-disabled) {
  background: #1d4ed8;
}

form:has(.horstmann_rearrange) .codecheckSubmit .hc-button.hc-start.hc-disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

form:has(.horstmann_rearrange) .codecheckSubmit .hc-button:not(.hc-start) {
  display: none;
}

code, pre {
  font-family: 'Roboto Mono', monospace;
}

pre {
  font-size: 110%;
}

.editor {
  width: 100%;
  padding: 0 16px;
  box-sizing: border-box;
}

/* Submit button bar */
.codecheckSubmit {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  gap: 8px;
}

#submit {
  margin: 0.8em;
}

.exercise-button {
  margin: 0.5em;
  padding: 0.5em;
}

.exercise-button.active {
  background: #FFF8C4;
}

.exercise-iframe {
  width: 100%;
  border-width: 0;
  overflow: hidden;
  min-height: calc(100vh - 140px);
}

/* Shape for all buttons */
.hc-button {
  font-weight: bold;
  color: #FFFFFF;
  cursor: pointer;
  padding: 0.2em .56em;
  border-radius: 0.56em;
  position: relative;
  font-size: 75%;
  margin-left: 1em;
  margin-right: 1em;
  user-select: none;
  display: inline-block;
  text-decoration: none;
}

#buttons>hc-button {
  margin-bottom: 0.5em;
}

/* Button states */
.hc-button:focus {
  border: solid 0.2em #c0c0c0;
  border-radius: 0.56em;
}

.hc-button.hc-step.hc-disabled {
  background: #707070;
  pointer-events: none;
}

.hc-button.hc-start.hc-disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.hc-button.hc-start, .hc-button.hc-step.active {
  background: #059669;
}
.hc-button.hc-start:hover:not(.hc-disabled) {
  background: #047857 !important;
}

.hc-button.hc-step {
  background: #0054a8;
}

.hc-button.hc-command {
  background: #E19042;
}

.ccid, .ccurl {
  font-family: "DejaVuSansMonoSemiCondensed";
}

#response {
  border: solid thin red;
  padding: 0.5em;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

#response:empty {
  border: none;
}

/* ── Submit / check result ── */
.codecheck-submit-response {
  background: #f8fafc;
  color: #1e293b;
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 12.5px;
  padding: 14px 16px;
  border-top: 1.5px solid #e2e8f0;
  border-radius: 0 0 10px 10px;
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
  line-height: 1.6;
}
.codecheck-submit-response:empty { display: none; }
.codecheck-submit-response * { max-width: 100%; box-sizing: border-box; }
.codecheck-submit-response .pass  { color: #16a34a; font-weight: 600; }
.codecheck-submit-response .fail  { color: #dc2626; font-weight: 600; }
.codecheck-submit-response .header { color: #64748b; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; }
.codecheck-submit-response .note  { color: #2563eb; }
.codecheck-submit-response td, .codecheck-submit-response th { background: #f1f5f9; color: #1e293b; padding: 4px 8px; border: 1px solid #e2e8f0; }
.codecheck-submit-response table.file td { background: #ffffff; color: #334155; }
.codecheck-submit-response .linenumber { color: #94a3b8; }

#abovebuttons {
  border-top: solid thin gray;
  padding-top: 0.5em;
}

#ccidBullets>li {
  padding-top: 0.35em;
  padding-bottom: 0.35em;
}

#buttonDiv {
  padding-top: 0.35em;
  padding-bottom: 0.35em;
}

#submissions td {
  background-color: #eee;
}

/* ══════════════════════════════════════════
   Parsons / Rearrange  —  Dev Gym style
   ══════════════════════════════════════════ */

.horstmann_rearrange .hc-hand {
  font-size: 111%;
}

/* ── Contained box with border ── */
.horstmann_rearrange {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cdd2d6;
  border-radius: 5px;
  overflow: hidden;
}

/* ── Outer wrapper: answer area top, bank bottom ── */
.horstmann_rearrange > div {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0;
}

/* ── Shared font for both panels ── */
.horstmann_rearrange .left,
.horstmann_rearrange .right {
  font-family: 'Poppins', sans-serif;
  font-size: 13.5px;
  user-select: none;
  -moz-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  box-sizing: border-box;
  width: 100%;
}

/* ── Section labels ── */
.horstmann_rearrange .section-label {
  font-size: 0.7em;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: #6b7d87;
  text-transform: uppercase;
  padding: 0.4em 1.2em 0.25em;
}

.horstmann_rearrange .section-label-answer {
  background: #fff;
  border-bottom: 1px solid #e0e4e7;
}

.horstmann_rearrange .section-label-bank {
  background: #eaeef0;
  border-bottom: 1px solid #d4d8db;
}

/* ── Answer-building area (top) ── */
.horstmann_rearrange .left {
  display: block;
  padding: 1em 1.2em 1.4em 1.2em;
  background-color: #ffffff !important;
  border: none;
  border-bottom: 3px solid #b0b8be;
  min-height: 7em;
  white-space: pre-wrap;
  overflow: hidden;
  counter-reset: query-line;
}

/* ── Drop slots — visible placeholder boxes ── */
.horstmann_rearrange .drop-slot {
  display: block;
  height: 2em;
  margin: 3px 0;
  border: 2px dashed #b0c4cf;
  border-radius: 4px;
  background: #f0f6f9;
  box-sizing: border-box;
  transition: background 0.1s ease, border-color 0.1s ease;
}

/* Green highlight when a tile is dragged over a slot */
.horstmann_rearrange .drop-slot.slot-active {
  background: #d4f5dc;
  border-color: #3aaa5c;
  border-style: solid;
}

/* Drop-zone highlight for answer area — only border, no background flash */
.horstmann_rearrange .left.dragover {
  outline: none;
  border-bottom: 3px solid #5b9bd5;
}

/* ── Token bank (bottom) — single column so long tiles show fully ── */
.horstmann_rearrange .right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0.9em 1.2em 1.1em 1.2em;
  background: #eaeef0;
  border: none;
  white-space: normal;
  overflow: visible;
}

/* ── Tiles placed in the answer area — teal like Dev Gym ── */
.horstmann_rearrange .left .tile:not(.fixed) {
  display: block;
  margin: 3px 0;
  padding: 0.3em 0.7em;
  background: #1a7a9b;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: default;
  transition: background 0.12s ease, box-shadow 0.12s ease;
  white-space: pre;
}

.horstmann_rearrange .left .tile:not(.fixed):hover {
  background: #15698a;
  box-shadow: 0 2px 6px rgba(0,60,90,0.22);
}

/* ── Bank tiles — light gray, full column width, rectangular ── */
.horstmann_rearrange .right .tile {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.3em 0.7em;
  background: #d4d8db;
  color: #1e2a30;
  border: none;
  border-radius: 3px;
  cursor: default;
  transition: background 0.1s ease, box-shadow 0.1s ease;
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.horstmann_rearrange .right .tile:hover {
  background: #bec4c9;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* ── Focus & drag-active states ── */
.horstmann_rearrange .tile:focus {
  outline: 2px solid #1a7a9b;
  outline-offset: 1px;
}

.horstmann_rearrange .tile:active {
  cursor: default;
}

/* ── Per-tile drag-over highlight ── */
.horstmann_rearrange .tile.drag-hover {
  outline: 2px solid #5b9bd5;
  outline-offset: 1px;
  background: #cce4f0 !important;
}

/* ── Fixed structural tokens — dark teal bar with line counter ── */
.horstmann_rearrange .fixed {
  display: flex;
  align-items: center;
  gap: 0.55em;
  background: #2b5d77;
  color: #ffffff;
  margin: 3px 0;
  padding: 0.3em 0.7em;
  border-radius: 4px;
  cursor: default;
  border: none;
  counter-increment: query-line;
  white-space: pre;
}

/* No numbered badges on fixed tokens */

/* Block child pointer-events during drag so parent drop target fires, but not slots */
.horstmann_rearrange .dragover *:not(.drop-slot) {
  pointer-events: none;
}

/* ── Click-mode: answer slots ── */
.horstmann_rearrange .parsons-slot {
  display: flex;
  align-items: center;
  height: 2.2em;
  margin: 3px 0;
  padding: 0 0.7em;
  border: 2px dashed #b0c4cf;
  border-radius: 4px;
  background: #f0f6f9;
  box-sizing: border-box;
  font-family: monospace;
  font-size: 13.5px;
  transition: background 0.1s ease, border-color 0.1s ease;
  gap: 0.5em;
}

.horstmann_rearrange .parsons-slot-arrow {
  color: #1a7a9b;
  font-size: 1.1em;
  flex-shrink: 0;
}

.horstmann_rearrange .parsons-slot-label {
  color: #6b7d87;
  font-style: italic;
}

.horstmann_rearrange .parsons-slot-label.parsons-slot-filled {
  color: #1e2a30;
  font-style: normal;
  font-family: monospace;
  white-space: pre-wrap;
  background: #c8d8e0;
  padding: 1px 6px;
  border-radius: 3px;
  flex: 1;
}

.horstmann_rearrange .parsons-slot-erase {
  display: none;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: 1px solid #cbd5e1;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: inherit;
  transition: background .12s, color .12s, border-color .12s;
}
.horstmann_rearrange .parsons-slot-erase:hover {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fca5a5;
}

/* ── Click-mode: bank blocks ── */
.horstmann_rearrange .parsons-block {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.35em 0.7em;
  background: #d4d8db;
  color: #1e2a30;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-align: left;
  font-family: monospace;
  font-size: 13.5px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: visible;
  box-sizing: border-box;
  transition: background 0.1s ease, box-shadow 0.1s ease;
}

.horstmann_rearrange .parsons-block:hover:not(:disabled) {
  background: #bec4c9;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.horstmann_rearrange .parsons-block.parsons-block-used,
.horstmann_rearrange .parsons-block:disabled {
  background: #eaeef0;
  color: #aab0b5;
  cursor: default;
  opacity: 0.6;
}

/* ── Color annotations on slots ── */
.horstmann_rearrange .parsons-slot.hc-bad {
  background: #fca5a5 !important;
  border-color: #dc2626 !important;
  border-style: solid !important;
}
.horstmann_rearrange .parsons-slot.hc-bad .parsons-slot-label.parsons-slot-filled {
  background: transparent;
  color: #991b1b;
}

.horstmann_rearrange .parsons-slot.hc-good {
  background: #86efac !important;
  border-color: #16a34a !important;
  border-style: solid !important;
}
.horstmann_rearrange .parsons-slot.hc-good .parsons-slot-label.parsons-slot-filled {
  background: transparent;
  color: #166534;
}

.horstmann_rearrange .parsons-slot.hc-yellow {
  background: #fde68a !important;
  border-color: #d97706 !important;
  border-style: solid !important;
}
.horstmann_rearrange .parsons-slot.hc-yellow .parsons-slot-label.parsons-slot-filled {
  background: transparent;
  color: #92400e;
}

/* Error annotation (legacy, for non-Parsons errors) */
.horstmann_rearrange .hc-bad {
  background: #fca5a5 !important;
  color: #991b1b !important;
}

/* Correct position annotation (legacy) */
.horstmann_rearrange .hc-good {
  background: #86efac !important;
  color: #166534 !important;
}

th a {
  color: black;
  text-decoration: none;
  transition: color 0.3s;
}

th a:hover {
  color: grey;
}

th.ascending a:after {
  content: ' △';
}

th.descending a:after {
  content: ' ▽';
}
/* ── Improved problem navigation ── */
#buttons {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  padding: 10px 16px;
  border-bottom: 2px solid #dde3ea;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#buttons:not(:has(.problem-title-display))::before {
  content: 'Go to:';
  font-size: 13px;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
}

.problem-title-display {
  font-size: 14px;
  font-weight: 600;
  color: #1e2a3a;
  text-align: center;
}

.problem-title-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

#problem-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
}

#description-panel {
  width: 280px;
  flex-shrink: 0;
  padding: 20px 18px;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  font-size: 14px;
  line-height: 1.65;
  color: #334155;
  min-height: 500px;
  overflow-y: auto;
}

[data-theme="dark"] #description-panel {
  background: #1e2a3a;
  border-right-color: #334155;
  color: #cbd5e1;
}

#description-panel p { margin: 0 0 10px; }
#description-panel p:last-child { margin-bottom: 0; }
#description-panel code { background: #e2e8f0; padding: 1px 5px; border-radius: 4px; font-size: 12px; font-family: monospace; color: #1e3a5f; }
[data-theme="dark"] #description-panel code { background: #334155; color: #93c5fd; }
#description-panel ul, #description-panel ol { padding-left: 18px; margin: 0 0 10px; }
#description-panel li { margin-bottom: 4px; }

#problem-area {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

.hc-button.hc-step {
  font-size: 0.95rem !important;
  padding: 0.5em 1.3em !important;
  border-radius: 6px !important;
  margin: 0 !important;
}

.hc-button.hc-command {
  font-size: 0.9rem !important;
  padding: 0.45em 1.1em !important;
  margin: 0 2px !important;
}

/* ── Instructor feedback area (student view) ── */
#student_comment_div {
  margin: 24px 0 16px;
  padding: 14px 16px;
  background: #f0f9ff;
  border-left: 4px solid #0ea5e9;
  border-radius: 6px;
}

#student_comment_div label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: #0369a1;
  margin-bottom: 8px;
}

#student_comment {
  width: 100% !important;
  background: transparent;
  border: none;
  font-size: 14px;
  color: #1e3a5f;
  resize: none;
  outline: none;
}

/* ── Instructor comment write area ── */
#instructor_comment_div {
  margin-top: 12px;
  padding: 12px 16px;
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  border-radius: 6px;
}

#instructor_comment_div label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: #92400e;
  margin-bottom: 8px;
}

#instructor_comment {
  width: 100% !important;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 8px;
  font-size: 14px;
  resize: vertical;
}

/* ── Return URL info bar ── */
#return-url-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 7px 16px;
  background: #f0f9ff;
  border-bottom: 1px solid #bae6fd;
  font-size: 12px;
}

/* ── Problem nav buttons: white default, blue when active ── */
.hc-button.hc-step {
  background: #fff !important;
  color: #2e4566 !important;
  border: 2px solid #cbd5e1 !important;
  font-size: 0.95rem !important;
  padding: 0.45em 1.3em !important;
  border-radius: 6px !important;
  margin: 0 !important;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.hc-button.hc-step:hover {
  border-color: #0054a8 !important;
  color: #0054a8 !important;
}

.hc-button.hc-step.active {
  background: #0054a8 !important;
  color: #fff !important;
  border-color: #0054a8 !important;
  box-shadow: none !important;
}

.hc-button.hc-step.hc-disabled {
  background: #fff !important;
  color: #aaa !important;
  border-color: #e2e8f0 !important;
  pointer-events: none;
}

.hc-button.hc-start.hc-disabled {
  opacity: 0.4 !important;
  cursor: default !important;
  pointer-events: none !important;
}


/* ── Mobile (≤640px) ── */
@media (max-width: 640px) {
  .ace_editor { min-width: 0 !important; }
  #buttons { padding: 8px 12px; gap: 6px; }
}
