/* 🔘 Chat Toggle Button */
#chat-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  background-color: #5ea7a5;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

#chat-toggle:hover {
  transform: scale(1.1);
}

#chat-toggle i {
  font-size: 16px;
}

/* 🔴 Red Notification Dot */
#chat-toggle.has-unread::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  background-color: red;
  border-radius: 50%;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

/* 💬 Chat Container */
#chat-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 300px;
  max-height: 400px;
  background-color: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  display: none;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 9998;
}

#chat-container.visible {
  display: flex;
  opacity: 1;
  visibility: visible;
}

/* 📨 Message Area */
#chat-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background-color: #f9f9f9;
  scroll-behavior: smooth;
}

/* ✍️ Input Field */
#chat-input {
  border: none;
  border-top: 1px solid #ccc;
  padding: 10px;
  font-size: 14px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

/* 💬 Message Bubbles */
.message {
  margin: 5px 0;
  padding: 6px 10px;
  border-radius: 12px;
  max-width: 85%;
  font-size: 14px;
  word-wrap: break-word;
}

.message.sent {
  background-color: #447a79;
  color: white;
  align-self: flex-end;
  margin-left: auto;
}

.message.received {
  background-color: #e0e0e0;
  color: #333;
  align-self: flex-start;
  margin-right: auto;
}

#back-to-top {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: none;
  z-index: 999;
  background: #5ea7a5;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s;
}

#back-to-top:hover {
  transform: scale(1.1);
}

#back-to-top i {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 16px; /* Optional: match or override parent size */
}
