/* ─────────────────────────────────────────────
   Terminal — terminal.css
   LCARS/Nostromo sci-fi aesthetic on top of style.css base
───────────────────────────────────────────── */

/* ── Page lock ── */
body.terminal-page {
  overflow: hidden;
  height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Terminal frame (glass panel over starfield) ── */
.terminal-frame {
  position: relative;
  z-index: 10;
  width: 90vw;
  max-width: 900px;
  height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 0.25rem 2rem 2rem 0.25rem;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.08), 0 0 0 1px rgba(56, 189, 248, 0.05);
}

/* ── LCARS-style header strip ── */
.terminal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  background: var(--accent);
  border-radius: 0 2rem 0 0;
}

.terminal-header-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: #0a1628;
  text-transform: uppercase;
  white-space: nowrap;
}

.terminal-header-dots {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}

.terminal-header-dots span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(10, 22, 40, 0.35);
}

/* ── Terminal body ── */
.terminal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 2rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.terminal-body::-webkit-scrollbar { width: 4px; }
.terminal-body::-webkit-scrollbar-track { background: transparent; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 2px; }

/* ── Output lines ── */
#output { flex: 1; }

.line {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
  margin-bottom: 0.1rem;
}

.line.error  { color: #f59e0b; }
.line.success { color: var(--accent); }
.line.muted  { color: var(--text-muted); }

/* ── Input row ── */
.input-line {
  display: flex;
  align-items: center;
  margin-top: 1rem;
  gap: 0.5rem;
}

.input-prefix {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

#terminal-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  outline: none;
  flex-grow: 1;
  caret-color: var(--accent);
}

/* ── Blinking cursor (accent color) ── */
#cursor {
  display: inline-block;
  width: 9px;
  height: 1rem;
  background-color: var(--accent);
  animation: blink 1s step-end infinite;
  vertical-align: bottom;
  border-radius: 1px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .terminal-frame {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }

  .terminal-body {
    padding: 1rem 1.25rem;
  }

  .line {
    font-size: 0.85rem;
  }
}
