/* ============================================================
   DRAWER CONSOLE — Bottom slide-up terminal panel
   Always uses hardcoded dark surface regardless of theme.
============================================================ */

.console-drawer {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  height: 340px;
  background: #0D0F12;
  border-top: 1px solid #252830;
  z-index: 149;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 200ms ease-in-out;
}
.console-drawer.open { transform: translateY(0); }

/* Resize handle */
.console-resize-handle {
  height: 4px;
  background: transparent;
  cursor: ns-resize;
  flex-shrink: 0;
  position: relative;
}
.console-resize-handle::after {
  content: '';
  position: absolute;
  top: 1px; left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 2px;
  background: #252830;
  border-radius: 1px;
  transition: background 80ms;
}
.console-resize-handle:hover::after { background: #F5A623; }

/* Tab bar */
.console-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: 36px;
  border-bottom: 1px solid #252830;
  flex-shrink: 0;
  background: #13161C;
}

.console-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
}

.console-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 14px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: #4A4F5E;
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: color 80ms, border-color 80ms;
  white-space: nowrap;
}
.console-tab:hover { color: #CDD1DC; }
.console-tab.active { color: #F5A623; border-bottom-color: #F5A623; }
.console-tab .tab-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #3DD68C;
  flex-shrink: 0;
}

/* Action buttons (clear, close) */
.console-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.console-btn {
  width: 26px; height: 26px;
  border-radius: 2px;
  background: transparent;
  border: none;
  color: #4A4F5E;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 80ms, background 80ms;
  font-family: var(--font-sans);
  font-size: 11px;
}
.console-btn:hover { color: #CDD1DC; background: #1C1F25; }

/* Body & panels */
.console-body {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.console-panel {
  display: none;
  height: 100%;
  flex-direction: column;
}
.console-panel.active { display: flex; }

/* Terminal output */
.terminal-output {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  color: #CDD1DC;
  scroll-behavior: smooth;
}

.terminal-output::-webkit-scrollbar { width: 6px; }
.terminal-output::-webkit-scrollbar-track { background: transparent; }
.terminal-output::-webkit-scrollbar-thumb { background: #252830; border-radius: 3px; }

.t-line { display: flex; gap: 8px; flex-wrap: wrap; }
.t-line.error   .t-text { color: #F05252; }
.t-line.warn    .t-text { color: #F5A623; }
.t-line.success .t-text { color: #3DD68C; }
.t-line.muted   .t-text { color: #4A4F5E; }
.t-prompt { color: #F5A623; user-select: none; flex-shrink: 0; }
.t-cmd    { color: #9D7FEA; }
.t-text   { color: #CDD1DC; }

/* Input row */
.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid #1C1F25;
  flex-shrink: 0;
}

.terminal-prompt-symbol {
  color: #F5A623;
  font-family: var(--font-mono);
  font-size: 12px;
  user-select: none;
  flex-shrink: 0;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #CDD1DC;
  caret-color: #F5A623;
}
.terminal-input::placeholder { color: #2E3240; }

/* Autocomplete popover */
.console-autocomplete {
  position: absolute;
  bottom: 48px;
  left: 16px;
  background: #13161C;
  border: 1px solid #252830;
  border-radius: 2px;
  overflow: hidden;
  min-width: 320px;
  max-width: 420px;
  z-index: 10;
  display: none;
}
.console-autocomplete.visible { display: block; }

.autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #8B90A0;
  cursor: pointer;
  transition: background 60ms;
}
.autocomplete-item:hover,
.autocomplete-item.focused { background: #1C1F25; color: #CDD1DC; }
.autocomplete-item .ac-cmd { color: #F5A623; min-width: 140px; }
.autocomplete-item .ac-desc { font-size: 11px; color: #4A4F5E; }

/* Live logs panel */
.logs-stream-output {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
}
.logs-stream-output::-webkit-scrollbar { width: 6px; }
.logs-stream-output::-webkit-scrollbar-track { background: transparent; }
.logs-stream-output::-webkit-scrollbar-thumb { background: #252830; border-radius: 3px; }

.log-stream-entry {
  display: grid;
  grid-template-columns: 155px 60px 1fr;
  gap: 0 12px;
  padding: 1px 16px;
  transition: background 60ms;
}
.log-stream-entry:hover { background: #13161C; }
.log-stream-ts    { color: #4A4F5E; }
.log-stream-action { color: #6B8EAD; text-transform: uppercase; font-size: 11px; }
.log-stream-msg   { color: #CDD1DC; }

/* Console trigger button active state */
#console-trigger.console-active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
