/* ═══════════════════════════════════════════
   Qubatic Chatbot Styles
   ═══════════════════════════════════════════ */

/* ─── Variables ─────────────────────────── */
:root {
  --qb-primary:    #862D87;
  --qb-primary-dk: #4E4E4E;
  --qb-accent:     #4E4E4E;
  --qb-white:      #ffffff;
  --qb-bg:         #f4f6fb;
  --qb-border:     #dde3ef;
  --qb-bot-bg:     #ffffff;
  --qb-user-bg:    #1a3c6e;
  --qb-user-text:  #ffffff;
  --qb-shadow:     0 8px 32px rgba(26,60,110,0.18);
  --qb-radius:     18px;
  --qb-font:       'Segoe UI', system-ui, -apple-system, sans-serif;
  --qb-z:          99999;
}

/* ─── Launcher Button ───────────────────── */
#qubatic-chat-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: var(--qb-z);
  width: 60px;
  height: 60px;
  background: var(--qb-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--qb-shadow);
  transition: transform 0.25s ease, background 0.2s;
  outline: none;
}
#qubatic-chat-launcher:hover,
#qubatic-chat-launcher:focus {
  background: var(--qb-accent);
  transform: scale(1.08);
}
#qubatic-chat-launcher.qubatic-launcher-open svg {
  transform: rotate(180deg);
  transition: transform 0.3s;
}

/* ─── Chat Window ───────────────────────── */
#qubatic-chatbot-wrapper {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: var(--qb-z);
  width: 370px;
  max-height: 580px;
  background: var(--qb-bg);
  border-radius: var(--qb-radius);
  box-shadow: var(--qb-shadow);
  display: flex;
  flex-direction: column;
  font-family: var(--qb-font);
  font-size: 14px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s ease;
  border: 1px solid var(--qb-border);
}
#qubatic-chatbot-wrapper.qubatic-open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

/* ─── Header ────────────────────────────── */
#qubatic-chat-header {
  background: var(--qb-primary);
  color: var(--qb-white);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#qubatic-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
#qubatic-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  /*background: var(--qb-accent);*/
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  
}
#qubatic-chat-avatar img{
    width: 32px;
}
#qubatic-chat-header strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}
#qubatic-chat-status {
  font-size: 11px;
  opacity: 0.85;
  color: #a8f0c6;
}
#qubatic-chat-close {
  background: transparent;
  border: none;
  color: var(--qb-white);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.2s;
}
#qubatic-chat-close:hover {
  background: rgba(255,255,255,0.15);
}

/* ─── Messages Area ─────────────────────── */
#qubatic-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}
#qubatic-chat-messages::-webkit-scrollbar { width: 4px; }
#qubatic-chat-messages::-webkit-scrollbar-track { background: transparent; }
#qubatic-chat-messages::-webkit-scrollbar-thumb { background: var(--qb-border); border-radius: 4px; }

/* ─── Message Bubbles ───────────────────── */
.qubatic-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-line;
  animation: qubMsgIn 0.2s ease;
}
@keyframes qubMsgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.qubatic-msg-bot {
  background: var(--qb-bot-bg);
  color: #1a2540;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.qubatic-msg-user {
  background: var(--qb-user-bg);
  color: var(--qb-user-text);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.qubatic-msg a {
  color: var(--qb-accent);
  text-decoration: underline;
}
.qubatic-msg-user a {
  color: #a8d4ff;
}

/* ─── Typing Indicator ──────────────────── */
.qubatic-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
}
.qubatic-typing span {
  width: 7px;
  height: 7px;
  background: #b0bed4;
  border-radius: 50%;
  animation: qubDot 1.2s infinite ease-in-out;
}
.qubatic-typing span:nth-child(2) { animation-delay: 0.2s; }
.qubatic-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes qubDot {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40%           { transform: scale(1.2); opacity: 1; }
}

/* ─── Quick Reply Buttons ───────────────── */
.qubatic-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 4px 14px 10px;
  align-self: flex-start;
  width: 100%;
  box-sizing: border-box;
}
.qubatic-quick-btn {
  background: var(--qb-white);
  color: var(--qb-primary);
  border: 1.5px solid var(--qb-primary);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-family: var(--qb-font);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, transform 0.15s;
  white-space: nowrap;
}
.qubatic-quick-btn:hover {
  background: var(--qb-primary);
  color: var(--qb-white);
  transform: translateY(-1px);
}

/* ─── Meeting Room Link ─────────────────── */
.qubatic-meeting-link {
  display: inline-block;
  background: var(--qb-primary);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 10px;
  text-decoration: none !important;
  font-weight: 600;
  margin-top: 4px;
  transition: background 0.2s;
}
.qubatic-meeting-link:hover {
  background: var(--qb-primary-dk);
}

/* ─── Input Area ────────────────────────── */
#qubatic-chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--qb-white);
  border-top: 1px solid var(--qb-border);
  flex-shrink: 0;
}
#qubatic-chat-input {
  flex: 1;
  border: 1.5px solid var(--qb-border);
  border-radius: 24px;
  padding: 9px 16px;
  font-family: var(--qb-font);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  background: var(--qb-bg);
  color: #1a2540;
}
#qubatic-chat-input:focus {
  border-color: var(--qb-primary);
  background: var(--qb-white);
}
#qubatic-chat-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#qubatic-chat-send {
  width: 40px;
  height: 40px;
  background: var(--qb-primary);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
  padding: 0px 0px;
}
#qubatic-chat-send:hover {
  background: var(--qb-accent);
  transform: scale(1.08);
}
#qubatic-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Mobile ────────────────────────────── */
@media (max-width: 480px) {
  #qubatic-chatbot-wrapper {
    right: 0;
    bottom: 0;
    width: 100vw;
    max-height: 90vh;
    border-radius: var(--qb-radius) var(--qb-radius) 0 0;
  }
  #qubatic-chat-launcher {
    bottom: 20px;
    right: 20px;
  }
}

/* ─── Service Details Link Button ───────── */
.qubatic-details-link {
  display: inline-block !important;
  background: var(--qb-primary) !important;
  color: #ffffff !important;
  padding: 8px 16px !important;
  border-radius: 10px !important;
  text-decoration: none !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  margin-top: 4px !important;
  transition: background 0.2s;
}
.qubatic-details-link:hover {
  background: var(--qb-primary-dk) !important;
  color: #fff !important;
}
