/* Chat Bot Floating Button and Window Styles */
#chatbot-container {
  position: fixed;
  bottom: 95px; /* Moved higher to avoid overlap with Submit Manuscript button */
  right: 30px;
  z-index: 1000;
  font-family: 'Montserrat', sans-serif;
}

#chat-button {
  width: auto;
  height: 48px;
  padding: 0 20px;
  border-radius: 24px;
  background-color: #d4af37; /* Gold background color */
  color: white; /* White text for better readability */
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

#chat-button:hover {
  transform: scale(1.1);
  background-color: #c5a028; /* Slightly darker gold on hover */
}

#chat-button i {
  font-size: 20px;
  margin-right: 5px;
}

.chat-label {
  font-size: 14px;
  font-weight: 600;
}

#chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 350px;
  height: 450px; /* Slightly reduced height to ensure it doesn't go off screen */
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
}

.chat-header {
  background-color: #d4af37; /* Gold background to match the button */
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.close-chat {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
}

.messages-container {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: 75%;
  padding: 10px 15px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
}

.user-message {
  align-self: flex-end;
  background-color: #d4af37; /* Gold background to match theme */
  color: white;
  border-bottom-right-radius: 5px;
}

.bot-message {
  align-self: flex-start;
  background-color: #f1f1f1;
  color: #333;
  border-bottom-left-radius: 5px;
}

.input-container {
  padding: 15px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
}

#user-input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 14px;
}

#send-button {
  background-color: #d4af37; /* Gold background to match theme */
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#send-button:hover {
  background-color: #c5a028; /* Slightly darker gold on hover */
}

.typing-indicator {
  align-self: flex-start;
  background-color: #f1f1f1;
  padding: 10px 15px;
  border-radius: 18px;
  border-bottom-left-radius: 5px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: #888;
  border-radius: 50%;
  animation: typing-dot 1s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-dot {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-5px);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #chatbot-container {
    bottom: 110px; /* Additional space on mobile devices */
    right: 20px;
  }

  #chat-button {
    padding: 0 15px;
    height: 40px;
  }

  #chat-button i {
    font-size: 16px;
    margin-right: 4px;
  }

  .chat-label {
    font-size: 12px;
  }

  #chat-window {
    width: 300px;
    height: 400px;
    right: 0;
    bottom: 70px;
  }
}
