@import './variables.css';

/* ── Layout: 3-column grid ── */
.workspace-grid {
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  height: calc(100vh - 46px); /* subtract hud-header */
  overflow: hidden;
}

/* ── Pane base ── */
.pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: var(--border-subtle);
}
.pane:last-child { border-right: none; }

.pane-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .45rem 1rem;
  background: var(--charcoal);
  border-bottom: var(--border-subtle);
  font-size: .78rem;
  color: var(--charcoal-light);
  flex-shrink: 0;
}

/* ── Briefing pane ── */
.pane-briefing {
  background: #111;
  overflow-y: auto;
  padding: 1.25rem;
  gap: 1rem;
}
.mascot-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--charcoal);
  border-radius: var(--radius-md);
  padding: .75rem 1rem;
  border: var(--border-subtle);
}
.avatar {
  font-size: 2rem;
  line-height: 1;
}
.mascot-card h3 {
  margin: 0 0 .1rem;
  font-family: var(--font-heading);
  color: var(--beige);
  font-size: 1rem;
}
.mascot-card p {
  margin: 0;
  font-size: .75rem;
  color: var(--charcoal-light);
}

.briefing-body {
  font-size: .9rem;
  line-height: 1.65;
  color: var(--beige);
}
.briefing-body code {
  font-family: var(--font-code);
  background: rgba(112,163,167,.15);
  color: var(--teal);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  font-size: .85em;
}
.briefing-body p { margin: 0 0 .75rem; }

.tasks-container h4 {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--charcoal-light);
  margin: 0 0 .5rem;
}
.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.task-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: var(--beige);
  padding: .3rem .5rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.03);
}
.task-dot {
  color: var(--rose);
  font-size: .9rem;
  flex-shrink: 0;
  width: 1rem;
  text-align: center;
}
.task-item .task-dot:contains('✓') { color: var(--teal); }

/* ── Editor pane ── */
.pane-editor {
  background: #0d1117;
  border-right: var(--border-subtle);
}
.code-editor {
  flex: 1;
  width: 100%;
  height: 100%;
  background: #0d1117;
  color: var(--beige);
  font-family: var(--font-code);
  font-size: .88rem;
  line-height: 1.75;
  border: none;
  outline: none;
  resize: none;
  padding: 1rem;
  tab-size: 2;
  caret-color: var(--teal);
}
.code-editor::selection { background: rgba(112,163,167,.25); }

/* ── Terminal pane ── */
.pane-terminal {
  background: #0a0a0a;
}
.terminal-console {
  flex: 1;
  overflow-y: auto;
  padding: .75rem 1rem;
  font-family: var(--font-code);
  font-size: .8rem;
  line-height: 1.7;
}
.log-ok    { color: var(--beige); }
.log-warn  { color: var(--gold); }
.log-error { color: var(--rose); }
.log-info  { color: var(--charcoal-light); }
.log-section {
  color: var(--charcoal-light);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: .75rem 0 .3rem;
}
.test-result { display: flex; gap: .4rem; align-items: baseline; padding: .1rem 0; }
.test-result.pass { color: var(--teal); }
.test-result.fail { color: var(--rose); }

/* ── Buttons ── */
.btn-teal {
  background: var(--teal);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  padding: .3rem .85rem;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: opacity .15s;
}
.btn-teal:hover { opacity: .85; }

.btn-clear {
  background: none;
  border: none;
  color: var(--charcoal-light);
  font-size: .72rem;
  cursor: pointer;
  padding: .2rem .4rem;
}
.btn-clear:hover { color: var(--beige); }

/* ── Canvas overlay ── */
.fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}

/* ── Responsive fallback ── */
@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    height: auto;
    min-height: 100vh;
  }
  .pane { border-right: none; border-bottom: var(--border-subtle); }
  .code-editor { min-height: 240px; }
  .terminal-console { min-height: 160px; }
}
