.chat-container {
  max-width: 800px;
  margin: 20px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 90vh;
}

.chat-header {
  background: #8a2be2;
  color: white;
  padding: 15px 20px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1002;
}

.chat-header h1 {
  font-size: 1.5rem;
  margin: 0;
}

.subtitle {
  font-size: 1rem;
  opacity: 0.9;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.dropdown-container {
  padding: 10px 20px;
  background: #f8f9fa;
}

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

.message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 80%;
  margin-bottom: 8px;
}

.message.bot {
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.avatar {
  min-width: 40px;
  width: 40px;
  min-height: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  overflow: hidden;
}

.bot .avatar {
  background: #8a2be2;
}

.user .avatar {
  background: #007bff;
}

.message-content {
  background: white;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  white-space: pre-line;
}

.message-content strong {
  font-weight: 600;
}

.user .message-content {
  background: #007bff;
  color: white;
}

.user .message-content strong {
  color: #ffffff;
}

.chat-input-container {
  padding: 20px;
  background: white;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 10px;
}

.chat-input {
  flex-grow: 1;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 10px 15px;
  resize: none;
  height: 45px;
  line-height: 1.5;
}

.send-button {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background: #007bff;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.send-button:disabled {
  opacity: 0.6;
}

.spinner-border {
  display: none;
}

.submitting .default-icon {
  display: none;
}

.submitting .spinner-border {
  display: inline-block;
}

.timestamp {
  font-size: 0.75rem;
  color: #666;
  margin-top: 4px;
}

.user .timestamp {
  color: rgba(255, 255, 255, 0.8);
}

.avatar span {
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  flex-shrink: 0;
}

.header-controls {
  display: flex;
  gap: 20px;
  align-items: center;
}

.logout-btn {
  color: #ffffff !important;
  opacity: 0.8;
  transition: opacity 0.2s;
  text-decoration: none;
  padding-right: 5px;
}

.clear-history-btn {
  color: #ffffff !important;
  opacity: 0.8;
  transition: opacity 0.2s;
  cursor: pointer;
  text-decoration: none;
}

.clear-history-btn:hover {
  opacity: 1;
}

/* Add hover effect */
.clear-history-btn svg {
  transition: transform 0.2s ease-in-out;
}

.clear-history-btn:hover svg {
  transform: rotate(-15deg);
}

/* Adjust spacing for all header icons */
.header-controls a {
  display: flex;
  align-items: center;
}

/* Add these menu styles to your chat.css */
.menu-container {
  position: relative;
  z-index: 1002;
}

.menu-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.menu-dropdown {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  background: white !important;
  width: 280px !important;
  padding: 20px !important;
  border-radius: 0 0 8px 8px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  z-index: 9999 !important;
  display: none;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: none !important;
}

.menu-dropdown.show {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.user-section {
  display: flex !important;
  align-items: center !important;
  gap: 15px !important;
}

.user-icon {
  width: 48px !important;
  height: 48px !important;
  background: #8a2be2 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 24px !important;
  color: white !important;
}

.user-details {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.user-name {
  color: #333 !important;
  font-size: 20px !important;
  font-weight: 500 !important;
}

.logout-link {
  color: #666 !important;
  text-decoration: none !important;
  font-size: 16px !important;
  opacity: 0.9 !important;
}

.logout-link:hover {
  opacity: 1 !important;
  color: #8a2be2 !important;
}

.chat-controls {
  margin: 10px 0;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 5px;
}

#thread-selector {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
}

.thread-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

#current-thread {
  font-size: 0.9em;
  color: #666;
  background: #e9ecef;
  padding: 4px 8px;
  border-radius: 4px;
}

.new-thread-btn {
  background: #8a2be2;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.new-thread-btn:hover {
  background: #7a1dd2;
}
