/* Mock AI chat interface — matches brand from CWS screenshots */
.chat-window {
  background: var(--bg-chat);
  border-radius: 16px;
  border: 1px solid var(--bg-chat-border);
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Title bar */
.chat-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.chat-titlebar-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #333;
}

.chat-titlebar-dot:nth-child(1) { background: #ff5f57; }
.chat-titlebar-dot:nth-child(2) { background: #ffbd2e; }
.chat-titlebar-dot:nth-child(3) { background: #28c840; }

.chat-titlebar-text {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Chat body — fills remaining window height */
.chat-body {
  padding: 24px 28px;
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Scrollable mode for bookmark demo */
.chat-body.scrollable {
  overflow-y: auto;
  scrollbar-width: none;
}

.chat-body.scrollable::-webkit-scrollbar {
  display: none;
}

/* Messages */
.chat-msg {
  margin-bottom: 28px;
}

.chat-msg:last-child {
  margin-bottom: 0;
}

.chat-msg-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  display: block;
}

.chat-msg-label.user-label {
  color: var(--text-muted);
}

.chat-msg-label.assistant-label {
  color: var(--blue);
  opacity: 0.7;
}

/* User message — dashed accent border, dimmed (matches CWS screenshot slide 2) */
.chat-msg.user-msg .chat-msg-content {
  border: 1px dashed rgba(255, 235, 59, 0.25);
  border-radius: 14px;
  padding: 14px 18px;
  opacity: 0.5;
}

/* Assistant prose */
.chat-msg.assistant-msg .chat-msg-content {
  padding: 0 4px;
}

.chat-prose {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 14px;
}

.chat-prose p {
  margin-bottom: 16px;
}

.chat-prose p:last-child {
  margin-bottom: 0;
}

.chat-prose strong {
  color: #fff;
  font-weight: 700;
}

.chat-prose em {
  font-style: italic;
  color: #ccc;
}

.chat-prose ul, .chat-prose ol {
  margin-left: 24px;
  margin-bottom: 16px;
}

.chat-prose li {
  margin-bottom: 6px;
}

.chat-prose li:last-child {
  margin-bottom: 0;
}

/* Code blocks — deep blue tint matching brand */
.chat-prose pre {
  background: var(--code-bg);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
  overflow-x: auto;
  border: 1px solid #1a2d40;
}

.chat-prose pre code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #b0bec5;
  line-height: 1.7;
}

/* Inline code */
.chat-prose code:not(pre code) {
  background: #2d2d2d;
  color: #e6db74;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88em;
}

/* Syntax highlighting — Material dark theme (matches CWS screenshots) */
.chat-prose pre .kw { color: #c792ea; }
.chat-prose pre .fn { color: #82aaff; }
.chat-prose pre .str { color: #c3e88d; }
.chat-prose pre .cmt { color: #546e7a; }
.chat-prose pre .num { color: #f78c6c; }
.chat-prose pre .op { color: #89ddff; }
.chat-prose pre .type { color: #ffcb6b; }

/* Chat input bar — bottom-pinned */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.chat-input-field {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-primary);
  min-height: 38px;
  position: relative;
}

.chat-input-placeholder {
  color: var(--text-muted);
  pointer-events: none;
  user-select: none;
}

.chat-input-text {
  white-space: pre;
}

/* Hide placeholder when there's text */
.chat-input-field:has(.chat-input-text:not(:empty)) .chat-input-placeholder {
  display: none;
}

.chat-input-cursor {
  display: none;
  width: 2px;
  height: 16px;
  background: var(--text-primary);
  border-radius: 1px;
  animation: cursor-blink 1s step-end infinite;
  flex-shrink: 0;
}

.chat-input-cursor.visible {
  display: inline-block;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.chat-input-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: default;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.chat-input-send.active {
  background: var(--accent);
  color: #000;
}

/* Typing indicator — three bouncing dots */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-indicator .dot:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Elaborate messages — fade in */
.chat-msg.elaborate-msg {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.chat-msg.elaborate-msg.visible {
  opacity: 1;
  transform: translateY(0);
}
