* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f5f5f5;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.chat-container {
  width: 100%;
  max-width: 600px;
  height: 90vh;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 16px 20px;
  background-color: #4285f4;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h1 {
  font-size: 18px;
  font-weight: 600;
}

.status {
  font-size: 12px;
  padding: 4px 8px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
}

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

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.user-message {
  align-self: flex-end;
  background-color: #4285f4;
  color: #fff;
  white-space: pre-wrap;
}

.ai-message {
  align-self: flex-start;
  background-color: #e9e9eb;
  color: #000;
}

.ai-message p {
  margin: 0 0 8px 0;
}

.ai-message p:last-child {
  margin-bottom: 0;
}

.ai-message code {
  background-color: rgba(0, 0, 0, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
}

.ai-message pre {
  background-color: #2d2d2d;
  color: #f8f8f2;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
}

.ai-message pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
}

.ai-message ul,
.ai-message ol {
  margin: 8px 0;
  padding-left: 20px;
}

.ai-message li {
  margin: 4px 0;
}

.ai-message h1,
.ai-message h2,
.ai-message h3 {
  margin: 12px 0 8px 0;
  font-size: 14px;
  font-weight: 600;
}

.ai-message blockquote {
  border-left: 3px solid #4285f4;
  margin: 8px 0;
  padding-left: 12px;
  color: #555;
}

.init-button {
  padding: 12px 24px;
  background-color: #4285f4;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  align-self: center;
  margin: auto;
}

.init-button:hover {
  background-color: #3367d6;
}

.chat-form {
  padding: 16px 20px;
  background-color: #f9f9f9;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 12px;
}

.message-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  overflow-y: auto;
}

.message-input:focus {
  border-color: #4285f4;
}

.message-input:disabled {
  background-color: #f0f0f0;
  cursor: not-allowed;
}

.submit-button {
  padding: 12px 24px;
  background-color: #4285f4;
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 14px;
  cursor: pointer;
}

.submit-button:hover:not(:disabled) {
  background-color: #3367d6;
}

.submit-button:disabled {
  background-color: #c0c0c0;
  cursor: not-allowed;
}
