/* 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;
}

/* Header styles */
.app-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border-bottom: 2px solid var(--border);
  padding: 1.2rem 2rem 1.2rem 1rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.app-logo {
  height: 48px;
  width: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.app-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  letter-spacing: -1px;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
}

@media (max-width: 600px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    gap: 0.5rem;
  }

  .app-title {
    font-size: 1.2rem;
  }

  .app-logo {
    height: 36px;
  }

  .message {
    max-width: 95%;
    font-size: 0.95rem;
  }

  textarea {
    font-size: 0.95rem;
  }

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