.chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans",
    "Helvetica Neue", sans-serif;
}

.chatbot-icon {
  position: relative;
  width: 60px;
  height: 60px;
  cursor: pointer;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background-color: #4e6ef2;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chatbot-icon i#open-icon {
  color: white;
  font-size: 1.8rem;
  transition: opacity 0.3s ease;
}

.close-button {
  position: absolute;
  display: none;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #4e6ef2;
  align-items: center;
  justify-content: center;
}

.close-button i {
  color: white;
  font-size: 1.5rem;
}

.chatbox {
  display: none;
  flex-direction: column;
  width: 350px;
  height: 500px;
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  margin-bottom: 15px;
  position: absolute;
  bottom: 70px;
  right: 0;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
}

.chatbox.active {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chatbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background-color: #4e6ef2;
  color: white;
  position: relative;
}

.chatbox-title {
  display: flex;
  align-items: center;
  font-weight: 600;
}

.chatbox-title i {
  margin-right: 8px;
  font-size: 1.2rem;
}

.dropdown-container {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.dropdown-toggle:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.dropdown-toggle i {
  font-size: 1.2rem;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1001;
  margin-top: 5px;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
}

.dropdown-item i {
  margin-right: 10px;
  font-size: 1rem;
  width: 16px;
}

.dropdown-item span {
  font-size: 14px;
}

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

.message {
  max-width: 80%;
  display: flex;
  flex-direction: column;
  position: relative;
}

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

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

.message-content {
  padding: 12px 16px;
  border-radius: 18px;
  position: relative;
  word-break: break-word;
}

.user-message .message-content {
  background-color: #4e6ef2;
  color: white;
  border-bottom-right-radius: 4px;
}

.bot-message .message-content {
  background-color: white;
  color: #333;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message-content p {
  margin: 0;
  line-height: 1.4;
}

.message-time {
  font-size: 0.7rem;
  color: #999;
  margin-top: 5px;
  align-self: flex-end;
}

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

.typing-indicator {
  display: none;
  padding: 12px 16px;
  background-color: white;
  border-radius: 18px;
  width: fit-content;
  margin: 0 20px 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.typing-indicator.active {
  display: flex;
}

.typing-indicator .dot {
  width: 8px;
  height: 8px;
  background-color: #bbb;
  border-radius: 50%;
  margin: 0 3px;
  animation: typing 1.5s infinite ease-in-out;
}

.typing-indicator .dot:nth-child(1) {
  animation-delay: 0s;
}

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

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

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

.chat-input {
  display: flex;
  align-items: center;
  padding: 15px;
  border-top: 1px solid #eee;
  background-color: white;
}

.chat-input input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  outline: none;
  font-size: 14px;
  transition: border-color 0.3s;
}

.chat-input input:focus {
  border-color: #4e6ef2;
}

.chat-input button {
  width: 40px;
  height: 40px;
  margin-left: 10px;
  background-color: #4e6ef2;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s, transform 0.2s;
}

.chat-input button:hover {
  background-color: #3c5ae0;
  transform: scale(1.05);
}

.chat-input button:active {
  transform: scale(0.95);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message {
  animation: fadeIn 0.3s ease forwards;
}

@media (max-width: 480px) {
  .chatbox {
    width: calc(100vw - 40px);
    right: 0;
  }
}