

#chat-widget {
  position: fixed;
  bottom: 0;
  right: 20px;
  width: 300px;
  background: #fff;
  border: 1px solid #dddfe2;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 0 6px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  z-index: 2;
}

#chat-header {
  background: #1877f2;
  color: #fff;
  padding: 8px 12px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
}

#chat-header button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

#chat-body {
  display: flex;
  flex-direction: column;
  height: 350px;
}















#chat {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background: #e9ebee;
  display: flex;
  flex-direction: column;
}

.msg-container {
  display: flex;
  flex-direction: column;
  margin: 6px 0;
  max-width: 70%;
}

.msg-container.user {
  align-self: flex-end;
  text-align: right;
}

.msg-container.other {
  align-self: flex-start;
  text-align: left;
}

.username {
  font-size: 12px;
  color: #666;
  margin-bottom: 2px;
}

.msg {
  padding: 8px 12px;
  border-radius: 18px;
  word-wrap: break-word;
}

/* Mensajes del usuario (derecha) */
.msg.user {
  background: #1877f2;
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Mensajes de otros (izquierda) */
.msg.other {
  background: #b3b3b3;
  color: #000;
  border-bottom-left-radius: 4px;
}







.badge {
  background: red;
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 12px;
  margin-left: 6px;
}




.unread-marker {
  text-align: center;
  margin: 10px 0;
  font-size: 0.9em;
  color: #999;
  font-style: italic;
}

















.status {
  font-size: 12px;
  color: #666;
  text-align: center;
  margin: 5px 0;
}

#controls {
  display: flex;
  padding: 8px;
  background: #fff;
  border-top: 1px solid #dddfe2;
}

#controls input {
  flex: 1;
  padding: 8px;
  border: 1px solid #dddfe2;
  border-radius: 18px;
  margin-right: 8px;
}

#controls button {
  background: #1877f2;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 18px;
  cursor: pointer;
}



/* Mejorar el scroll del chat */
#chat {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  background: #e9ebee;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth; /* Scroll suave */
}

/* Ocultar scrollbar pero mantener funcionalidad */
#chat::-webkit-scrollbar {
  width: 6px;
}

#chat::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

#chat::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

#chat::-webkit-scrollbar-thumb:hover {
  background: #555;
}