/* ==========================================================================
   VeyronixHost Live Chat Widget Styles
   ========================================================================== */

/* Floating Launcher Button */
.v-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4), 0 8px 10px -6px rgba(37, 99, 235, 0.3);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  user-select: none;
}

.v-chat-launcher:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 28px -5px rgba(37, 99, 235, 0.5), 0 10px 10px -5px rgba(37, 99, 235, 0.35);
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.v-chat-launcher:active {
  transform: translateY(0) scale(0.98);
}

.v-chat-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: vChatPulse 2s infinite;
}

@keyframes vChatPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.v-chat-badge {
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
}

/* Chat Widget Window Container */
.v-chat-window {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 110px);
  z-index: 9999;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9) translateY(20px);
  backdrop-filter: blur(16px);
}

.v-chat-window.is-open {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

/* Light / Dark Mode Window Backgrounds */
.v-chat-window {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

.dark .v-chat-window {
  background: #0b1120;
  border: 1px solid #1e293b;
  color: #f8fafc;
}

/* Header */
.v-chat-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  user-select: none;
}

.v-chat-agent-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.v-chat-agent-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  font-weight: 800;
  font-size: 14px;
}

.v-chat-status-indicator {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid #1e3a8a;
  border-radius: 50%;
}

.v-chat-agent-details h4 {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}

.v-chat-agent-details span {
  font-size: 11px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 4px;
}

.v-chat-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.v-chat-btn-icon {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.v-chat-btn-icon:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Chat Messages Stream Area */
.v-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

/* Message Bubbles */
.v-msg-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: vMsgFadeIn 0.2s ease-out;
}

@keyframes vMsgFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.v-msg-wrapper.is-visitor {
  align-self: flex-end;
  align-items: flex-end;
}

.v-msg-wrapper.is-operator,
.v-msg-wrapper.is-bot {
  align-self: flex-start;
  align-items: flex-start;
}

.v-msg-author {
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 2px;
  padding: 0 4px;
  color: #64748b;
}

.dark .v-msg-author {
  color: #94a3b8;
}

.v-msg-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}

.v-msg-wrapper.is-visitor .v-msg-bubble {
  background: #2563eb;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.v-msg-wrapper.is-operator .v-msg-bubble {
  background: #f1f5f9;
  color: #0f172a;
  border-bottom-left-radius: 4px;
  border: 1px solid #e2e8f0;
}

.dark .v-msg-wrapper.is-operator .v-msg-bubble,
.dark .v-msg-wrapper.is-bot .v-msg-bubble {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #334155;
  border-bottom-left-radius: 4px;
}

.v-msg-meta {
  font-size: 9.5px;
  margin-top: 3px;
  padding: 0 4px;
  color: #94a3b8;
}

/* Quick Replies Chips */
.v-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.v-quick-chip {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.25);
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.dark .v-quick-chip {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.v-quick-chip:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  transform: translateY(-1px);
}

/* Typing Indicator */
.v-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: 12px;
  width: fit-content;
  border-bottom-left-radius: 3px;
}

.dark .v-typing-indicator {
  background: #1e293b;
}

.v-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: vTypingBounce 1.4s infinite ease-in-out both;
}

.v-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.v-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes vTypingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Chat Input Bar */
.v-chat-footer {
  padding: 10px 14px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dark .v-chat-footer {
  border-color: #1e293b;
  background: #090e1a;
}

.v-chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.v-chat-input {
  flex: 1;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 12.5px;
  outline: none;
  color: inherit;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dark .v-chat-input {
  background: #131c2e;
  border-color: #334155;
}

.v-chat-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.v-chat-send-btn {
  background: #2563eb;
  color: #ffffff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  shrink: 0;
}

.v-chat-send-btn:hover {
  background: #1d4ed8;
  transform: scale(1.05);
}

.v-chat-send-btn:active {
  transform: scale(0.95);
}

.v-chat-footer-brand {
  font-size: 9.5px;
  text-align: center;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.v-chat-footer-brand a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
}

.v-chat-footer-brand a:hover {
  text-decoration: underline;
}
