* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", sans-serif;
  background-color: #0f0e0c;
  color: #ececf1;
  height: 100vh;
  overflow: hidden;
}

.chat-container {
  display: flex;
  height: 100vh;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.logo-header {
  padding: 20px 24px;
  text-align: center;
  background-color: #0f0e0c;
  border-bottom: 1px solid #241f1b;
}

.logo {
  max-width: 200px;
  height: auto;
  max-height: 80px;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.welcome-message {
  text-align: center;
  padding: 48px 24px;
  color: #c5c5d2;
}

.welcome-message h2 {
  font-size: 32px;
  font-weight: 400;
}

.message {
  display: flex;
  gap: 16px;
  padding: 24px;
  margin: 0 auto;
  max-width: 768px;
  width: 100%;
}

.message.user {
  background-color: #0f0e0c;
}

.message.assistant {
  background-color: #241f1b;
  border-radius: 12px;
}

.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
}

.message.user .message-avatar {
  background-color: #5e5e70;
}

.message.assistant .message-avatar {
  background-color: transparent;
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-content {
  flex: 1;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Markdown styling */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  margin-top: 16px;
  margin-bottom: 8px;
  font-weight: 600;
}

.message-content h1 {
  font-size: 24px;
}

.message-content h2 {
  font-size: 20px;
}

.message-content h3 {
  font-size: 18px;
}

.message-content p {
  margin-bottom: 4px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content ul,
.message-content ol {
  margin-bottom: 8px;
  padding-left: 24px;
}

.message-content li {
  margin-bottom: 4px;
}

.message-content code {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
}

.message-content pre {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 12px;
}

.message-content pre code {
  background-color: transparent;
  padding: 0;
}

.message-content blockquote {
  border-left: 3px solid #3d3632;
  padding-left: 12px;
  margin: 12px 0;
  color: #c5c5d2;
}

.message-content a {
  color: #19c37d;
  text-decoration: none;
}

.message-content a:hover {
  text-decoration: underline;
}

.message-content table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 12px;
}

.message-content th,
.message-content td {
  border: 1px solid #3d3632;
  padding: 8px;
  text-align: left;
}

.message-content th {
  background-color: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

.message-content hr {
  border: none;
  border-top: 1px solid #3d3632;
  margin: 16px 0;
}

.thinking-text {
  color: #8e8ea0;
  font-style: italic;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.input-container {
  padding: 24px;
  background-color: #0f0e0c;
}

.input-wrapper {
  max-width: 768px;
  margin: 0 auto;
  position: relative;
  background-color: #241f1b;
  border-radius: 12px;
  border: 1px solid #3d3632;
  display: flex;
  align-items: flex-end;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.input-wrapper:focus-within {
  border-color: #ececf1;
}

#messageInput {
  flex: 1;
  background-color: transparent;
  border: none;
  color: #ececf1;
  padding: 16px;
  font-size: 16px;
  resize: none;
  outline: none;
  font-family: inherit;
  max-height: 200px;
  overflow-y: auto;
}

#messageInput:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#messageInput::placeholder {
  color: #8e8ea0;
}

#sendButton {
  background-color: #19c37d;
  border: none;
  color: #202123;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 8px;
  flex-shrink: 0;
  transition: background-color 0.2s;
}

#sendButton:hover:not(:disabled) {
  background-color: #1a9f6b;
}

#sendButton:disabled {
  background-color: #565869;
  cursor: not-allowed;
  opacity: 0.5;
}

.typing-indicator {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background-color: #8e8ea0;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Scrollbar styling */
.messages-container::-webkit-scrollbar {
  width: 8px;
}

.messages-container::-webkit-scrollbar-track {
  background: #0f0e0c;
}

.messages-container::-webkit-scrollbar-thumb {
  background: #241f1b;
  border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
  background: #3d3632;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .message {
    padding: 16px;
  }

  .logo {
    max-width: 150px;
    max-height: 60px;
  }
}
