/* VynFlo Website Chat Widget — styled to match vynflo.com's design system */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --vf-primary: #2563EB;
  --vf-primary-light: #60A5FA;
  --vf-ink: #1E293B;
  --vf-muted: #64748B;
  --vf-border: #E2E8F0;
  --vf-bg-soft: #F0F4FF;
}

#vf-chat-bubble {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--vf-primary), var(--vf-primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
  z-index: 9999;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, bottom 0.3s ease;
  padding: 0;
}

#vf-chat-bubble svg {
  width: 26px;
  height: 26px;
}

#vf-chat-bubble:hover {
  transform: scale(1.06);
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.45);
}

#vf-chat-panel {
  position: fixed;
  bottom: 104px;
  right: 32px;
  width: 340px;
  max-height: 460px;
  background: #fff;
  border-radius: 20px;
  border-bottom-right-radius: 6px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
  border: 1px solid var(--vf-border);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: 'Inter', sans-serif;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

#vf-chat-panel.vf-open {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

#vf-chat-header {
  background: linear-gradient(135deg, var(--vf-primary), var(--vf-primary-light));
  color: #fff;
  padding: 14px 18px;
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#vf-chat-header img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 4px;
  flex-shrink: 0;
}

#vf-chat-header-name {
  display: flex;
  align-items: center;
  gap: 6px;
}

#vf-chat-header-name::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
  flex-shrink: 0;
}

#vf-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #FAFBFF;
}

#vf-chat-messages::-webkit-scrollbar {
  width: 6px;
}

#vf-chat-messages::-webkit-scrollbar-thumb {
  background: var(--vf-border);
  border-radius: 3px;
}

.vf-msg {
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 82%;
  word-wrap: break-word;
  animation: vf-fade-in 0.15s ease;
}

@keyframes vf-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.vf-msg-bot {
  background: var(--vf-bg-soft);
  color: var(--vf-ink);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.vf-msg-user {
  background: linear-gradient(135deg, var(--vf-primary), var(--vf-primary-light));
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.vf-msg-typing {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
}

.vf-msg-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--vf-muted);
  opacity: 0.5;
  animation: vf-typing-bounce 1.1s infinite ease-in-out;
}

.vf-msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.vf-msg-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes vf-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 0.9; }
}

#vf-chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--vf-border);
  background: #fff;
}

#vf-chat-input {
  flex: 1;
  border: 1px solid var(--vf-border);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.15s ease;
}

#vf-chat-input:focus {
  border-color: var(--vf-primary);
}

#vf-chat-send {
  border: none;
  background: linear-gradient(135deg, var(--vf-primary), var(--vf-primary-light));
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
  transition: transform 0.15s ease;
}

#vf-chat-send:hover {
  transform: scale(1.06);
}

body.has-cookie-banner #vf-chat-bubble {
  bottom: calc(32px + var(--cookie-banner-offset, 70px));
}

body.has-cookie-banner #vf-chat-panel {
  bottom: calc(104px + var(--cookie-banner-offset, 70px));
}

@media (max-width: 420px) {
  #vf-chat-panel {
    width: calc(100vw - 64px);
    right: 32px;
  }
  #vf-chat-bubble {
    right: 32px;
  }
}
