/* ============================================================================
   css/dock.css — Bottom Coding Dock, Choice Chips, Ghost Type-Guide & Modal
   ============================================================================ */
.bottom-dock {
  height: 270px;
  min-height: 255px;
  max-height: 285px;
  background: var(--bg-panel);
  border-top: 2px solid rgba(56, 189, 248, 0.35);
  display: grid;
  grid-template-columns: minmax(430px, 38%) 1fr;
  gap: 10px;
  padding: 8px 12px;
  flex-shrink: 0;
  z-index: 20;
}

.dock-col-modules {
  min-width: 0;
  background: rgba(8, 12, 26, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.col-header {
  padding: 6px 10px;
  background: rgba(24, 34, 64, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.module-list-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.mod-pill {
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 7px;
  padding: 5px 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mod-pill:hover { border-color: var(--accent-cyan); }
.mod-pill.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-cyan);
  box-shadow: inset 0 0 8px rgba(56, 189, 248, 0.25);
}
.mod-pill.done { border-color: rgba(16, 185, 129, 0.55); }
.mod-num {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  color: var(--accent-gold);
  display: flex;
  justify-content: space-between;
}
.mod-name {
  font-size: 10.5px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-col-typing {
  min-width: 0;
  overflow: hidden;
  background: rgba(8, 12, 26, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 5px;
}

.step-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.step-card {
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 7px;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.step-card.active { border-color: var(--accent-cyan); background: rgba(56, 189, 248, 0.14); }
.step-card.completed { border-color: var(--accent-emerald); background: rgba(16, 185, 129, 0.12); }
.step-top { display: flex; justify-content: space-between; font-size: 9.5px; font-weight: 700; color: var(--text-muted); }
.step-code-preview {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Student Choice Chips */
.choice-chips-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 22px;
}
.choice-chip {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.42);
  color: #fde68a;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.choice-chip:hover, .choice-chip.selected {
  background: #fbbf24;
  color: #080c1a;
}

.ghost-box-header { display: flex; align-items: center; justify-content: space-between; }
.ghost-prompt-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-emerald);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.ghost-input-wrapper {
  position: relative;
  height: 44px;
  background: #050811;
  border: 2px solid var(--accent-cyan);
  border-radius: 9px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.18);
}

.ghost-backdrop {
  position: absolute;
  left: 12px;
  right: 90px;
  font-family: var(--font-mono);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  pointer-events: none;
  white-space: pre;
  overflow: hidden;
}

.ch-ok { color: var(--accent-emerald); }
.ch-err { color: #fff; background: rgba(244, 63, 94, 0.75); border-radius: 3px; }
.ch-next { color: #94a3b8; border-bottom: 2px solid var(--accent-cyan); }
.ch-rem { color: rgba(148, 163, 184, 0.38); }

#codeLineInput {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: transparent;
  caret-color: var(--accent-gold);
  font-family: var(--font-mono);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  z-index: 2;
}

.match-pill {
  position: absolute;
  right: 10px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  z-index: 3;
}

.typing-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.hint-line { font-size: 11.5px; color: #cbd5e1; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hint-line strong { color: var(--accent-gold); }
.action-btns { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.wire-btn {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  border: none;
  color: #04131a;
  font-weight: 900;
  font-size: 11.5px;
  padding: 7px 13px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sub-btn {
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.sub-btn:hover { border-color: var(--accent-cyan); }

/* Column 3: Reference Drawer */
.dock-col-drawer {
  background: rgba(8, 12, 26, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(24, 34, 64, 0.9);
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 800;
  padding: 6px 4px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.drawer-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

.drawer-body { flex: 1; overflow-y: auto; padding: 12px 16px; }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shop-card {
  background: var(--bg-card);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.shop-card:hover { border-color: var(--accent-gold); }
.shop-card.equipped { border-color: var(--accent-emerald); background: rgba(16, 185, 129, 0.12); }
.shop-item-title { font-size: 11px; font-weight: 800; color: #fff; display: flex; justify-content: space-between; }
.shop-item-code {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-cyan);
  background: #070b17;
  padding: 3px 5px;
  border-radius: 4px;
  word-break: break-all;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 17, 0.86);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop.open { display: flex; }

.modal-window {
  width: min(1180px, 96vw);
  height: min(84vh, 760px);
  background: #0f172a;
  border: 1px solid var(--accent-cyan);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
}

.modal-head {
  padding: 12px 18px;
  background: #1e293b;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.world-tabs-bar {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  background: #0b1021;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.world-tab-btn {
  background: #182240;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.world-tab-btn.active { background: var(--accent-cyan); color: #080c1a; border-color: var(--accent-cyan); }

.modal-grid {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.curr-card {
  background: #182240;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}
.curr-card:hover { border-color: var(--accent-gold); }
.curr-code-list {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #7dd3fc;
  background: #080c1a;
  padding: 6px 8px;
  border-radius: 6px;
  line-height: 1.45;
}
