/* ===== FLOATING TERMINAL WIDGET ===== */

/* Trigger button */
.term-trigger {
  position: fixed;
  bottom: 2rem; right: 2rem;
  z-index: 200;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--glow), 0 4px 20px rgba(0,0,0,.4);
  transition: transform .2s, box-shadow .2s, background .2s;
}
.term-trigger:hover {
  transform: scale(1.1);
  background: rgba(0,229,255,.1);
  box-shadow: 0 0 30px rgba(0,229,255,.35), 0 4px 24px rgba(0,0,0,.5);
}
.term-trigger.open {
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 20px rgba(239,68,68,.2);
}

/* Terminal panel */
.term-panel {
  position: fixed;
  bottom: 6rem; right: 2rem;
  z-index: 199;
  width: min(520px, calc(100vw - 2rem));
  max-height: 420px;
  background: rgba(8,11,18,.97);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glow), 0 24px 60px rgba(0,0,0,.7);
  display: flex; flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(16px);

  /* animation */
  opacity: 0;
  transform: translateY(16px) scale(.97);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.term-panel.visible {
  opacity: 1;
  transform: none;
  pointer-events: all;
}

/* Panel bar */
.term-panel-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .65rem 1rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.term-panel-bar .dot { cursor: default; }
.term-panel-title {
  font-family: var(--font-mono);
  font-size: .72rem; color: var(--text-muted);
  margin-left: .4rem; flex: 1;
}
.term-hint {
  font-family: var(--font-mono);
  font-size: .65rem; color: var(--text-muted);
  opacity: .6;
}

/* Output area */
.term-output {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem .5rem;
  display: flex; flex-direction: column; gap: .3rem;
  scroll-behavior: smooth;
}
.term-output::-webkit-scrollbar { width: 4px; }
.term-output::-webkit-scrollbar-track { background: transparent; }
.term-output::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Lines */
.t-line {
  font-family: var(--font-mono);
  font-size: .8rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.t-line.cmd    { color: var(--text); }
.t-line.out    { color: var(--text-dim); }
.t-line.accent { color: var(--accent); }
.t-line.green  { color: var(--accent3); }
.t-line.yellow { color: var(--yellow); }
.t-line.error  { color: var(--red); }
.t-line.empty  { height: .4rem; }
.t-line.prompt-display { color: var(--accent3); }

/* Input row */
.term-input-row {
  display: flex; align-items: center;
  padding: .5rem 1.25rem .75rem;
  border-top: 1px solid var(--border);
  gap: .5rem; flex-shrink: 0;
}
.term-input-prompt {
  font-family: var(--font-mono);
  font-size: .8rem; color: var(--accent3);
  white-space: nowrap; flex-shrink: 0;
}
.term-input {
  flex: 1;
  background: none; border: none; outline: none;
  font-family: var(--font-mono);
  font-size: .8rem; color: var(--text);
  caret-color: var(--accent);
}
.term-input::placeholder { color: var(--text-muted); opacity: .5; }

/* Mobile adjust */
@media (max-width: 600px) {
  .term-trigger { bottom: 1.25rem; right: 1.25rem; }
  .term-panel   { bottom: 5rem; right: 1rem; width: calc(100vw - 2rem); }
}
