/* WhatsApp style launcher button */
#tbs-chat-launcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #25D366;
  color: white;
  padding: 12px 18px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: bold;
  animation: pulse 1.5s infinite;
  z-index: 9999;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Chat Box */
#tbs-chat-box {
  position: fixed;
  bottom: 70px;
  right: 20px;
  width: 300px;
  height: 400px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10000;
}

/* Header same like WhatsApp */
.tbs-chat-header {
  background: #075E54; /* WhatsApp dark green */
  color: white;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tbs-chat-header img {
  border-radius: 50%;
  margin-right: 8px;
  width: 35px;
  height: 35px;
}

/* Header username + level white */
.tbs-chat-header strong,
.tbs-chat-header .tbs-level {
  color: #fff !important;
}

/* User Level - force white text in header */
.rainbow-text {
  color: #fff !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: #fff !important;
  animation: none !important;
}

/* Messages area */
#tbs-chat-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
}

.tbs-chat-input {
  display: flex;
  border-top: 1px solid #ccc;
}

.tbs-chat-input input {
  flex: 1;
  border: none;
  padding: 10px;
}

.tbs-chat-input button {
  background: #25D366;
  color: white;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
}

/* Chat bubbles */
.tbs-message {
  display: flex;
  margin: 5px;
}

.tbs-message .bubble {
  padding: 8px 12px;
  border-radius: 12px;
  max-width: 80%;
  font-size: 14px;
  position: relative;
  word-wrap: break-word;
  margin: 3px 0;
}

/* Bubble name styling */
.bubble .name {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 4px;
  color: red !important; /* Admin & User name RED only in bubbles */
}

.user-msg {
  justify-content: flex-start;
}

.user-msg .bubble {
  background: #e2ffc7; /* light green like WhatsApp */
  border-bottom-left-radius: 0;
}

.admin-msg {
  justify-content: flex-end;
}

.admin-msg .bubble {
  background: #dcf8ff; /* light blue like WhatsApp */
  border-bottom-right-radius: 0;
}

/* Tick marks */
.tick {
  font-size: 10px;
  color: gray;
  margin-left: 5px;
}

.admin-msg .tick {
  color: blue; /* double tick blue (seen) */
}

/* Bigger chatbox for desktop */
@media (min-width: 768px) {
  #tbs-chat-box {
    width: 400px;
    height: 500px;
  }
}

@media (min-width: 1200px) {
  #tbs-chat-box {
    width: 450px;
    height: 550px;
  }
}

/* Mobile view launcher circle */
@media (max-width: 768px) {
  #tbs-chat-launcher {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    padding: 0;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-indent: -9999px; /* hide text */
    position: fixed;
    bottom: 20px;
    right: 20px;
  }

  #tbs-chat-launcher::before {
    content: "💬"; /* Chat icon */
    font-size: 24px;
    text-indent: 0;
    color: white;
  }

  /* Mobile full screen chat */
  #tbs-chat-box {
    width: 100% !important;
    height: 100% !important;
    bottom: 0 !important;
    right: 0 !important;
    border-radius: 0 !important;
  }

  .tbs-chat-header {
    border-radius: 0 !important;
  }
}