/* ── Velixel CHAT WIDGET ─────────────────────────── */
#vlx-chat { font-family: var(--font-body); }

.vlx-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--blue);
  border: none;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(26,127,232,0.45), 0 0 0 1px rgba(46,150,255,0.25);
  transition: background .2s, transform .15s, box-shadow .25s;
  z-index: 9999;
}
.vlx-chat-toggle:hover {
  background: var(--blue-bright);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(26,127,232,0.55), 0 0 0 1px rgba(46,150,255,0.4);
}
.vlx-chat-toggle svg { width: 24px; height: 24px; }
.vlx-chat-toggle .vlx-icon-close { display: none; }
.vlx-chat-toggle.is-open .vlx-icon-open { display: none; }
.vlx-chat-toggle.is-open .vlx-icon-close { display: block; }

.vlx-chat-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(46,150,255,0.08);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  transform-origin: bottom right;
  animation: vlx-pop-in .18s ease-out;
}
.vlx-chat-panel.is-open { display: flex; }

@keyframes vlx-pop-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.vlx-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(26,127,232,0.08), transparent);
  flex-shrink: 0;
}
.vlx-chat-header-text { display: flex; flex-direction: column; gap: 2px; }
.vlx-chat-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--white);
  letter-spacing: -0.01em;
}
.vlx-chat-subtitle {
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.vlx-chat-subtitle::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #25d366;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px rgba(37,211,102,0.8);
}
.vlx-chat-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}
.vlx-chat-close:hover { background: rgba(255,255,255,0.06); color: var(--white); }

.vlx-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vlx-chat-body::-webkit-scrollbar { width: 6px; }
.vlx-chat-body::-webkit-scrollbar-track { background: transparent; }
.vlx-chat-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.vlx-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.55;
  word-wrap: break-word;
  white-space: pre-wrap;
  font-weight: 400;
}
.vlx-msg-bot {
  align-self: flex-start;
  background: rgba(26,127,232,0.08);
  border: 1px solid rgba(26,127,232,0.18);
  color: var(--white);
  border-bottom-left-radius: 4px;
}
.vlx-msg-user {
  align-self: flex-end;
  background: var(--blue);
  color: var(--white);
  border-bottom-right-radius: 4px;
}
.vlx-msg a { color: var(--blue-bright); text-decoration: underline; }
.vlx-msg-user a { color: var(--white); }
.vlx-msg-error {
  align-self: flex-start;
  background: rgba(239,68,68,0.10);
  border: 1px solid rgba(239,68,68,0.30);
  color: #fca5a5;
}

.vlx-typing {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 12px 14px;
  background: rgba(26,127,232,0.08);
  border: 1px solid rgba(26,127,232,0.18);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
}
.vlx-typing span {
  width: 6px;
  height: 6px;
  background: var(--blue-bright);
  border-radius: 50%;
  animation: vlx-bounce 1.2s infinite ease-in-out;
}
.vlx-typing span:nth-child(2) { animation-delay: 0.15s; }
.vlx-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes vlx-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.vlx-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: rgba(8,13,20,0.6);
  flex-shrink: 0;
}
.vlx-chat-input textarea {
  flex: 1;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 400;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  line-height: 1.4;
  outline: none;
  transition: border-color .2s;
}
.vlx-chat-input textarea:focus { border-color: rgba(46,150,255,0.5); }
.vlx-chat-input textarea::placeholder { color: var(--muted); }
.vlx-chat-send {
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s;
  align-self: stretch;
  min-width: 64px;
}
.vlx-chat-send:hover:not(:disabled) { background: var(--blue-bright); }
.vlx-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 480px) {
  .vlx-chat-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 84px;
    height: calc(100vh - 100px);
  }
  .vlx-chat-toggle { right: 16px; bottom: 16px; }
}
