/* terminal.css - Console Operacional & Debugger de Processos ICSA */

.terminal-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  background: #0f172a;
  border: 1px solid #334155;
  color: #38bdf8;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  font-family: inherit;
}

.terminal-nav-btn:hover {
  background: #1e293b;
  border-color: #38bdf8;
  color: #7dd3fc;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

.terminal-nav-btn__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.terminal-nav-btn__icon {
  font-size: 12px;
}

.terminal-nav-btn__label {
  letter-spacing: -0.01em;
}

/* Modal Backdrop */
.terminal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 18, 0.75);
  backdrop-filter: blur(4px);
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: terminalFadeIn 0.16s ease-out;
}

@keyframes terminalFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Window */
.terminal-window {
  width: 100%;
  max-width: 960px;
  height: 82vh;
  max-height: 820px;
  background: #080d1a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(56, 189, 248, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Header */
.terminal-header {
  padding: 10px 16px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.terminal-header__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.terminal-status-light {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.terminal-title-group {
  display: flex;
  flex-direction: column;
}

.terminal-title {
  color: #38bdf8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.terminal-subtitle {
  color: #64748b;
  font-size: 10.5px;
}

.terminal-subtitle code {
  color: #94a3b8;
  background: #1e293b;
  padding: 1px 4px;
  border-radius: 3px;
}

.terminal-header__right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.terminal-btn-icon {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 11px;
  font-family: inherit;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.terminal-btn-icon:hover {
  background: #334155;
  color: #ffffff;
}

.terminal-close-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s ease;
}

.terminal-close-btn:hover {
  color: #ef4444;
}

/* Controls & Toolbar */
.terminal-controls {
  padding: 8px 14px;
  background: #0b1120;
  border-bottom: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.terminal-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.terminal-filter-pill {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: 10.5px;
  font-family: inherit;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.terminal-filter-pill:hover {
  color: #f1f5f9;
  border-color: #475569;
}

.terminal-filter-pill.is-active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
  font-weight: 700;
}

.terminal-search-box {
  flex: 1;
  max-width: 280px;
}

.terminal-search-input {
  width: 100%;
  background: #060913;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #38bdf8;
  font-family: inherit;
  font-size: 11px;
  padding: 4px 8px;
  outline: none;
}

.terminal-search-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.2);
}

/* Terminal Body Stream */
.terminal-body {
  flex: 1;
  background: #050811;
  color: #cbd5e1;
  overflow-y: auto;
  padding: 10px 14px;
  font-size: 11px;
  line-height: 1.5;
}

.terminal-empty {
  color: #475569;
  text-align: center;
  padding: 40px 10px;
  font-style: italic;
}

.terminal-log-line {
  padding: 2.5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  word-break: break-word;
}

.terminal-log-time {
  color: #475569;
  margin-right: 6px;
  user-select: none;
}

.terminal-log-badge {
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 4px;
  font-size: 10px;
}

.terminal-badge--llm {
  color: #f472b6;
  background: rgba(244, 114, 182, 0.15);
  border: 1px solid rgba(244, 114, 182, 0.35);
}

.terminal-badge--auth {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.terminal-badge--router {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.terminal-badge--astra {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.12);
  border: 1px solid rgba(192, 132, 252, 0.25);
}

.terminal-badge--luna {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.terminal-badge--tool {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.terminal-badge--web {
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.terminal-badge--project {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.terminal-badge--api {
  color: #818cf8;
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.25);
}

.terminal-badge--audit {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.terminal-badge--sys {
  color: #67e8f9;
  background: rgba(103, 232, 249, 0.12);
  border: 1px solid rgba(103, 232, 249, 0.25);
}

.terminal-log-level {
  color: #64748b;
  margin-right: 6px;
  font-size: 10px;
}

.terminal-level--warn {
  color: #f59e0b;
}

.terminal-level--error {
  color: #ef4444;
}

.terminal-level--success {
  color: #10b981;
}

.terminal-log-msg {
  color: #e2e8f0;
}

.terminal-details {
  margin: 4px 0 4px 18px;
}

.terminal-details-summary {
  cursor: pointer;
  color: #38bdf8;
  font-size: 10px;
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.terminal-copy-json-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #38bdf8;
  font-size: 9.5px;
  font-family: inherit;
  padding: 2px 7px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.terminal-copy-json-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
}

.terminal-details-summary:hover {
  text-decoration: underline;
}

.terminal-details-pre {
  margin: 4px 0 0;
  padding: 6px 10px;
  background: #0b1120;
  border: 1px solid #1e293b;
  border-radius: 4px;
  color: #94a3b8;
  font-size: 10px;
  overflow-x: auto;
}

/* Footer */
.terminal-footer {
  padding: 6px 14px;
  background: #0f172a;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  color: #64748b;
  flex-shrink: 0;
}

.terminal-footer strong {
  color: #38bdf8;
}

.terminal-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}

