/* ============================================================
   terminal.css — Input, Output, Prompt, Cursor, Animations
   ============================================================ */

/* ── Prompt ───────────────────────────────────────────────── */
.prompt {
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-size: var(--font-size);
  line-height: var(--line-height);
  pointer-events: none;
  user-select: none;
}

.prompt-dir {
  color: var(--color-green);
  font-weight: 500;
}

/* The $ symbol */
.prompt::after {
  color: var(--color-blue);
}

/* ── Input wrapper ────────────────────────────────────────── */
.input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.terminal-input {
  position: relative;
  z-index: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--font-size);
  line-height: var(--line-height);
  width: 100%;
  caret-color: var(--color-blue);
  padding: 0;
}

/* Ghost autocomplete text */
.ghost-text {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: var(--font-size);
  line-height: var(--line-height);
  pointer-events: none;
  white-space: pre;
}

/* ── Output lines ─────────────────────────────────────────── */
.output-block {
  margin-bottom: 4px;
}

/* Echoed command (the line the user typed) */
.cmd-echo {
  color: var(--text-primary);
  margin-bottom: 2px;
}

.cmd-echo .echo-prompt {
  color: var(--text-muted);
  user-select: none;
}

.cmd-echo .echo-prompt .echo-dir {
  color: var(--color-green);
}

.cmd-echo .echo-cmd {
  color: var(--text-primary);
}

/* Generic output */
.output-line {
  color: var(--text-primary);
}

/* Error */
.output-line.error {
  color: var(--color-red);
}

/* Success / accent */
.output-line.success {
  color: var(--color-green);
}

/* Info / muted */
.output-line.muted {
  color: var(--text-muted);
}

/* Command name in help list */
.cmd-name {
  color: var(--color-blue);
  font-weight: 500;
}

/* Directory entries in ls */
.ls-dir {
  color: var(--color-green);
  font-weight: 500;
}

.ls-file {
  color: var(--text-primary);
}

/* Horizontal rule in help */
.hr {
  color: var(--text-dim);
  user-select: none;
}

/* ── Markdown wrapper ─────────────────────────────────────── */
.md-render {
  margin: 4px 0 8px;
  /* Override output-line hover on md wrapper */
  border-left: none !important;
  background: none !important;
  padding-left: 0 !important;
}

/* ── Boot sequence ────────────────────────────────────────── */
@keyframes fadeInLine {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.boot-line {
  animation: fadeInLine 0.2s ease forwards;
  opacity: 0;
}

/* ── Blink cursor (custom) ────────────────────────────────── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.cursor-block {
  display: inline-block;
  width: 8px;
  height: 1em;
  vertical-align: text-bottom;
  background-color: var(--color-blue);
  animation: blink 1.1s step-end infinite;
  margin-left: 1px;
}

/* ── Links inside output ──────────────────────────────────── */
.output a {
  color: var(--color-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.output a:hover {
  color: #79c0ff;
  text-decoration: underline;
}

/* ── ls grid layout ───────────────────────────────────────── */
.ls-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 20px;
  padding: 2px 0;
}

.ls-grid .ls-item {
  min-width: 120px;
}

/* ── Scrollback spacer ────────────────────────────────────── */
.spacer {
  height: 8px;
}
