/* ============================================
   CHATBOT.CSS — Vonthrex Guided Assistant
   Dark theme, purple accent
   ============================================ */

/* ── BUBBLE ── */
.cb-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7F56D9, #6d28d9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 6px 24px rgba(127,86,217,.35);
  transition: all .3s;
  border: none;
}
.cb-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 32px rgba(127,86,217,.5);
}
.cb-bubble .cb-badge {
  position: absolute;
  top: -2px; right: -2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #0a0e1a;
  animation: cbPing 2s infinite;
}
@keyframes cbPing {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}
.cb-bubble--open .fa-comment-dots { display: none; }
.cb-bubble--open .fa-xmark { display: block; }
.cb-bubble:not(.cb-bubble--open) .fa-xmark { display: none; }

/* ── WINDOW ── */
.cb-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 370px;
  max-height: 520px;
  border-radius: 16px;
  background: #111827;
  border: 1px solid rgba(127,86,217,.15);
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}
.cb-window.cb-open {
  display: flex;
  animation: cbSlideUp .3s ease;
}
@keyframes cbSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── HEADER ── */
.cb-header {
  padding: 16px 18px;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(127,86,217,.1);
}
.cb-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7F56D9, #a78bfa);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  color: #fff;
  flex-shrink: 0;
}
.cb-header-info h5 {
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.cb-header-info span {
  font-size: .65rem;
  color: #a5b4fc;
}
.cb-header-info span i {
  color: #10b981;
  font-size: .5rem;
  margin-right: 4px;
}

/* ── MESSAGES ── */
.cb-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 340px;
  scrollbar-width: thin;
  scrollbar-color: rgba(127,86,217,.2) transparent;
}
.cb-msg {
  max-width: 85%;
  animation: cbFadeIn .3s ease;
}
@keyframes cbFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.cb-msg--bot {
  align-self: flex-start;
}
.cb-msg--user {
  align-self: flex-end;
}
.cb-msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: .82rem;
  line-height: 1.5;
}
.cb-msg--bot .cb-msg-bubble {
  background: rgba(127,86,217,.08);
  border: 1px solid rgba(127,86,217,.1);
  color: #e0e6f0;
  border-top-left-radius: 4px;
}
.cb-msg--user .cb-msg-bubble {
  background: linear-gradient(135deg, #7F56D9, #6d28d9);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* ── OPTIONS BUTTONS ── */
.cb-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.cb-opt-btn {
  padding: 7px 14px;
  border-radius: 50px;
  border: 1px solid rgba(127,86,217,.2);
  background: rgba(127,86,217,.05);
  color: #c4b5fd;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
}
.cb-opt-btn:hover {
  background: rgba(127,86,217,.15);
  border-color: #7F56D9;
  color: #fff;
  transform: translateY(-1px);
}
.cb-opt-btn i {
  font-size: .65rem;
}

/* ── INPUT ── */
.cb-input-area {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.05);
  display: flex;
  gap: 8px;
  background: rgba(0,0,0,.15);
}
.cb-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: #e0e6f0;
  font-size: .82rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color .3s;
}
.cb-input:focus {
  border-color: rgba(127,86,217,.3);
}
.cb-input::placeholder {
  color: #6b7280;
}
.cb-send {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #7F56D9, #6d28d9);
  color: #fff;
  font-size: .85rem;
  cursor: pointer;
  transition: all .3s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cb-send:hover {
  transform: scale(1.05);
}

/* ── TYPING INDICATOR ── */
.cb-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-self: flex-start;
}
.cb-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #7F56D9;
  animation: cbTypeDot 1.2s ease-in-out infinite;
}
.cb-typing span:nth-child(2) { animation-delay: .2s; }
.cb-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes cbTypeDot {
  0%, 100% { opacity: .3; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ── SERVICE MINI CARD ── */
.cb-svc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(127,86,217,.05);
  border: 1px solid rgba(127,86,217,.08);
  margin-top: 4px;
  cursor: pointer;
  transition: all .25s;
  font-size: .75rem;
  color: #c4b5fd;
}
.cb-svc-item:hover {
  background: rgba(127,86,217,.12);
  border-color: rgba(127,86,217,.25);
}
.cb-svc-item i {
  color: #a78bfa;
  width: 18px;
  text-align: center;
}
.cb-svc-item span {
  color: #e0e6f0;
  font-weight: 500;
}

/* ── PRICING MINI ── */
.cb-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.03);
  font-size: .75rem;
}
.cb-price-row:last-child { border-bottom: none; }
.cb-price-name { color: #c4b5fd; font-weight: 600; }
.cb-price-val { color: #10b981; font-weight: 700; }

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .cb-window {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: 80px;
    max-height: 65vh;
  }
  .cb-messages {
    max-height: 50vh;
  }
  .cb-bubble {
    bottom: 16px;
    right: 16px;
    width: 52px; height: 52px;
    font-size: 1.2rem;
  }
  /* Move WhatsApp to the left on mobile */
  .whatsapp-float {
    right: auto !important;
    left: 16px !important;
    bottom: 16px !important;
  }
}

/* Desktop: chatbot at bottom */
.cb-bubble {
  bottom: 24px;
  right: 24px;
}
.cb-window {
  bottom: 96px;
}

@media (max-width: 480px) {
  .cb-bubble {
    bottom: 16px;
    right: 16px;
  }
  .cb-window {
    bottom: 80px;
  }
}
