/* Floating chat widget */
.bd-chat-widget{position:fixed;bottom:var(--bd-launcher-bottom,20px);top:var(--bd-launcher-top,auto);right:var(--bd-launcher-right,20px);left:var(--bd-launcher-left,auto);z-index:99999;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif}
.bd-chat-launcher{
  width:48px;height:48px;border-radius:50%;background:var(--bd-chat-launcher-bg,#111827);color:var(--bd-chat-launcher-fg,#fff);border:1px solid var(--bd-chat-border,#334155);
  display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 8px 25px rgba(0,0,0,0.2);gap:8px
}
.bd-chat-launcher.has-label{width:auto;height:auto;padding:8px 14px;border-radius:var(--bd-chat-radius,24px)}
.bd-chat-launcher-label{font-size:13px;font-weight:600}
.bd-chat-panel{
  display:none;position:fixed;width:320px;background:var(--bd-chat-panel-bg,#0f172a);color:var(--bd-chat-panel-fg,#e5e7eb);border-radius:16px;
  border:1px solid var(--bd-chat-border,#1f2937);box-shadow:0 15px 35px rgba(0,0,0,0.35);overflow:hidden;
  bottom:calc(var(--bd-launcher-bottom,80px) + 60px);
  right:var(--bd-launcher-right,20px);
  left:var(--bd-launcher-left,auto);
  top:auto
}
.bd-chat-panel.open{display:block}
.bd-chat-header{display:flex;gap:8px;align-items:center;padding:12px;background:var(--bd-chat-header-bg,#111827);border-bottom:1px solid var(--bd-chat-border,#1f2937)}
.bd-chat-headinfo{display:flex;flex-direction:column;min-width:0}
.bd-chat-logo-img{width:28px;height:28px;border-radius:6px;object-fit:contain;background:#0b1222;border:1px solid var(--bd-chat-border,#1f2937)}
.bd-chat-title{font-size:16px;font-weight:700}
.bd-chat-subtitle{font-size:12px;color:#cbd5e1;line-height:1.3}
.bd-chat-list{padding:12px;display:flex;flex-direction:column;gap:10px}
.bd-chat-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:12px;background:var(--bd-chat-item-bg,#0b1222);color:var(--bd-chat-item-fg,#e5e7eb);text-decoration:none;border:1px solid var(--bd-chat-border,#1f2937);transition:transform .12s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease}
.bd-chat-item:hover{background:var(--bd-chat-item-hover,#0b1528);border-color:var(--bd-chat-item-hover-border,var(--bd-chat-border,#334155));color:var(--bd-chat-item-hover-fg,var(--bd-chat-item-fg,#e5e7eb));transform:translateY(-2px);box-shadow:0 6px 16px rgba(0,0,0,0.25)}
.bd-auto-msg{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:12px;background:#0b1222;color:#e5e7eb;border:1px dashed #334155;opacity:0.95}
.bd-fade-in{animation:bdFadeIn .25s ease both}
@keyframes bdFadeIn{0%{opacity:0;transform:translateY(6px)}100%{opacity:1;transform:translateY(0)}}
.bd-typing .bd-typing-dots{display:flex;gap:4px;align-items:center}
.bd-typing .bd-typing-dots i{width:6px;height:6px;border-radius:50%;background:#9aa5b1;display:inline-block;animation:bdPulse .9s infinite ease-in-out}
.bd-typing .bd-typing-dots i:nth-child(2){animation-delay:.15s}
.bd-typing .bd-typing-dots i:nth-child(3){animation-delay:.3s}
@keyframes bdPulse{0%,60%,100%{opacity:.4;transform:translateY(0)}30%{opacity:1;transform:translateY(-2px)}}
.bd-toast{position:fixed;right:20px;bottom:20px;background:#111827;color:#e5e7eb;border:1px solid #334155;border-radius:10px;padding:10px 12px;box-shadow:0 12px 30px rgba(0,0,0,.35);opacity:0;transform:translateY(8px);z-index:100000;transition:opacity .2s ease, transform .2s ease}
.bd-toast.show{opacity:1;transform:translateY(0)}
.bd-icon{width:var(--bd-icon-size,24px);height:var(--bd-icon-size,24px);display:flex;align-items:center;justify-content:center}
.bd-chat-item svg{width:var(--bd-icon-size,22px);height:var(--bd-icon-size,22px)}
.bd-chat-footer{padding:10px 12px;font-size:11px;color:var(--bd-chat-footer-fg,#94a3b8);border-top:1px solid var(--bd-chat-border,#1f2937);background:var(--bd-chat-footer-bg,#0b1222)}

@media (max-width: 768px) {
  .bd-chat-widget{
    bottom:var(--bd-launcher-bottom-mobile,var(--bd-launcher-bottom,20px));
    top:var(--bd-launcher-top-mobile,var(--bd-launcher-top,auto));
    right:var(--bd-launcher-right-mobile,var(--bd-launcher-right,20px));
    left:var(--bd-launcher-left-mobile,var(--bd-launcher-left,auto));
  }
  .bd-chat-panel{
    bottom:calc(var(--bd-launcher-bottom-mobile,80px) + 60px);
    right:var(--bd-launcher-right-mobile,20px);
    left:auto;
    top:auto;
  }
}

/* AI Chat Styles */
.bd-chat-tabs {
  display: flex !important;
  background: var(--bd-chat-footer-bg, #0b1222) !important;
  border-bottom: 1px solid var(--bd-chat-border, #1f2937) !important;
  padding: 6px !important;
  gap: 6px !important;
}
.bd-chat-tab-btn {
  flex: 1 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  color: var(--bd-chat-footer-fg, #94a3b8) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 8px 12px !important;
  cursor: pointer !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  outline: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  line-height: 1 !important;
  box-shadow: none !important;
}
.bd-chat-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--bd-chat-panel-fg, #e5e7eb) !important;
}
.bd-chat-tab-btn.active {
  background: var(--bd-chat-panel-bg, #0f172a) !important;
  color: #ffffff !important;
  border: 1px solid var(--bd-chat-border, #1f2937) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}
.bd-chat-tab-content {
  display: none !important;
}
.bd-chat-tab-content.active {
  display: block !important;
}
.bd-chat-ai-container {
  display: flex !important;
  flex-direction: column !important;
  height: 280px !important;
  background: var(--bd-chat-panel-bg, #0f172a) !important;
}
.bd-chat-ai-history {
  flex: 1 !important;
  padding: 12px !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
.bd-chat-ai-message {
  display: flex !important;
  width: 100% !important;
}
.bd-chat-ai-message.user {
  justify-content: flex-end !important;
}
.bd-chat-ai-message.assistant {
  justify-content: flex-start !important;
}
.bd-chat-ai-bubble {
  max-width: 85% !important;
  padding: 8px 12px !important;
  border-radius: 12px !important;
  font-size: 12.5px !important;
  line-height: 1.4 !important;
  word-break: break-word !important;
  white-space: pre-wrap !important;
}
.bd-chat-ai-message.user .bd-chat-ai-bubble {
  background: var(--bd-chat-launcher-bg, #111827) !important;
  color: var(--bd-chat-launcher-fg, #ffffff) !important;
  border: 1px solid var(--bd-chat-border, #334155) !important;
  border-bottom-right-radius: 2px !important;
}
.bd-chat-ai-message.assistant .bd-chat-ai-bubble {
  background: var(--bd-chat-item-bg, #0b1222) !important;
  color: var(--bd-chat-item-fg, #e5e7eb) !important;
  border: 1px solid var(--bd-chat-border, #1f2937) !important;
  border-bottom-left-radius: 2px !important;
}
.bd-chat-ai-input-bar {
  display: flex !important;
  align-items: center !important;
  padding: 8px 12px !important;
  background: var(--bd-chat-footer-bg, #0b1222) !important;
  border-top: 1px solid var(--bd-chat-border, #1f2937) !important;
  gap: 8px !important;
}
.bd-chat-ai-input {
  flex: 1 !important;
  background: var(--bd-chat-panel-bg, #0f172a) !important;
  color: var(--bd-chat-panel-fg, #e5e7eb) !important;
  border: 1px solid var(--bd-chat-border, #1f2937) !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
  font-size: 13px !important;
  resize: none !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 80px !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
  outline: none !important;
  box-shadow: none !important;
}
.bd-chat-ai-input:focus {
  outline: none !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2) !important;
}
.bd-chat-ai-send-btn {
  background: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease, transform 0.1s ease !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  outline: none !important;
}
.bd-chat-ai-send-btn svg {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #ffffff !important;
  fill: currentColor !important;
}
.bd-chat-ai-send-btn:hover {
  background: #1d4ed8 !important;
  opacity: 1 !important;
}
.bd-chat-ai-send-btn:active {
  transform: scale(0.95) !important;
}
.bd-chat-ai-send-btn:disabled {
  background: #475569 !important;
  color: #94a3b8 !important;
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

/* Typing Indicator Animation */
.bd-chat-ai-typing {
  display: flex;
  gap: 3px;
  padding: 4px 6px;
  align-items: center;
  justify-content: center;
}
.bd-chat-ai-typing span {
  width: 5px;
  height: 5px;
  background-color: var(--bd-chat-panel-fg, #e5e7eb);
  border-radius: 50%;
  display: inline-block;
  animation: bdAiTyping 1.2s infinite ease-in-out;
}
.bd-chat-ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.bd-chat-ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bdAiTyping {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-3px); opacity: 1; }
}

/* Pulsing Live Badge styles */
.bd-chat-live-badge {
  margin-left: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  background: rgba(34, 197, 94, 0.1) !important;
  color: #22c55e !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  padding: 3px 6px !important;
  border-radius: 6px !important;
  border: 1px solid rgba(34, 197, 94, 0.2) !important;
  line-height: 1 !important;
  letter-spacing: 0.5px !important;
  flex-shrink: 0 !important;
}
.bd-chat-live-dot {
  width: 6px !important;
  height: 6px !important;
  background-color: #22c55e !important;
  border-radius: 50% !important;
  display: inline-block !important;
  position: relative !important;
  animation: bdLivePulse 1.5s infinite ease-in-out !important;
}
@keyframes bdLivePulse {
  0% {
    transform: scale(0.8);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.8);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* Clickable AI Links style */
.bd-chat-ai-link {
  color: #3b82f6 !important;
  text-decoration: underline !important;
  font-weight: 600 !important;
  word-break: break-all !important;
  transition: color 0.15s ease !important;
}
.bd-chat-ai-link:hover {
  color: #60a5fa !important;
  text-decoration: underline !important;
}
