body, html {
  height: 100%;
  margin: 0;
  background-color: #f8f5f2;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: #333333;
}

.chat {
  margin-top: auto;
  margin-bottom: auto;
  padding-top: 30px;
  padding-bottom: 30px;
}

.card {
  height: 700px; /* Increased height */
  border-radius: 16px !important;
  background-color: #ffffff !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
  border: none !important;
  overflow: hidden;
}

.card-header {
  border-radius: 16px 16px 0 0 !important;
  border-bottom: 1px solid #f0f0f0 !important;
  background-color: #ffffff !important;
  padding: 18px 24px !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-footer {
  border-radius: 0 0 16px 16px !important;
  border-top: 1px solid #f0f0f0 !important;
  background-color: #ffffff !important;
  padding: 16px 24px !important;
}

.message-area {
  overflow-y: auto;
  padding: 24px !important;
  background-color: #fcfcfc !important;
  height: calc(100% - 134px); /* Adjusted for larger card */
}

.message-input {
  background-color: #f8f6f3 !important;
  border: 1px solid #eae4dd !important;
  color: #333333 !important;
  height: 54px !important;
  border-radius: 27px 0 0 27px !important;
  padding-left: 24px !important;
  font-size: 15px;
  box-shadow: none !important;
  transition: all 0.2s ease;
}

.message-input:focus {
  box-shadow: 0 0 0 2px rgba(175, 139, 120, 0.2) !important;
  border-color: #af8b78 !important;
  background-color: #ffffff !important;
}

.send-button {
  border-radius: 0 27px 27px 0 !important;
  background-color: #af8b78 !important;
  border: none !important;
  color: white !important;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 12px 18px !important;
}

.send-button:hover {
  background-color: #9a7a69 !important;
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-btn {
  color: #af8b78;
  background: rgba(175, 139, 120, 0.1);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border: none;
}

.action-btn:hover {
  background: rgba(175, 139, 120, 0.2);
  color: #9a7a69;
}

.avatar-container {
  position: relative;
}

.avatar {
  height: 50px;
  width: 50px;
  border-radius: 50%;
  border: 2px solid #f8f5f2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.status-indicator {
  position: absolute;
  height: 12px;
  width: 12px;
  background-color: #54b97d;
  border-radius: 50%;
  bottom: 0;
  right: 0;
  border: 2px solid white;
}

.assistant-info {
  margin-left: 15px;
}

.assistant-info h5 {
  font-family: 'Merriweather', serif;
  font-weight: 400;
  color: #333333;
}

.assistant-info p {
  font-size: 12px;
  color: #888888;
}

/* Message styling */
.message {
  display: flex;
  margin-bottom: 30px;
  position: relative;
}

.assistant-message {
  align-items: flex-start;
}

.user-message {
  align-items: flex-start;
  flex-direction: row-reverse;
}

.message-avatar {
  flex-shrink: 0;
}

.message-avatar img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #f0f0f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.message-content {
  margin: 0 12px;
  max-width: 80%;
  position: relative;
}

.message-bubble {
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.5;
  position: relative;
}

.message-bubble pre {
  background-color: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
  overflow-x: auto;
}

.message-bubble code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 14px;
}

.message-bubble pre code {
  padding: 0;
  white-space: pre;
}

.message-bubble p {
  margin-bottom: 10px;
}

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

.assistant-message .message-bubble {
  background-color: #e6f3ff; /* Light blue for assistant messages */
  color: #333333;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.user-message .message-bubble {
  background-color: #4da5ff; /* Darker blue for user messages */
  color: white;
  border-top-right-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message-time {
  font-size: 11px;
  color: #999999;
  margin-top: 5px;
  text-align: left;
}

.user-message .message-time {
  text-align: right;
}

/* Message actions */
.message-actions {
  opacity: 0;
  position: absolute;
  top: -24px;
  right: 0;
  background-color: white;
  border-radius: 16px;
  padding: 4px 8px;
  display: flex;
  gap: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: opacity 0.2s ease;
}

.assistant-message .message-content:hover .message-actions,
.user-message .message-content:hover .message-actions {
  opacity: 1;
}

.message-action-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 14px;
}

.message-action-btn:hover {
  color: #4da5ff;
}

.user-message .message-action-btn.edit-msg {
  display: flex;
}

.assistant-message .message-action-btn.edit-msg {
  display: none;
}

.assistant-message .message-action-btn.regenerate-msg {
  display: flex;
}

.user-message .message-action-btn.regenerate-msg {
  display: none;
}

/* Edit mode */
.edit-mode .message-bubble {
  display: none;
}

.edit-input-container {
  display: none;
  margin-bottom: 10px;
}

.edit-mode .edit-input-container {
  display: block;
}

.edit-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #4da5ff;
  border-radius: 16px;
  font-size: 15px;
  outline: none;
}

.edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 5px;
}

.edit-btn {
  background: none;
  border: none;
  color: #4da5ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

/* Typing indicator */
.typing {
  background-color: #e6f3ff !important;
}

.dots {
  display: inline-block;
  width: 25px;
}

.dots:after {
  content: '';
  animation: dots 1.5s ease infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #d6cfc7;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4da5ff;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .card {
    height: 85vh;
    margin: 15px;
  }
  
  .message-content {
    max-width: 75%;
  }
  
  .message-bubble {
    padding: 12px 16px;
    font-size: 14px;
  }
}