:root {
    --background-color: #fefaf3;
    --text-color: #333;
    --input-bg-color: #beff92;
    --primary-color: #beff92;
    --border-color: #3c4043;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--background-color);
}

.chat-header h1 {
    font-size: 2em;
    font-weight: 500;
    text-align: center;
    color: var(--primary-color);
    margin: 20px 0;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.user-message {
    background-color: var(--input-bg-color);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ai-message {
    background-color: #f0f0f0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    /* white-space: pre-wrap; /* Preserve line breaks from AI response */
}

.ai-message.thinking-dots span {
  display: inline-block;
  animation: bounce-dot 1.4s infinite;
  margin: 0 1px;
  font-weight: bold;
}
.ai-message.thinking-dots span:nth-child(1) {
  animation-delay: 0s;
}
.ai-message.thinking-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.ai-message.thinking-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

.chat-input-form {
    padding: 20px;
}

#qa-form {
    position: relative;
    display: flex;
    align-items: center;
}

#question-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background-color: white;
    color: var(--text-color);
    font-size: 16px;
    outline: none;
}

#question-input:focus {
    border-color: var(--primary-color);
}

#submit-button {
    position: absolute;
    right: 10px;
    height: 38px;
    width: 38px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

#submit-button:hover {
    background-color: rgba(138, 180, 248, 0.1);
}

#submit-button:disabled {
    color: var(--border-color);
    cursor: not-allowed;
}

/* Animations */

@keyframes bounce-dot {
  0%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-4px);
  }
}