/* ── VeynoSmart Chatbot Widget · v2026-04-18 ──────────────── */
:root {
  --vs-blue:       #2563EB;
  --vs-blue-dark:  #1D4ED8;
  --vs-blue-light: #60A5FA;
  --vs-radius:     12px;
  --vs-shadow:     0 8px 30px rgba(0,0,0,0.15);
}

/* Floating Button */
#vs-chat-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--vs-blue);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--vs-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  transition: background 0.2s, transform 0.2s;
}
#vs-chat-btn:hover { background: var(--vs-blue-dark); transform: scale(1.08); }
#vs-chat-btn svg  { width: 26px; height: 26px; }

/* Notification dot */
#vs-chat-btn .vs-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 10px; height: 10px;
  background: #EF4444;
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
}
#vs-chat-btn .vs-dot.show { display: block; }

/* Chat Window */
#vs-chat-window {
  position: fixed;
  bottom: 92px;
  left: 24px;
  width: 340px;
  max-height: 520px;
  background: #fff;
  border-radius: var(--vs-radius);
  box-shadow: var(--vs-shadow);
  display: flex;
  flex-direction: column;
  z-index: 8999;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
#vs-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.dark #vs-chat-window { background: #1E293B; }

/* Header */
#vs-chat-header {
  background: var(--vs-blue);
  color: #fff;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.vs-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vs-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 7px;
  box-sizing: border-box;
}

.vs-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.vs-header-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.vs-header-name {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}

.vs-header-status {
  display: flex;
  align-items: center;
  gap: 5px;
}

#vs-chat-header .vs-header-status span:last-child {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.85);
}

.vs-online-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
  will-change: transform, opacity;
  animation: vs-pulse 2s ease-in-out infinite;
}

@keyframes vs-pulse {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%       { opacity: 0.6; transform: scale(1.15); }
}

#vs-chat-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  opacity: 0.8;
  transition: opacity 0.15s;
}
#vs-chat-close:hover { opacity: 1; }

/* Messages */
#vs-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vs-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}
.vs-msg.bot {
  background: #F1F5F9;
  color: #1E293B;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.dark .vs-msg.bot { background: #334155; color: #F1F5F9; }
.vs-msg.user {
  background: var(--vs-blue);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.vs-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
  background: #F1F5F9;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.dark .vs-typing { background: #334155; }
.vs-typing span {
  width: 7px; height: 7px;
  background: #94A3B8;
  border-radius: 50%;
  animation: vs-bounce 1.2s infinite;
}
.vs-typing span:nth-child(2) { animation-delay: 0.2s; }
.vs-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes vs-bounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40%           { transform: scale(1.2); opacity: 1; }
}

/* Input area */
#vs-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #E2E8F0;
  flex-shrink: 0;
}
.dark #vs-chat-input-row { border-top-color: #334155; }

#vs-chat-input {
  flex: 1;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  background: #fff;
  color: #1E293B;
  resize: none;
  transition: border-color 0.15s;
}
.dark #vs-chat-input { background: #334155; border-color: #475569; color: #F1F5F9; }
#vs-chat-input:focus { border-color: var(--vs-blue); }

#vs-chat-send {
  background: var(--vs-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
#vs-chat-send:hover   { background: var(--vs-blue-dark); }
#vs-chat-send:disabled { background: #CBD5E1; cursor: not-allowed; }
#vs-chat-send svg { width: 18px; height: 18px; }

/* Mobile */
@media (max-width: 400px) {
  #vs-chat-window { width: calc(100vw - 24px); left: 12px; bottom: 80px; }
  #vs-chat-btn    { left: 16px; bottom: 16px; }
}

/* Greeting Bubble */
#vs-chat-bubble {
  position: fixed;
  bottom: 92px;
  left: 16px;
  max-width: 220px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px 14px 14px 4px;
  padding: 10px 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  font-size: 13px;
  color: #1f2937;
  line-height: 1.4;
  z-index: 8998;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
#vs-chat-bubble.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#vs-bubble-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #9ca3af;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  margin-top: -1px;
}
#vs-bubble-close:hover { color: #374151; }
.dark #vs-chat-bubble {
  background: #1E293B;
  border-color: #334155;
  color: #e2e8f0;
}
#vs-chat-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 20px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #fff;
}
.dark #vs-chat-bubble::after {
  border-top-color: #1E293B;
}

/* ── Consent Gate ───────────────────────────────────────────── */
#vs-consent-gate {
  padding: 16px;
  border-top: 1px solid #E2E8F0;
  flex-shrink: 0;
  background: #f8fafc;
}
.dark #vs-consent-gate { background: #1e293b; border-top-color: #334155; }

#vs-consent-gate p {
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 10px;
}
.dark #vs-consent-gate p { color: #94a3b8; }

.vs-consent-dsgvo {
  background: none;
  border: none;
  color: var(--vs-blue);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  display: block;
  margin-bottom: 10px;
}

#vs-consent-ok {
  width: 100%;
  padding: 10px;
  background: var(--vs-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
#vs-consent-ok:hover { background: var(--vs-blue-dark); }

/* ── Callback Form ──────────────────────────────────────────── */
#vs-callback-form {
  padding: 16px;
  border-top: 1px solid #E2E8F0;
  flex-shrink: 0;
}
.dark #vs-callback-form { border-top-color: #334155; }

.vs-cb-hint {
  font-size: 12px;
  color: #475569;
  margin: 0 0 10px;
}
.dark .vs-cb-hint { color: #94a3b8; }

#vs-cb-name,
#vs-cb-phone {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  background: #fff;
  color: #1E293B;
  margin-bottom: 8px;
  outline: none;
  transition: border-color 0.15s;
}
.dark #vs-cb-name,
.dark #vs-cb-phone {
  background: #334155;
  border-color: #475569;
  color: #F1F5F9;
}
#vs-cb-name:focus,
#vs-cb-phone:focus { border-color: var(--vs-blue); }

#vs-cb-submit {
  width: 100%;
  padding: 10px;
  background: var(--vs-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
#vs-cb-submit:hover    { background: var(--vs-blue-dark); }
#vs-cb-submit:disabled { background: #CBD5E1; cursor: not-allowed; }

#vs-cb-status {
  font-size: 12px;
  color: #ef4444;
  margin: 8px 0 0;
}

/* ── Consent Screen ───────────────────────────────────────── */
#vs-consent-body {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  overflow-y: auto;
}

.vs-consent-title {
  font-weight: 600;
  font-size: 15px;
  color: #1E293B;
  margin: 0;
}
.dark .vs-consent-title { color: #F1F5F9; }

.vs-consent-text {
  font-size: 13px;
  color: #475569;
  line-height: 1.55;
  margin: 0;
}
.dark .vs-consent-text { color: #94A3B8; }

.vs-consent-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 13px;
  color: #1E293B;
  line-height: 1.5;
}
.dark .vs-consent-label { color: #F1F5F9; }
.vs-consent-label input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--vs-blue);
  width: 15px;
  height: 15px;
}
.vs-consent-label a {
  color: var(--vs-blue);
  text-decoration: underline;
}

#vs-consent-btn {
  background: var(--vs-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
  margin-top: auto;
}
#vs-consent-btn:hover:not(:disabled) { background: var(--vs-blue-dark); }
#vs-consent-btn:disabled { background: #CBD5E1; cursor: not-allowed; }
