﻿:root {
  --bg: #1e1e1e;
  --titlebar: #181818;
  --activity: #333333;
  --sidebar: #252526;
  --panel: #1f1f1f;
  --panel-2: #242424;
  --border: #2f2f2f;
  --line: #3f3f46;
  --line-active: #007acc;
  --text: #d4d4d4;
  --muted: #8d8d8d;
  --accent: #0e639c;
  --accent-strong: #1177bb;
  --ok: #42be65;
  --error: #f44747;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #111;
  color: var(--text);
  font-family: Manrope, "Segoe UI", sans-serif;
}

.vscode-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 38px 1fr 24px;
  background: var(--bg);
}

.titlebar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  background: var(--titlebar);
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.vscode-mark {
  color: #2ea8ff;
  font-size: 0.88rem;
}

.menu-bar {
  display: flex;
  gap: 10px;
  color: #cccccc;
  font-size: 0.8rem;
}

.command-box {
  max-width: 520px;
  margin: 0 auto;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  height: 28px;
  line-height: 26px;
  text-align: center;
  color: #c5c5c5;
  background: #1f1f1f;
  font-size: 0.86rem;
}

.titlebar-right {
  display: flex;
  gap: 6px;
}

.window-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #666;
}

.workbench {
  min-height: 0;
  display: grid;
  grid-template-columns: 48px 290px 1fr;
}

.activity-bar {
  background: var(--activity);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
  gap: 8px;
}

.activity-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: #b7b7b7;
  cursor: pointer;
  font-size: 0.94rem;
}

.activity-btn:hover {
  background: #454545;
}

.activity-btn.is-active {
  border-left-color: #fff;
  color: #fff;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 12px 10px;
}

.sidebar-header h1 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #bbbbbb;
  letter-spacing: 0.08em;
}

.project-name {
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 0.88rem;
  font-weight: 800;
}

.sidebar-hint {
  margin: 0 0 8px;
  color: #a6a6a6;
  font-size: 0.75rem;
}

.file-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
  max-height: calc(100vh - 145px);
  overflow: auto;
  scrollbar-color: #4a4a4a #252526;
  scrollbar-width: thin;
}

.file-list::-webkit-scrollbar {
  width: 10px;
}

.file-list::-webkit-scrollbar-track {
  background: #252526;
}

.file-list::-webkit-scrollbar-thumb {
  background: #4a4a4a;
  border-radius: 8px;
  border: 2px solid #252526;
}

.file-list::-webkit-scrollbar-thumb:hover {
  background: #5a5a5a;
}

.file-item {
  padding: 7px 8px;
  font: 500 0.84rem/1.35 "JetBrains Mono", "Consolas", monospace;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #cccccc;
}

.file-item.is-active {
  background: #094771;
  border-color: #0e639c;
  color: #ffffff;
}

.task-btn {
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: transparent;
}

.task-btn:hover {
  background: #2f2f2f;
}

.editor-host {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 36px 1fr;
}

.editor-tabs {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: #2d2d2d;
  min-height: 0;
}

.tab {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font: 700 0.84rem/1 "JetBrains Mono", "Consolas", monospace;
  color: #cfcfcf;
  border-right: 1px solid #3a3a3a;
}

.tab.is-active {
  background: #1e1e1e;
  border-top: 2px solid var(--line-active);
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
}

.btn {
  border: 1px solid #3f3f46;
  background: #313131;
  color: #e8e8e8;
  border-radius: 6px;
  height: 26px;
  padding: 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  background: #3a3a3a;
}

.btn-primary {
  background: var(--accent);
  border-color: #1585ce;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.editor-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(280px, 360px);
}

