:root {
  --hd-primary: #1C9866;
  --hd-glass: rgba(28,152,102,0.9); /* solid primary background, 0.9 opacity */
  --hd-glass-border: rgba(255,255,255,0.25);
  --hd-text: #ffffff;
  --hd-radius: 18px;
  --hd-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* Fixed placement */
.hdcb-wrap {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99999;
  font-family: "Jost", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
  opacity: 1 !important;
  transform: translateY(20px);
}

/* Toggle button */
.hdcb-toggle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 30% 30%, var(--hd-primary), #0d5a3d 70%);
  box-shadow: 0 10px 25px rgba(0,0,0,.35), inset 0 1px 8px rgba(255,255,255,.25);
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: transform .2s ease;
}
.hdcb-toggle:hover { transform: translateY(-2px); }

.hdcb-toggle-dot, .hdcb-toggle-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
}

.hdcb-toggle-dot {
  width: 6px; height: 6px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 0 12px #fff, 0 0 24px #fff;
  animation: hdcb-pulse 2.8s ease-in-out infinite;
}

.hdcb-toggle-ring {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  animation: hdcb-breathe 4s ease-in-out infinite;
}

@keyframes hdcb-pulse {
  0%,100% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
  50% { transform: translate(-50%,-50%) scale(1.2); opacity: .75; }
}
@keyframes hdcb-breathe {
  0%,100% { transform: translate(-50%,-50%) scale(1); opacity: .8; }
  50% { transform: translate(-50%,-50%) scale(1.07); opacity: .5; }
}

/* Panel (solid glass look) */
.hdcb-panel {
  position: absolute;
  right: 0; bottom: 90px;
  width: min(380px, 95vw);
  background: var(--hd-glass);
  border: 1px solid var(--hd-glass-border);
  border-radius: var(--hd-radius);
  color: var(--hd-text);
  box-shadow: var(--hd-shadow);
  display: none;
  transform-origin: bottom right;
  animation: hdcb-pop .2s ease-out;
}
.hdcb-panel.open { display: block; }

@keyframes hdcb-pop {
  from { transform: scale(.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Header */
.hdcb-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--hd-glass-border);
}

.hdcb-title strong {
  font-family: "Lexend Deca", "Jost", system-ui, sans-serif;
  font-size: 16px;
}
.hdcb-title small { display: block; opacity: .8; font-size: 12px; color: #ffffff; }

.hdcb-actions button {
  appearance: none; border: none; background: transparent;
  color: #fff; font-size: 18px; cursor: pointer; margin-left: 8px;
}

/* Content */
.hdcb-content {
  padding: 16px;
}

/* Lead form layout */
.hdcb-lead-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hdcb-field label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: #ffffff;
}
.hdcb-field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--hd-glass-border);
  background: rgba(255,255,255,.2);
  color: #fff;
}
.hdcb-field input::placeholder { color: rgba(255,255,255,.85); }

.hdcb-btn {
  background: #fff;
  color: var(--hd-primary);
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(255,255,255,.35);
  transition: all 0.2s ease;
}
.hdcb-btn:hover { transform: translateY(-1px); }

.hdcb-btn:disabled { opacity: .6; cursor: not-allowed; }

.hdcb-lead-status {
  margin-top: 8px;
  font-size: 13px;
  color: #fff;
}

/* Chat area */
.hdcb-messages {
  height: 360px;
  overflow: auto;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1);
}

.hdcb-msg {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.4;
}
.hdcb-msg.user {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
}
.hdcb-msg.bot {
  background: rgba(255,255,255,.25);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
}

.hdcb-messages h4 {
  margin: 6px 0 4px;
  font-family: "Lexend Deca", "Jost", system-ui, sans-serif;
  color: #ffffff;
}
.hdcb-messages a { text-decoration: underline; color: #ffffff; }

.hdcb-input {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.hdcb-input input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.15);
  color: #fff;
}
.hdcb-input input::placeholder { color: rgba(255,255,255,.8); }

.hdcb-send {
  background: #fff;
  color: var(--hd-primary);
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(255,255,255,.35);
  transition: all 0.2s ease;
}
.hdcb-send:hover { transform: translateY(-1px); }

.hdcb-note {
  font-size: 11px;
  opacity: .8;
  margin-top: 6px;
  color: #fff;
}


/* Responsive */
@media (max-width: 480px) {
  .hdcb-wrap { right: 12px; bottom: 12px; }
  .hdcb-toggle { width: 60px; height: 60px; }
  .hdcb-panel {
    right: -4px;
    width: calc(100vw - 24px);
    max-height: 85vh;
  }
  .hdcb-messages { height: 48vh; }
}
@media (max-height: 680px) {
  .hdcb-messages { height: 46vh; }
}
/* Typing animation (three bouncing dots) */
.hdcb-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 6px 0;
}
.hdcb-typing span {
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  opacity: 0.5;
  animation: hdcb-bounce 1.2s infinite ease-in-out;
}
.hdcb-typing span:nth-child(1) { animation-delay: 0s; }
.hdcb-typing span:nth-child(2) { animation-delay: 0.2s; }
.hdcb-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes hdcb-bounce {
  0%, 80%, 100% { transform: scale(0.4); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}
/* Chatbot scrollbar styling */
.hdcb-messages {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(255,255,255,0.4) rgba(255,255,255,0.1);
}

/* Chrome, Edge, Safari */
.hdcb-messages::-webkit-scrollbar {
  width: 8px;
}
.hdcb-messages::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
}
.hdcb-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.5);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.3);
  transition: background 0.3s ease;
}
.hdcb-messages::-webkit-scrollbar-thumb:hover {
  background: var(--hd-primary);
}

/* Subtle fade for scroll area */
.hdcb-messages::after {
  content: "";
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 12px;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.25));
  border-radius: 0 0 12px 12px;
}
