/* ── Boot screen ── */
#boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  color: #00FF41;
  font-family: 'Cascadia Mono', 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.4;
  padding: 20px;
  z-index: 99999;
  overflow: hidden;
  white-space: pre-wrap;
}

#boot-screen .boot-text {
  color: #00FF41;
}

#boot-screen .boot-hash {
  color: #00FF41;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: #0C0C0C;
  color: #CCCCCC;
  font-family: 'Cascadia Mono', 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.35;
  overflow: hidden;
}

/* ── Window frame ── */
#window {
  display: flex;
  flex-direction: column;
  height: 100vh;
  border: 1px solid #333;
}

/* ── Title bar ── */
#title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1F1F1F;
  height: 36px;
  padding: 0 0 0 10px;
  user-select: none;
  flex-shrink: 0;
}

#title-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

#terminal-icon {
  flex-shrink: 0;
}

#tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 36px;
}

.tab {
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 14px;
  border-radius: 6px 6px 0 0;
  font-size: 12px;
  color: #999;
  cursor: default;
}

.tab.active {
  background: #0C0C0C;
  color: #ddd;
}

.tab-new {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 16px;
  color: #888;
  cursor: pointer;
  border-radius: 4px;
}

.tab-new:hover {
  background: #333;
  color: #ccc;
}

#title-bar-right {
  display: flex;
  align-items: center;
  height: 100%;
}

.title-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 100%;
  font-size: 12px;
  color: #999;
  cursor: pointer;
}

.title-btn:hover {
  background: #333;
  color: #fff;
}

.title-btn.close:hover {
  background: #E81123;
  color: #fff;
}

/* ── Terminal body ── */
#terminal {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  overflow-y: auto;
  cursor: text;
  background: #0C0C0C;
}

/* Scrollbar styling (Windows Terminal look) */
#terminal::-webkit-scrollbar {
  width: 10px;
}

#terminal::-webkit-scrollbar-track {
  background: #0C0C0C;
}

#terminal::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 5px;
}

#terminal::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ── Output ── */
#output {
  flex-shrink: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

#output a {
  color: #6CB6FF;
  text-decoration: none;
}

#output a:hover {
  text-decoration: underline;
}

/* ── Colored output spans ── */
.cmd-header {
  color: #F2F2F2;
  font-weight: bold;
}

.cmd-accent {
  color: #61AFEF;
}

.cmd-success {
  color: #98C379;
}

.cmd-warn {
  color: #E5C07B;
}

.cmd-error {
  color: #E06C75;
}

.cmd-muted {
  color: #666;
}

.cmd-cyan {
  color: #56B6C2;
}

.cmd-magenta {
  color: #C678DD;
}

/* ── Input line ── */
#input-line {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-top: 2px;
}

.prompt {
  white-space: nowrap;
  color: #CCCCCC;
}

#command-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #CCCCCC;
  font-family: 'Cascadia Mono', 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  caret-color: #CCCCCC;
}

/* ── Matrix rain canvas ── */
#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.35;
}

/* ── Autocomplete hint ── */
.autocomplete-hint {
  color: #555;
  pointer-events: none;
}

/* ── Selection ── */
::selection {
  background: #264F78;
  color: #fff;
}

/* ── Typing animation for banner ── */
.typing-line {
  overflow: hidden;
  white-space: pre;
  animation: typing 0.4s steps(40, end);
}

@keyframes typing {
  from { max-width: 0; }
  to { max-width: 100%; }
}

/* ── Scan-line overlay (subtle CRT effect) ── */
#terminal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  z-index: 1;
}

#terminal {
  position: relative;
}

#output, #input-line {
  position: relative;
  z-index: 2;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  html, body { font-size: 12px; }
  #title-bar { height: 30px; }
  .tab { font-size: 11px; padding: 0 10px; }
  .title-btn { width: 36px; font-size: 10px; }
  #terminal { padding: 6px 8px; }
}
