/* Verentia Chat Widget */

#vchat-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* FAB button */
.vchat-fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #1D4ED8;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.4);
  margin-left: auto;
}
.vchat-fab:hover {
  transform: scale(1.06);
  background: #1e40af;
}

/* Modal */
.vchat-modal-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
  pointer-events: all !important;
}
.vchat-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

#vchat-modal {
  position: absolute;
  bottom: 64px;
  right: 0;
  width: 330px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* Header */
.vchat-header {
  background: #1D4ED8;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.vchat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  flex-shrink: 0;
}
.vchat-header-info { flex: 1; }
.vchat-name {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  line-height: 1.3;
}
.vchat-status {
  color: rgba(255,255,255,0.75);
  font-size: 11px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.3;
}
.vchat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}
.vchat-close {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.8);
  font-size: 18px;
  padding: 0;
  line-height: 1;
  transition: color 0.1s;
}
.vchat-close:hover { color: #fff; }

/* Messages */
.vchat-messages {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.vchat-messages::-webkit-scrollbar { width: 4px; }
.vchat-messages::-webkit-scrollbar-track { background: transparent; }
.vchat-messages::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 2px; }

.vchat-msg { display: flex; flex-direction: column; gap: 3px; }
.vchat-bot  { align-items: flex-start; }
.vchat-user { align-items: flex-end; }

.vchat-bubble {
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 88%;
  word-break: break-word;
}
.vchat-bot .vchat-bubble {
  background: #f3f4f6;
  color: #111827;
  border-bottom-left-radius: 4px;
}
.vchat-user .vchat-bubble {
  background: #1D4ED8;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.vchat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  background: #f3f4f6;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.vchat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ca3af;
  animation: vchat-blink 1.2s infinite;
  display: block;
}
.vchat-typing span:nth-child(2) { animation-delay: 0.2s; }
.vchat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes vchat-blink {
  0%, 80%, 100% { opacity: 0.3; }
  40%           { opacity: 1; }
}

/* Input area */
.vchat-input-area {
  padding: 10px 12px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.vchat-input {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  color: #111827;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.vchat-input:focus { border-color: #1D4ED8; }
.vchat-input:disabled { background: #f9fafb; cursor: not-allowed; }

.vchat-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1D4ED8;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.vchat-send-btn:hover  { opacity: 0.85; }
.vchat-send-btn:active { opacity: 0.7; }
.vchat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Footer */
.vchat-footer {
  text-align: center;
  padding: 6px 12px;
  border-top: 1px solid #f0f0f0;
  font-size: 11px;
}
.vchat-footer a {
  color: #9ca3af;
  text-decoration: none;
}
.vchat-footer a:hover { text-decoration: underline; }

.vchat-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.15s;
  color: rgba(255,255,255,0.75);
  font-size: 18px;
  line-height: 1;
}
.vchat-icon-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.vchat-icon-btn:hover svg { stroke: white; }
