/* Kiwix RAG Live Demo — Terminal Echo */

/* ── Instructions Panel ── */
.instructions-panel {
  border: 1px solid var(--border);
  background: rgba(255, 176, 0, 0.03);
  padding: 16px;
  margin-bottom: 24px;
  font-family: var(--font-code);
  font-size: 12px;
  line-height: 1.6;
}

.instructions-panel .section-header {
  margin-bottom: 12px;
}

.instructions-panel ol {
  list-style: none;
  counter-reset: inst;
  padding-left: 0;
}

.instructions-panel ol li {
  counter-increment: inst;
  padding: 4px 0;
  color: var(--text-dim);
}

.instructions-panel ol li::before {
  color: var(--secondary);
  margin-right: 8px;
  font-weight: 700;
}

.instructions-panel ol li span {
  color: var(--primary);
}

/* ── Chat Window ── */
.chat-window {
  border: 1px solid var(--border);
  background: rgba(0, 255, 65, 0.02);
  display: flex;
  flex-direction: column;
  height: 500px;
}

@media (min-width: 768px) {
  .chat-window { height: 600px; }
}

.chat-header {
  background: rgba(0, 255, 65, 0.05);
  padding: 8px 12px;
  font-family: var(--font-code);
  font-size: 11px;
  color: var(--secondary);
  border-bottom: 1px solid var(--border);
  text-align: center;
  letter-spacing: 0.1em;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 85%;
  font-family: var(--font-code);
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 12px;
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg.user {
  align-self: flex-end;
  color: var(--secondary);
  border-color: var(--secondary);
  background: rgba(255, 176, 0, 0.05);
}

.chat-msg.system {
  align-self: flex-start;
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(0, 255, 65, 0.03);
}

.chat-msg.system .msg-label {
  color: var(--secondary);
  font-size: 10px;
  display: block;
  margin-bottom: 4px;
  letter-spacing: 0.1em;
}

.chat-msg.loading {
  color: var(--primary-dim);
  font-style: italic;
}

.chat-msg .cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--primary);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}

/* ── Chat Input ── */
.chat-input-bar {
  border-top: 1px solid var(--border);
  display: flex;
  padding: 12px;
  gap: 8px;
  background: rgba(0, 255, 65, 0.03);
}

.chat-input {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  text-shadow: 0 0 5px rgba(0, 255, 65, 0.4);
}

.chat-input::placeholder {
  color: var(--text-dim);
  text-shadow: none;
  opacity: 0.5;
}

.chat-input:focus {
  border-color: var(--primary);
  background: rgba(0, 255, 65, 0.05);
}

.btn-send {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 8px 16px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.15s ease;
  text-shadow: 0 0 5px rgba(0, 255, 65, 0.4);
}

.btn-send:hover {
  background: var(--primary);
  color: var(--bg);
  text-shadow: none;
}

.btn-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Scrollbar ── */
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: var(--bg); }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); }
.chat-messages::-webkit-scrollbar-thumb:hover { background: var(--primary-dim); }

/* ── Connection Status ── */
.conn-status {
  font-family: var(--font-code);
  font-size: 10px;
  color: var(--text-dim);
  padding: 4px 12px;
  border-top: 1px solid var(--border);
  text-align: right;
  background: rgba(0, 255, 65, 0.03);
}

.conn-status .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-right: 4px;
  vertical-align: middle;
}

.conn-status .dot.offline {
  background: #ff4444;
}
