:root {
  color-scheme: dark;
  --primary-blue: #4a6cff;
  --dark-bg: #27272d;
  --light-text: #f1f1f1;
  --msg-bg: rgb(64, 64, 69);
  --msg-error: rgb(243 126 105);
  --input-bg: #3a3a45;
  --user-msg-bg: #454556;
  --placeholder: #a5a5b6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", sans-serif;
}

body {
  background-color: var(--dark-bg);
  color: var(--light-text);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  height: 100%;
}

.chat-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  gap: 12px;
}

.header-logo {
  height: 28px;
  width: auto;
}

.header-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--light-text);
}

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

.message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 8px;
  line-height: 1.5;
}

.message.user {
  background-color: var(--user-msg-bg);
  align-self: flex-end;
  margin: 16px 0;
}

.message.bot {
  /* background-color: var(--msg-bg); */
  align-self: flex-start;
  padding: 2px;
}

.message.bot.error {
  color: var(--msg-error);
}

.message-input-container {
  padding: 16px;
  display: flex;
  justify-content: center;
}

.message-input-wrapper {
  display: flex;
  flex-direction: column;
  background-color: var(--input-bg);
  border-radius: 8px;
  width: 100%;
  max-width: 1000px;
  padding: 4px;
}

#message-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--light-text);
  padding: 12px;
  font-size: 15px;
  outline: none;
  min-height: 90px;
  resize: none;
}

#message-input::placeholder {
  color: var(--placeholder);
}

.input-controls {
  display: flex;
  justify-content: flex-end;
  padding: 4px 8px;
}

.send-button {
  background-color: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 6px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.bot-avatar {
  width: 28px;
  height: 28px;
  margin: 0.5em 0;
  padding: 2px;
  background-color: #444;
  border: 1px solid #568;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  overflow: hidden;
}

.avatar-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-row {
  display: flex;
  align-items: flex-start;
}

.avatar-placeholder {
  width: 28px;
  margin-right: 8px;
}

/* Loading animation */
.loader {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.typing-indicator {
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  .message {
    max-width: 90%;
  }

  .chat-container {
    padding: 0 8px;
  }
}

/* Add these styles to your app.css file */

/* Markdown Table Styles */
.markdown-table {
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.9em;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
}

.markdown-table th,
.markdown-table td {
  padding: 8px 12px;
  text-align: left;
  border: 1px solid #555;
}

.markdown-table th {
  background-color: var(--input-bg);
  color: var(--light-text);
  font-weight: bold;
}

.markdown-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.markdown-table tr:last-child {
  border-bottom: none;
}

.markdown-table tr:nth-child(even) {
  background-color: #303034;
}

.markdown-table tr:last-child td:first-child {
  border-bottom-left-radius: 6px;
}

.markdown-table tr:last-child td:last-child {
  border-bottom-right-radius: 6px;
}

/* Heading Styles */
.message h1 {
  font-size: 1.8em;
  margin: 0.5em 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.3em;
}

.message h2 {
  font-size: 1.5em;
  margin: 0.5em 0;
}

.message h3 {
  font-size: 1.3em;
  margin: 0.5em 0;
}

.message h4,
.message h5,
.message h6 {
  font-size: 1.1em;
  margin: 0.5em 0;
}

/* Paragraph Styles */
.message p {
  margin: 0.5em 0;
  line-height: 1.6;
}

/* Code Block Styles */
.message pre {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
  margin: 10px 0;
}

.message code {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9em;
}

/* Inline code */
.message p code {
  background-color: rgba(0, 0, 0, 0.3);
  padding: 2px 4px;
  border-radius: 3px;
}

/* Bold and Italic */
.message strong {
  font-weight: bold;
}

.message em {
  font-style: italic;
}
