
/* Base styles */
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
}

:root {
  --bg: #f9f9f9;
  --text: #1f1f1f;
  --bubble-user: #e0f2fe;
  --bubble-ai: #f3f4f6;
  --border: #ccc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --text: #f8fafc;
    --bubble-user: #1e40af;
    --bubble-ai: #1e293b;
    --border: #334155;
  }
}

.chat-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 100vh;
  box-sizing: border-box;
}

#chat-log {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  flex-grow: 1;
}

/* Message styles */
.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.5;
  font-size: 1rem;
}

.message.user {
  align-self: flex-end;
  background-color: var(--bubble-user);
  color: var(--text);
}

.message.ai {
  align-self: flex-start;
  background-color: var(--bubble-ai);
  color: var(--text);
}

.ai-reply strong {
  font-weight: bold;
}

.ai-reply em {
  font-style: italic;
}

.ai-reply ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

/* Input section */
textarea {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
}

#send-button {
  padding: 0.5rem 1.25rem;
  background-color: #3b82f6;
  color: #fff;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 0.5rem;
  align-self: flex-end;
}

#send-button:hover {
  background-color: #2563eb;
}

/* Mobile-friendly */
@media (max-width: 600px) {
  .message {
    max-width: 95%;
    font-size: 0.95rem;
  }

  textarea {
    font-size: 0.95rem;
  }

  #send-button {
    font-size: 0.95rem;
  }
}
