/* ── Floating toggle button ── */
#vm-chat-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9000;
  width: 60px;
  height: 60px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #fff1b8 0%, #d8ab46 42%, #9f6f27 100%);
  box-shadow:
    0 16px 34px rgba(216, 171, 70, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  outline: none;
}

#vm-chat-toggle:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 22px 46px rgba(216, 171, 70, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

#vm-chat-toggle svg {
  width: 26px;
  height: 26px;
  fill: #0b0702;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#vm-chat-toggle .icon-chat  { display: block; }
#vm-chat-toggle .icon-close { display: none; }
#vm-chat-toggle.is-open .icon-chat  { display: none; }
#vm-chat-toggle.is-open .icon-close { display: block; }


/* ── Notification badge ── */
#vm-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #f7df9b;
  border: 2px solid #080808;
  box-shadow: 0 0 14px rgba(216, 171, 70, 0.55);
  display: none;
}
#vm-chat-badge.visible { display: block; }


/* ── Chat window ── */
#vm-chat-window {
  position: fixed;
  bottom: 104px;
  right: 28px;
  z-index: 9000;
  width: min(400px, calc(100vw - 40px));
  max-height: min(580px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  border-radius: 30px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(216, 171, 70, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(15, 15, 15, 0.96), rgba(7, 7, 7, 0.98));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(216, 171, 70, 0.22);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 239, 190, 0.08);

  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#vm-chat-window.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}


/* ── Header ── */
#vm-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 16px;
  background: linear-gradient(135deg, #050505 0%, #15110a 48%, #3a2609 100%);
  border-bottom: 1px solid rgba(216, 171, 70, 0.18);
  flex-shrink: 0;
}

#vm-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff1b8 0%, #d8ab46 45%, #9f6f27 100%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #0b0702;
  flex-shrink: 0;
  box-shadow:
    0 10px 22px rgba(216, 171, 70, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

#vm-chat-header-text { flex: 1; }

#vm-chat-header-name {
  font-family: "Manrope", sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff3d0;
  letter-spacing: -0.02em;
}

#vm-chat-header-status {
  font-family: "Manrope", sans-serif;
  font-size: 0.78rem;
  color: rgba(245, 234, 214, 0.68);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

#vm-chat-header-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #d8ab46;
  box-shadow: 0 0 10px rgba(216, 171, 70, 0.75);
  flex-shrink: 0;
}


/* ── Messages ── */
#vm-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

#vm-chat-messages::-webkit-scrollbar       { width: 4px; }
#vm-chat-messages::-webkit-scrollbar-track { background: transparent; }
#vm-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(216, 171, 70, 0.32);
  border-radius: 99px;
}

.vm-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: vmFadeUp 0.24s ease both;
}

@keyframes vmFadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.vm-msg.vm-msg-bot  { align-self: flex-start; }
.vm-msg.vm-msg-user { align-self: flex-end; }

.vm-msg-bubble {
  padding: 11px 15px;
  border-radius: 20px;
  font-family: "Manrope", sans-serif;
  font-size: 0.91rem;
  line-height: 1.55;
}

.vm-msg-bot .vm-msg-bubble {
  background: rgba(20, 18, 14, 0.92);
  border: 1px solid rgba(216, 171, 70, 0.15);
  color: rgba(245, 234, 214, 0.88);
  border-bottom-left-radius: 6px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

.vm-msg-user .vm-msg-bubble {
  background: linear-gradient(135deg, #fff1b8 0%, #d8ab46 42%, #9f6f27 100%);
  color: #0b0702;
  border-bottom-right-radius: 6px;
  box-shadow:
    0 10px 24px rgba(216, 171, 70, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}


/* ── Typing indicator ── */
.vm-typing .vm-msg-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 13px 16px;
}

.vm-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(216, 171, 70, 0.75);
  box-shadow: 0 0 8px rgba(216, 171, 70, 0.4);
  animation: vmDot 1.2s ease-in-out infinite;
}
.vm-typing-dot:nth-child(2) { animation-delay: 0.18s; }
.vm-typing-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes vmDot {
  0%, 80%, 100% { transform: scale(1);   opacity: 0.4; }
  40%           { transform: scale(1.3); opacity: 1;   }
}


/* ── Suggestions ── */
#vm-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 10px;
  border-top: 1px solid rgba(216, 171, 70, 0.08);
}

.vm-suggestion {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(216, 171, 70, 0.18);
  background: rgba(18, 17, 15, 0.92);
  color: #f7df9b;
  font-family: "Manrope", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
  white-space: nowrap;
}

.vm-suggestion:hover {
  transform: translateY(-2px);
  background: rgba(216, 171, 70, 0.12);
  border-color: rgba(247, 223, 155, 0.42);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
}


/* ── Input area ── */
#vm-chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(216, 171, 70, 0.16);
  background: rgba(7, 7, 7, 0.66);
  flex-shrink: 0;
}

#vm-chat-input {
  flex: 1;
  resize: none;
  border: 1px solid rgba(216, 171, 70, 0.18);
  border-radius: 18px;
  padding: 12px 15px;
  font-family: "Manrope", sans-serif;
  font-size: 0.91rem;
  color: #f5ead6;
  background: rgba(18, 17, 15, 0.95);
  outline: none;
  line-height: 1.45;
  max-height: 110px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

#vm-chat-input::placeholder { color: rgba(245, 234, 214, 0.42); }

#vm-chat-input:focus {
  border-color: rgba(247, 223, 155, 0.52);
  box-shadow:
    0 0 0 4px rgba(216, 171, 70, 0.12),
    0 8px 18px rgba(0, 0, 0, 0.28);
}

#vm-chat-send {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  background: linear-gradient(135deg, #fff1b8 0%, #d8ab46 42%, #9f6f27 100%);
  box-shadow:
    0 10px 24px rgba(216, 171, 70, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
}

#vm-chat-send:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 30px rgba(216, 171, 70, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

#vm-chat-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

#vm-chat-send svg {
  width: 18px;
  height: 18px;
  fill: #0b0702;
  margin-left: 2px;
}


/* ── Error text ── */
.vm-error {
  font-family: "Manrope", sans-serif;
  font-size: 0.82rem;
  color: #f0cf84;
  text-align: center;
  padding: 6px 14px;
}


/* ── Mobile ── */
@media (max-width: 480px) {
  #vm-chat-window {
    bottom: 90px;
    right: 14px;
    width: calc(100vw - 28px);
  }

  #vm-chat-toggle {
    bottom: 18px;
    right: 18px;
  }
}