.editor-panel,
.bank-panel {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.editor-panel {
  background: var(--panel);
  border-right: 1px solid var(--border);
}

.bank-panel {
  background: var(--panel-2);
}

.panel-head {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #a8a8a8;
  margin-bottom: 8px;
}

.task-title {
  margin-bottom: 8px;
  font: 700 0.88rem/1.3 "JetBrains Mono", "Consolas", monospace;
  color: #d6ebff;
}

.hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.examples-panel {
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid #3f3f46;
  border-radius: 6px;
  background: #181818;
}

.examples-title {
  margin: 0;
  color: #d6ebff;
  font: 700 0.78rem/1.3 "JetBrains Mono", "Consolas", monospace;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.examples-title::-webkit-details-marker {
  display: none;
}

.examples-title::before {
  content: "▸ ";
  color: #8fb7d6;
}

.examples-panel[open] .examples-title {
  margin-bottom: 8px;
}

.examples-panel[open] .examples-title::before {
  content: "▾ ";
}

.task-examples {
  display: grid;
  gap: 8px;
}

.task-example-item {
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  background: #151515;
  padding: 6px 8px;
}

.task-example-label {
  margin: 0 0 4px;
  color: #a9a9a9;
  font: 700 0.72rem/1 "JetBrains Mono", "Consolas", monospace;
}

.task-example-subtitle {
  margin: 0 0 4px;
  color: #8fb7d6;
  font: 700 0.72rem/1 "JetBrains Mono", "Consolas", monospace;
}

.task-example-code {
  margin: 0;
  white-space: pre-wrap;
  color: #d8d8d8;
  font: 500 0.78rem/1.4 "JetBrains Mono", "Consolas", monospace;
}

.editor-slots {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.editor-slot {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.slot-index {
  color: #858585;
  font: 500 0.78rem/1 "JetBrains Mono", "Consolas", monospace;
  text-align: right;
}

.slot-drop-zone {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  background: #202020;
}

.slot-drop-zone.is-empty {
  color: #6f6f6f;
}

.slot-drop-zone.is-over {
  border-color: #1585ce;
  background: #17232d;
}

.code-line {
  margin: 0;
  white-space: pre;
  overflow-x: auto;
  width: 100%;
  color: #dcdcdc;
  font: 500 0.83rem/1.35 "JetBrains Mono", "Consolas", monospace;
}

.py-token-keyword {
  color: #569cd6;
}

.py-token-string {
  color: #ce9178;
}

.py-token-number {
  color: #b5cea8;
}

.py-token-comment {
  color: #6a9955;
}

.py-token-builtin {
  color: #4ec9b0;
}

.py-token-function {
  color: #dcdcaa;
}

.py-token-operator {
  color: #d4d4d4;
}

.slot-tools {
  display: flex;
  gap: 4px;
}

.tool-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #4a4a4a;
  background: #2f2f2f;
  color: #d8d8d8;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.78rem;
}

.tool-btn:hover:enabled {
  background: #3a3a3a;
}

.tool-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.result {
  margin-top: 10px;
  min-height: 46px;
  border: 1px solid #3f3f46;
  border-radius: 6px;
  background: #181818;
  padding: 8px 10px;
  font-size: 0.83rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.result.is-ok {
  border-color: color-mix(in srgb, var(--ok) 55%, #2f2f2f);
  color: #c5f2d3;
}

.result.is-error {
  border-color: color-mix(in srgb, var(--error) 70%, #2f2f2f);
  color: #ffd3d3;
}

.solution-preview {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #3f3f46;
  background: #161616;
  color: #d8d8d8;
  white-space: pre-wrap;
  font: 500 0.8rem/1.45 "JetBrains Mono", "Consolas", monospace;
}

.code-bank {
  display: grid;
  gap: 7px;
  align-content: start;
}

.code-block {
  width: 100%;
  border: 1px solid #494949;
  background: #1f1f1f;
  color: #e8e8e8;
  border-radius: 6px;
  padding: 8px 9px;
  text-align: left;
  cursor: grab;
}

.code-block:active {
  cursor: grabbing;
}

.code-block:hover {
  background: #2a2a2a;
}

.code-block.is-selected {
  border-color: #1495eb;
  box-shadow: 0 0 0 1px #1495eb;
}

.bank-placeholder {
  border: 1px dashed #4a4a4a;
  border-radius: 6px;
  padding: 10px;
  color: #969696;
  font-size: 0.8rem;
}

.statusbar {
  background: #007acc;
  color: #f3fbff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 10px;
}

@media (max-width: 1200px) {
  .workbench {
    grid-template-columns: 44px 240px 1fr;
  }

  .editor-grid {
    grid-template-columns: 1fr 300px;
  }
}

@media (max-width: 980px) {
  .vscode-shell {
    grid-template-rows: auto 1fr 24px;
  }

  .titlebar {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px;
  }

  .titlebar-right {
    display: none;
  }

  .workbench {
    grid-template-columns: 1fr;
  }

  .activity-bar,
  .sidebar {
    display: none;
  }

  .editor-grid {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}
