/* ── AI1st Terminal Chatbot ── */
/* Inline terminal-style chat section, not a floating popup */

.chat-terminal-section {
  background: var(--bg-elevated, #0a0515);
  border-top: 1px solid var(--border, rgba(0, 212, 255, 0.08));
  border-bottom: 1px solid var(--border, rgba(0, 212, 255, 0.08));
  padding: 60px 0;
  margin-bottom: 60px;
}

.chat-terminal-section h2 {
  margin-bottom: 8px;
}

.chat-terminal-section .section-intro {
  margin-bottom: 32px;
}

/* ── Terminal frame ── */
.chat-terminal {
  background: var(--bg-card, #100822);
  border: 1px solid var(--border, rgba(0, 212, 255, 0.1));
  border-radius: 12px;
  overflow: hidden;
  max-width: 720px;
  margin: 0 auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4), inset 0 1px 0 rgba(0,212,255,0.05);
}

.chat-terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--border, rgba(0, 212, 255, 0.06));
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim, #445588);
}

.chat-terminal-dots {
  display: flex;
  gap: 6px;
}

.chat-terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.chat-terminal-dot.r { background: #ff5f57; }
.chat-terminal-dot.y { background: #ffbd2e; }
.chat-terminal-dot.g { background: #28c840; }

.chat-terminal-title {
  margin-left: 8px;
  flex: 1;
  text-align: center;
}

.chat-terminal-title span {
  opacity: 0.5;
}

/* Phase progress chip (deep-dive interview) — blade-runner cyan, monospace, dark */
.chat-terminal-phase {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--primary, #00d4ff);
  border: 1px solid rgba(0, 212, 255, 0.3);
  background: rgba(0, 212, 255, 0.06);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.chat-terminal-phase.show {
  opacity: 1;
  transform: translateY(0);
}

.chat-terminal-phase.done {
  color: #28c840;
  border-color: rgba(40, 200, 64, 0.35);
  background: rgba(40, 200, 64, 0.08);
}

/* ── Messages area ── */
.chat-terminal-output {
  padding: 20px;
  min-height: 260px;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
}

.chat-terminal-output::-webkit-scrollbar {
  width: 4px;
}

.chat-terminal-output::-webkit-scrollbar-track {
  background: transparent;
}

.chat-terminal-output::-webkit-scrollbar-thumb {
  background: var(--border, rgba(0, 212, 255, 0.08));
  border-radius: 2px;
}

/* ── Terminal prompt line ── */
.chat-tline {
  white-space: pre-wrap;
  word-break: break-word;
  animation: tlineIn 0.2s ease;
}

@keyframes tlineIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-tline .prompt-bot {
  color: #8899c7;
  font-weight: 600;
  margin-right: 8px;
}

.chat-tline .prompt-user {
  color: var(--primary, #00d4ff);
  font-weight: 600;
  margin-right: 8px;
}

.chat-tline .prompt {
  color: var(--primary, #00d4ff);
  font-weight: 600;
  margin-right: 8px;
}

.chat-tline .msg-bot {
  color: var(--text-primary, #e0eaff);
}

.chat-tline .msg-bot a {
  color: var(--primary, #00d4ff);
  text-decoration: underline;
}

.chat-tline .msg-bot strong {
  color: var(--primary-light, #66e5ff);
}

.chat-tline .msg-user {
  color: var(--primary, #00d4ff);
}

.chat-tline .msg-dim {
  color: var(--text-dim, #445588);
  font-size: 12px;
}

.chat-tline .msg-ok {
  color: var(--primary, #00d4ff);
}

/* ── Typing indicator ── */
.chat-tline.typing .msg-bot {
  display: inline-flex;
  gap: 4px;
}

.chat-tline.typing .msg-bot span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-secondary, #8899c7);
  animation: blink 1.4s infinite both;
}

.chat-tline.typing .msg-bot span:nth-child(2) { animation-delay: 0.2s; }
.chat-tline.typing .msg-bot span:nth-child(3) { animation-delay: 0.4s; }

/* ── Input area ── */
.chat-terminal-input-wrap {
  border-top: 1px solid var(--border, rgba(0, 212, 255, 0.06));
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
}

.chat-terminal-prompt {
  color: var(--primary, #00d4ff);
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}

.chat-terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary, #e0eaff);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  caret-color: var(--primary, #00d4ff);
}

.chat-terminal-input::placeholder {
  color: var(--text-dim, #445588);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.chat-terminal-send {
  background: none;
  border: 1px solid var(--primary, #00d4ff);
  color: var(--primary, #00d4ff);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-terminal-send:hover {
  background: var(--primary-dim, rgba(0, 212, 255, 0.1));
}

.chat-terminal-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Email fallback link ── */
.chat-terminal-email {
  text-align: center;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border, rgba(0, 212, 255, 0.04));
}

.chat-terminal-email a {
  color: var(--text-dim, #445588);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  transition: color 0.2s;
}

.chat-terminal-email a:hover {
  color: var(--primary, #00d4ff);
}

/* ── Lead captured notice ── */
.chat-terminal-lead-notice {
  text-align: center;
  padding: 10px 16px;
  background: var(--primary-dim, rgba(0, 212, 255, 0.05));
  border-top: 1px solid var(--primary, #00d4ff);
  font-size: 12px;
  color: var(--primary, #00d4ff);
  font-family: 'JetBrains Mono', monospace;
  display: none;
}

.chat-terminal-lead-notice.show {
  display: block;
  animation: tlineIn 0.3s ease;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .chat-terminal {
    border-radius: 8px;
  }
  .chat-terminal-output {
    padding: 14px;
    min-height: 200px;
    max-height: 320px;
    font-size: 13px;
  }
  .chat-terminal-input-wrap {
    padding: 10px 12px;
  }
  .chat-terminal-input {
    font-size: 13px;
  }
}
