/* Base */
:root {
  --term-ps-prompt: #f5f543;
  --term-cmd-prompt: #cccccc;
  --term-bash-user: #4ade80;
  --term-bash-path: #60a5fa;
  --term-zsh-prompt: #ffffff;

  /* Syntax colors */
  --hl-keyword: #c678dd;
  --hl-string: #98c379;
  --hl-number: #d19a66;
  --hl-comment: #5c6370;
  --hl-function: #61afef;
  --hl-builtin: #e5c07b;
  --hl-tag: #e06c75;
}

.terminal {
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  margin: 20px 0;
  font-family: 'Cascadia Code', 'Consolas', monospace;
  background: #1e1e1e;
}

/* Titlebar */
.term-titlebar {
  height: 32px;
  display: flex;
  align-items: center;
  user-select: none;
  font-family: 'Segoe UI', sans-serif;
  font-size: 12px;
  background: #252526;
  color: #fff;
}

.term-tb-left {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
}

/* Icon box */
.term-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 10px;
  border-radius: 2px;
  line-height: 1;
}

.term-tb-right {
  margin-left: auto;
}

.term-copy {
  width: 44px;
  height: 32px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #abb2bf;
  display: flex;
  align-items: center;
  justify-content: center;
}

.term-copy:hover { background: rgba(255,255,255,0.1); }
.term-copy.copied { background: #98c379 !important; color: #282c34; }

/* Content */
.term-content {
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

/* Selection */
.term-content ::selection { background: rgba(255,255,255,0.2); color: inherit; }

/* Code highlighting */
.terminal--code .hl-keyword { color: var(--hl-keyword); font-weight: bold; }
.terminal--code .hl-string  { color: var(--hl-string); }
.terminal--code .hl-number  { color: var(--hl-number); }
.terminal--code .hl-comment { color: var(--hl-comment); font-style: italic; }
.terminal--code .hl-function { color: var(--hl-function); }
.terminal--code .hl-builtin { color: var(--hl-builtin); }
.terminal--code .hl-tag { color: var(--hl-tag); }

/* Themes */

/* Code */
.terminal--code { background: #282c34; color: #abb2bf; }
.terminal--code .term-titlebar { background: #21252b; border-bottom: 1px solid #181a1f; }

/* PowerShell */
.terminal--ps { background: #012456; color: #eeedf0; }
.terminal--ps .term-icon { background: linear-gradient(135deg, #1976d2, #0d47a1); color: #fff; }
.terminal--ps .term-prompt-text { color: var(--term-ps-prompt); }

/* CMD */
.terminal--cmd { background: #0c0c0c; color: #cccccc; }
.terminal--cmd .term-icon { border: 1px solid #555; background: #0c0c0c; color: #ccc; }
.terminal--cmd .term-prompt-text { color: var(--term-cmd-prompt); }

/* Bash */
.terminal--bash { background: #1e1e1e; color: #d8d8d8; }
.terminal--bash .term-icon {
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4ade80;
  font-family: 'Cascadia Code', monospace;
  font-weight: 700;
  font-size: 9px;
  line-height: 1;
}
.terminal--bash .term-bash-user { color: var(--term-bash-user); font-weight: bold; }
.terminal--bash .term-bash-path { color: var(--term-bash-path); font-weight: bold; }

/* ZSH */
.terminal--zsh { background: #1e1e1e; color: #ffffff; }
.terminal--zsh .term-titlebar {
  background: linear-gradient(180deg, #3c3c3c, #2e2e2e);
  position: relative;
}
.terminal--zsh .term-dots { display: flex; gap: 6px; padding-right: 4px; }
.terminal--zsh .term-dot { width: 11px; height: 11px; border-radius: 50%; }
.terminal--zsh .term-dot--red { background: #ff5f57; }
.terminal--zsh .term-dot--yellow { background: #febc2e; }
.terminal--zsh .term-dot--green { background: #28c840; }

/* macOS centered title */
.terminal--zsh .term-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-weight: 500;
  color: #d2d2d2;
  pointer-events: none;
  white-space: nowrap;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* EFI Shell */
.terminal--efishell { background: #000000; color: #ffffff; font-family: 'Courier New', monospace; }
.terminal--efishell .term-titlebar {
  background: #333333;
  border-bottom: 1px solid #555555;
}
.terminal--efishell .term-prompt-text { color: #ffff00; font-weight: bold; }
.terminal--efishell .term-content { color: #ffffff; }
