/* ════════════════════════════════════════════════════════
   NEXVAULT — CHATBOT WIDGET
   ════════════════════════════════════════════════════════ */

/* ─── Toggle Button ─── */
.nx-chatbot {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
}
.nx-chatbot-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #63B3ED, #9F7AEA);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(99,179,237,0.4);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
}
.nx-chatbot-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(99,179,237,0.5);
}
.nx-chatbot-toggle--open .nx-chatbot-toggle-open  { display: none !important; }
.nx-chatbot-toggle--open .nx-chatbot-toggle-close { display: flex !important; }
.nx-chatbot-toggle-open  { display: flex; align-items: center; justify-content: center; }
.nx-chatbot-toggle-close { display: none; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem; }
.nx-chatbot-avatar-img   { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.nx-chatbot-toggle-icon  { color: #fff; font-size: 1.3rem; }

/* ─── Chat Window ─── */
.nx-chatbot-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 340px;
  background: #0d1322;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 480px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.97);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
}
.nx-chatbot-window--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ─── Header ─── */
.nx-chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(99,179,237,0.15), rgba(159,122,234,0.12));
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.nx-chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nx-chatbot-header-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #63B3ED, #9F7AEA);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.nx-chatbot-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nx-chatbot-header-avatar i   { color: #fff; font-size: 1rem; }
.nx-chatbot-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #E2E8F0;
}
.nx-chatbot-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: #48BB78;
  font-weight: 600;
}
.nx-chatbot-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #48BB78;
  animation: nx-chatbot-pulse 1.6s ease infinite;
}
@keyframes nx-chatbot-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(72,187,120,0.5); }
  50%     { box-shadow: 0 0 0 5px rgba(72,187,120,0); }
}
.nx-chatbot-close {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: #94A3B8;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s;
}
.nx-chatbot-close:hover { background: rgba(252,129,129,0.15); color: #FC8181; border-color: rgba(252,129,129,0.2); }

/* ─── Body / Messages ─── */
.nx-chatbot-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.nx-chatbot-body::-webkit-scrollbar { width: 4px; }
.nx-chatbot-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ─── Messages ─── */
.nx-chatbot-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.nx-chatbot-msg--user {
  flex-direction: row-reverse;
}
.nx-chatbot-msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(99,179,237,0.15);
  border: 1px solid rgba(99,179,237,0.25);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 0.78rem;
  color: #63B3ED;
}
.nx-chatbot-msg-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.855rem;
  line-height: 1.55;
}
.nx-chatbot-msg--bot  .nx-chatbot-msg-bubble {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.07);
  color: #94A3B8;
  border-bottom-left-radius: 4px;
}
.nx-chatbot-msg--user .nx-chatbot-msg-bubble {
  background: linear-gradient(135deg, #63B3ED, #9F7AEA);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* ─── Typing indicator ─── */
.nx-chatbot-typing {
  display: flex !important;
  align-items: center;
  gap: 4px;
  padding: 12px 16px !important;
}
.nx-chatbot-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4A5568;
  animation: nx-typing 1.2s infinite;
}
.nx-chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.nx-chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes nx-typing {
  0%,80%,100% { transform: scale(0.7); opacity: 0.4; }
  40%         { transform: scale(1);   opacity: 1; }
}

/* ─── Quick question chips ─── */
.nx-chatbot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0 2px;
}
.nx-chatbot-chip {
  background: rgba(99,179,237,0.1);
  border: 1px solid rgba(99,179,237,0.25);
  color: #63B3ED;
  border-radius: 100px;
  padding: 5px 12px;
  font-size: 0.775rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.nx-chatbot-chip:hover {
  background: rgba(99,179,237,0.2);
  border-color: #63B3ED;
}

/* ─── Footer / Input ─── */
.nx-chatbot-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
  background: #0a0f1e;
  flex-shrink: 0;
}
.nx-chatbot-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 6px 8px 6px 14px;
  transition: border-color 0.2s;
}
.nx-chatbot-input-wrap:focus-within { border-color: rgba(99,179,237,0.4); }
.nx-chatbot-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #E2E8F0;
  font-size: 0.875rem;
  padding: 4px 0;
}
.nx-chatbot-input::placeholder { color: #4A5568; }
.nx-chatbot-send {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #63B3ED, #9F7AEA);
  border: none;
  color: #fff;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.nx-chatbot-send:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(99,179,237,0.3); }

/* ─── Mobile ─── */
@media (max-width: 480px) {
  .nx-chatbot { bottom: 80px; right: 16px; }
  .nx-chatbot-window { width: calc(100vw - 32px); right: 0; }
}
