/**
 * Version Notes:
 * File: /pwa/css/chat.css
 * Version: 0.0.1
 * Last Modified: 2026-04-03 02:00 PM
 * Changes:
 * - Chat interface: messages, input, typing indicator
 * - Clean Claude/ChatGPT style — no bubbles, clean separation
 */

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
  scroll-behavior: smooth;
}

.message {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  animation: messageIn 200ms ease;
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.message.assistant .message-avatar {
  background: var(--accent-muted);
  color: var(--text-secondary);
}

.message.assistant .message-avatar .icon {
  width: 18px;
  height: 18px;
}

.message.user .message-avatar {
  background: var(--accent);
  color: var(--text-inverse);
  font-size: 13px;
  font-weight: 600;
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message-content p {
  margin: 0 0 8px;
  word-wrap: break-word;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content strong {
  font-weight: 600;
}

.message-content code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
}

.message-content pre {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 16px;
  overflow-x: auto;
  margin: 8px 0;
}

.message-content pre code {
  background: none;
  padding: 0;
}

.message-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* Typing indicator */
.message.typing .message-content {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

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

/* ============================================
   CHAT INPUT
   ============================================ */
.chat-input-area {
  padding: 12px 24px 24px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  transition: border-color var(--transition);
}

.chat-input-wrapper:focus-within {
  border-color: var(--input-focus);
}

.chat-input-wrapper textarea {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  outline: none;
  max-height: 200px;
  min-height: 24px;
  padding: 4px 0;
}

.chat-input-wrapper textarea::placeholder {
  color: var(--text-tertiary);
}

.send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: none;
  background: var(--accent);
  color: var(--text-inverse);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
  opacity: 0.5;
}

.send-btn:hover { opacity: 0.8; }
.send-btn.active { opacity: 1; }

.send-btn .icon {
  width: 16px;
  height: 16px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .message {
    padding: 16px;
    gap: 12px;
  }

  .chat-input-area {
    padding: 8px 12px 16px;
  }

  .message-avatar {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }
}

/* === END OF FILE (FILENAME: /pwa/css/chat.css) === */
