/* =========================================================
   AI AGENT DESKTOP ORCHESTRATOR — CHAT TERMINAL STYLING
   ========================================================= */

.agent-chat {
  display: flex;
  flex-direction: column;
  background: rgba(8, 10, 16, 0.95);
  border: 1px solid var(--line-s);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Chat Header Bar */
.chat-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(14, 18, 26, 0.9);
  border-bottom: 1px solid var(--line);
  font: 11px/1 var(--f-mono);
  letter-spacing: .12em;
}

.chat-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-dots {
  display: flex;
  gap: 5px;
}
.chat-dots .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}
.chat-dots .dot:nth-child(1) { background: #ff5f56; }
.chat-dots .dot:nth-child(2) { background: #ffbd2e; }
.chat-dots .dot:nth-child(3) { background: #27c93f; }

.chat-title {
  color: #fff;
  font-weight: 700;
  margin-left: 6px;
}

.chat-mode {
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .15em;
  background: rgba(255, 255, 255, 0.08);
  color: var(--faint);
  border: 1px solid var(--line);
  transition: all .25s ease;
}

.chat-mode.is-live {
  background: rgba(39, 201, 63, 0.15);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.4);
}

.chat-mode.is-simulated {
  background: rgba(3, 218, 198, 0.12);
  color: var(--cyan);
  border-color: rgba(3, 218, 198, 0.35);
}

/* Quick prompt chips */
.chat-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--line);
}
.preset-btn {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-s);
  font: 11px/1.4 var(--f-mono);
  color: var(--dim);
  cursor: pointer;
  transition: all .2s ease;
}
.preset-btn:hover {
  background: rgba(227, 0, 55, 0.15);
  border-color: var(--red);
  color: #ffffff;
}

/* Chat Log Area */
.chat-log {
  height: 280px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font: 13px/1.65 var(--f-mono);
  scroll-behavior: smooth;
  background: radial-gradient(circle at 50% 0%, rgba(227, 0, 55, 0.03), transparent 70%);
}

.chat-log::-webkit-scrollbar {
  width: 5px;
}
.chat-log::-webkit-scrollbar-thumb {
  background: var(--line-s);
}

.msg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 90%;
  animation: msgIn .25s ease forwards;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.msg.user {
  align-self: flex-end;
  align-items: flex-end;
}
.msg.user .who {
  color: var(--cyan);
  font-size: 10px;
  letter-spacing: .15em;
}
.msg.user .body {
  background: rgba(3, 218, 198, 0.08);
  border: 1px solid rgba(3, 218, 198, 0.25);
  color: #fff;
  padding: 8px 14px;
  border-radius: 2px 2px 0 2px;
}

.msg.agent {
  align-self: flex-start;
  align-items: flex-start;
}
.msg.agent .who {
  color: var(--red);
  font-size: 10px;
  letter-spacing: .15em;
}
.msg.agent .body {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: #e5e7eb;
  padding: 8px 14px;
  border-radius: 2px 2px 2px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.streaming .body::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 12px;
  margin-left: 4px;
  vertical-align: -1px;
  background: var(--red);
  animation: blink .8s steps(1) infinite;
}

/* Tool Log Area */
.tool-log {
  border-top: 1px dashed var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.45);
  padding: 10px 16px;
  max-height: 110px;
  overflow-y: auto;
  font: 11px/1.5 var(--f-mono);
}
.tool-head {
  color: var(--red);
  font-weight: 700;
  letter-spacing: .15em;
  margin-bottom: 4px;
}
.tool-empty {
  color: var(--faint);
  font-style: italic;
}
.tool-entry {
  display: flex;
  gap: 8px;
  color: #cbd5e1;
  word-break: break-all;
}
.tool-name {
  color: #f59e0b;
  flex-shrink: 0;
}
.tool-out {
  color: #94a3b8;
}

/* Status ticker line */
.chat-status {
  padding: 6px 16px;
  font: 10px/1 var(--f-mono);
  letter-spacing: .12em;
  color: var(--faint);
  background: rgba(0, 0, 0, 0.3);
}

/* Chat Input Form */
.chat-form {
  display: flex;
  border-top: 1px solid var(--line-s);
  background: rgba(10, 13, 20, 0.98);
}

.chat-form input {
  flex: 1;
  padding: 14px 18px;
  background: transparent;
  border: none;
  font: 13px/1.4 var(--f-mono);
  color: #ffffff;
  outline: none;
}
.chat-form input::placeholder {
  color: var(--faint);
}

.chat-form button {
  padding: 0 24px;
  background: var(--red);
  color: #ffffff;
  border: none;
  font: 700 12px/1 var(--f-mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s ease;
  flex-shrink: 0;
}
.chat-form button:hover:not(:disabled) {
  background: #ff1a4a;
}
.chat-form button:disabled {
  background: rgba(227, 0, 55, 0.35);
  color: rgba(255, 255, 255, 0.4);
  cursor: not-allowed;
}
