/* ── Floating trigger button ── */
.vd-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #d4380d, #e8590c);
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(212, 56, 13, 0.35), 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}
.vd-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 32px rgba(212, 56, 13, 0.45), 0 4px 12px rgba(0,0,0,0.12);
}
.vd-trigger svg { width: 20px; height: 20px; }
.vd-trigger-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.vd-trigger.vd-hidden { display: none; }

/* ── Overlay ── */
.vd-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.vd-overlay.vd-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Phone modal ── */
.vd-modal {
  width: 100%;
  max-width: 380px;
  height: min(680px, calc(100dvh - 32px));
  background: #1a1a1a;
  border-radius: 32px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.3s ease;
  font-family: 'Inter', system-ui, sans-serif;
}
.vd-overlay.vd-open .vd-modal {
  transform: translateY(0) scale(1);
}

/* ── Header ── */
.vd-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  background: linear-gradient(180deg, #222 0%, #1a1a1a 100%);
}
.vd-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.vd-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vd-header-info { flex: 1; min-width: 0; }
.vd-header-name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}
.vd-header-status {
  font-size: 12px;
  color: #8b8b8b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.vd-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #52c41a;
}
.vd-close {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.vd-close:hover { background: #333; color: #fff; }
.vd-close svg { width: 20px; height: 20px; }

/* ── Chat area ── */
.vd-chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.vd-chat::-webkit-scrollbar { width: 4px; }
.vd-chat::-webkit-scrollbar-thumb { background: #444; border-radius: 2px; }

/* ── Chat bubbles ── */
.vd-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  animation: vdSlideUp 0.25s ease;
}
.vd-msg-agent {
  align-self: flex-start;
  background: #2a2a2a;
  color: #e5e5e5;
  border-bottom-left-radius: 6px;
}
.vd-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #d4380d, #e8590c);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.vd-msg-lang {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.6;
  margin-bottom: 2px;
}

/* ── Thinking dots ── */
.vd-thinking {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 18px;
  background: #2a2a2a;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
}
.vd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
  animation: vdBounce 1.2s infinite;
}
.vd-dot:nth-child(2) { animation-delay: 0.15s; }
.vd-dot:nth-child(3) { animation-delay: 0.3s; }

/* ── Controls bar ── */
.vd-controls {
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: #1a1a1a;
}
.vd-hint {
  font-size: 12px;
  color: #666;
  text-align: center;
}

.vd-mic-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: #333;
  color: #ccc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
}
.vd-mic-btn svg { width: 28px; height: 28px; }
.vd-mic-btn:hover { background: #444; color: #fff; }
.vd-mic-btn.vd-recording {
  background: #d4380d;
  color: #fff;
  animation: vdPulse 1.5s infinite;
}
.vd-mic-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  animation: none;
}

/* ── Error banner ── */
.vd-error {
  margin: 0 16px;
  padding: 8px 12px;
  background: rgba(212, 56, 13, 0.15);
  border: 1px solid rgba(212, 56, 13, 0.3);
  border-radius: 10px;
  font-size: 12px;
  color: #e8590c;
  text-align: center;
}

/* ── Animations ── */
@keyframes vdSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes vdBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}
@keyframes vdPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 56, 13, 0.4); }
  50% { box-shadow: 0 0 0 14px rgba(212, 56, 13, 0); }
}

/* ── Mobile ── */
@media (max-width: 480px) {
  .vd-trigger {
    bottom: 16px;
    right: 16px;
    padding: 12px 16px;
    font-size: 14px;
  }
  .vd-modal {
    max-width: 100%;
    height: calc(100dvh - 32px);
    border-radius: 24px;
  }
}
