/* Floating Chat Icon */
#chatbot-icon {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-color: #d32f2f;
  color: white;
  font-size: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
  z-index: 9999;
}

#chatbot-icon:hover {
  background-color: #b71c1c;
  transform: scale(1.1);
}

/* Chatbot Container */
#chatbot-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 350px;
  height: 450px;
  background-color: #1f1f1f;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 19999;
}

/* Hide Chatbot Initially */
.chatbot-hidden {
  display: none !important;
}

/* Chatbot Header */
#chatbot-header {
  background-color: #d32f2f;
  color: white;
  padding: 15px;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
}

#close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

/* Chatbot Body */
#chatbot-body {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  scroll-behavior: smooth;
  max-height: 350px;
}

#chatbot-body::-webkit-scrollbar {
  width: 8px;
}

#chatbot-body::-webkit-scrollbar-thumb {
  background: #b3a2a2;
  border-radius: 20px;
}

#chatbot-body::-webkit-scrollbar-track {
  background: #333;
}

/* Chatbot Messages */
#chatbot-messages {
  display: flex;
  flex-direction: column;
}

.message {
  margin-bottom: 15px;
  padding: 12px;
  border-radius: 8px;
  max-width: 85%;
  text-align: left;
  word-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.5;
  font-family: "Segoe UI", sans-serif;
  font-size: 15px;
}

.message.bot {
  background-color: #333;
  color: white;
  align-self: flex-start;
}

.message.user {
  background-color: #d32f2f;
  color: white;
  align-self: flex-end;
}

/* Input Section */
#chatbot-input-container {
  display: flex;
  padding: 10px;
  border-top: 1px solid #444;
  background-color: #2c2c2c;
}

#chatbot-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #444;
  border-radius: 10px;
  background-color: #333;
  color: white;
}

#send-btn {
  margin-left: 10px;
  padding: 10px 15px;
  background-color: #d32f2f;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}

#send-btn:hover {
  background-color: #b71c1c;
}

/* Typing Indicator */
.typing {
  display: flex;
  align-items: center;
  padding: 10px;
  background-color: #333;
  color: white;
  align-self: flex-start;
  border-radius: 8px;
  max-width: 85%;
}

.typing span {
  width: 6px;
  height: 6px;
  margin: 0 2px;
  background-color: white;
  border-radius: 50%;
  display: inline-block;
  animation: blink 1.5s infinite ease-in-out;
}

.typing span:nth-child(1) {
  animation-delay: 0s;
}
.typing span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 80%, 100% {
    opacity: 0.2;
  }
  40% {
    opacity: 1;
  }
}
