#root {
  height: 100vh;
  overflow: hidden;
}

:root {
  --bg-color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1a1a1a;
  }
}

/* Message bubbles */
.message-bubble {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Typing indicator animation */
.typing-indicator .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #999;
  animation: typing-dot 1.4s infinite;
}

.typing-indicator .dot:nth-child(1) {
  animation-delay: 0s;
}

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

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

@keyframes typing-dot {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-8px);
  }
}

/* Markdown styling - user messages (blue, on left) */
.user-message .markdown-content pre {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 8px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 6px 0;
}

.user-message .markdown-content code {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
}

.user-message .markdown-content pre code {
  background-color: transparent;
  padding: 0;
}

/* Markdown styling - assistant messages (gray, on right) */
.assistant-message .markdown-content pre {
  background-color: #d1d1d6;
  padding: 8px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 6px 0;
}

.assistant-message .markdown-content code {
  background-color: #d1d1d6;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
}

.assistant-message .markdown-content pre code {
  background-color: transparent;
  padding: 0;
}

/* Common markdown elements */
.markdown-content p {
  margin: 4px 0;
}

.markdown-content p:first-child {
  margin-top: 0;
}

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

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
  margin-top: 12px;
  margin-bottom: 6px;
}

.markdown-content h1:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child,
.markdown-content h4:first-child {
  margin-top: 0;
}

.markdown-content ul,
.markdown-content ol {
  margin: 6px 0;
  padding-left: 20px;
}

.markdown-content a {
  color: inherit;
  text-decoration: underline;
}

/* Error message styling */
.message-bubble.error-message {
  background-color: #ffebee !important;
  color: #c62828 !important;
  border: 1px solid #ef5350 !important;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .assistant-message {
    background-color: #3a3a3c !important;
    color: white !important;
  }
  
  .assistant-message .markdown-content pre {
    background-color: #2c2c2e;
  }
  
  .assistant-message .markdown-content code {
    background-color: #2c2c2e;
  }

  .message-bubble.error-message {
    background-color: #5f0000 !important;
    color: #ffcdd2 !important;
    border: 1px solid #e57373 !important;
  }
}

.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.react:hover {
  filter: drop-shadow(0 0 2em #61dafbaa);
}

@keyframes logo-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: no-preference) {
  a:nth-of-type(2) .logo {
    animation: logo-spin infinite 20s linear;
  }
}

.card {
  padding: 2em;
}

.read-the-docs {
  color: #888;
}
