/* ── Glory Bee's Live Chat Widget ── */
:root {
  --gb-color: #b5451b;
  --gb-radius: 16px;
  --gb-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

/* LAUNCHER BUTTON */
#gbchat-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gb-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--gb-shadow);
  z-index: 99999;
  transition: transform .2s, box-shadow .2s;
}
#gbchat-launcher:hover { transform: scale(1.08); box-shadow: 0 12px 40px rgba(0,0,0,0.22); }

#gbchat-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e53935;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: sans-serif;
}

/* CHAT WINDOW */
#gbchat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 370px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 120px);
  border-radius: var(--gb-radius);
  background: #fff;
  box-shadow: var(--gb-shadow);
  display: flex;
  flex-direction: column;
  z-index: 99998;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  animation: gbchat-pop .2s ease;
}

@keyframes gbchat-pop {
  from { opacity:0; transform: scale(.92) translateY(16px); }
  to   { opacity:1; transform: scale(1)  translateY(0); }
}

/* HEADER */
#gbchat-header {
  background: var(--gb-color);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#gbchat-header-info { display: flex; align-items: center; gap: 10px; }
#gbchat-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
#gbchat-header-name  { font-weight: 700; font-size: 15px; }
#gbchat-header-status { font-size: 12px; opacity: .85; display:flex; align-items:center; gap:5px; margin-top:2px; }
.gbchat-dot { width:7px; height:7px; border-radius:50%; background:#7fffb2; display:inline-block; }

#gbchat-close {
  background: transparent; border: none; color: #fff;
  font-size: 18px; cursor: pointer; opacity: .8; line-height:1;
  padding: 0;
}
#gbchat-close:hover { opacity: 1; }

/* MESSAGES */
#gbchat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f9f6f3;
}
#gbchat-messages::-webkit-scrollbar { width: 4px; }
#gbchat-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.gbchat-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}
.gbchat-msg.bot {
  background: #fff;
  color: #222;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.gbchat-msg.user {
  background: var(--gb-color);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.gbchat-msg.agent {
  background: #e8f5e9;
  color: #1b5e20;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border-left: 3px solid #43a047;
}
.gbchat-msg-label {
  font-size: 10px;
  color: #aaa;
  margin-bottom: 2px;
  font-weight: 600;
  letter-spacing: .3px;
}

/* AGENT BANNER */
#gbchat-agent-banner {
  background: #e8f5e9;
  color: #2e7d32;
  text-align: center;
  font-size: 13px;
  padding: 8px;
  font-weight: 600;
  flex-shrink: 0;
}

/* TYPING */
#gbchat-typing {
  padding: 10px 16px;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
  background: #f9f6f3;
}
#gbchat-typing span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #bbb;
  animation: gbchat-bounce 1.2s infinite;
}
#gbchat-typing span:nth-child(2) { animation-delay: .2s; }
#gbchat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes gbchat-bounce {
  0%, 80%, 100% { transform: scale(.7); opacity:.5; }
  40%           { transform: scale(1);  opacity:1; }
}

/* INPUT AREA */
#gbchat-input-area {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid #eee;
  gap: 8px;
  background: #fff;
  flex-shrink: 0;
}
#gbchat-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  padding: 9px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
}
#gbchat-input:focus { border-color: var(--gb-color); }

#gbchat-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gb-color);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}
#gbchat-send:hover { filter: brightness(1.1); }

/* FOOTER */
#gbchat-footer {
  text-align: center;
  font-size: 11px;
  color: #bbb;
  padding: 6px;
  background: #fff;
  flex-shrink: 0;
}

/* QUICK REPLIES */
.gbchat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
  background: #f9f6f3;
}
.gbchat-qr-btn {
  background: #fff;
  border: 1px solid var(--gb-color);
  color: var(--gb-color);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.gbchat-qr-btn:hover { background: var(--gb-color); color: #fff; }

@media (max-width: 420px) {
  #gbchat-window { right: 0; bottom: 0; width: 100vw; max-width:100vw; height: 100vh; max-height:100vh; border-radius: 0; }
  #gbchat-launcher { bottom: 16px; right: 16px; }
}
