/* Voicemodly AI Support Chat Widget Styles */

.vm-support-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #0f172a;
}

/* Floating Launcher Button */
.vm-support-launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.vm-support-launcher:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.vm-support-launcher:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

.vm-support-icon {
  flex-shrink: 0;
}

.vm-support-launcher-label {
  white-space: nowrap;
}

/* Chat Panel Drawer / Sheet */
.vm-support-panel {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 100px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100000;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.vm-support-panel[hidden] {
  display: none !important;
}

/* Header */
.vm-support-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.vm-support-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vm-support-badge {
  background: #dbeafe;
  color: #1e40af;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.vm-support-title {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  color: #0f172a;
}

.vm-support-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vm-support-header-btn {
  background: transparent;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.vm-support-header-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.vm-support-close {
  background: transparent;
  border: none;
  color: #64748b;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.vm-support-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Messages Area */
.vm-support-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

/* Welcome Card */
.vm-support-welcome {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 4px;
}

.vm-support-welcome-text p {
  margin: 0 0 12px 0;
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
}

.vm-support-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vm-support-quick-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #2563eb;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.vm-support-quick-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  transform: translateY(-1px);
}

/* Chat Bubbles */
.vm-support-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  box-sizing: border-box;
}

.vm-support-bubble-user {
  align-self: flex-end;
  background: #2563eb;
  color: #ffffff;
  border-bottom-right-radius: 4px;
  max-width: 85%;
}

.vm-support-bubble-assistant {
  align-self: flex-start;
  background: #f1f5f9;
  color: #0f172a;
  border-bottom-left-radius: 4px;
  max-width: 88%;
}

.vm-support-bubble-operator {
  align-self: flex-start;
  background: #ecfdf5;
  color: #064e3b;
  border: 1px solid #a7f3d0;
  border-bottom-left-radius: 4px;
  max-width: 88%;
}
.vm-support-bubble-error {
  align-self: center;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  width: 100%;
  text-align: center;
  font-size: 13px;
}

.vm-support-retry-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.vm-support-retry-btn {
  background: #ffffff;
  border: 1px solid #fca5a5;
  color: #dc2626;
  border-radius: 12px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.vm-support-retry-btn:hover {
  background: #fee2e2;
}

/* Typing / Generating Indicator */
.vm-support-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
}

.vm-support-dot {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: vm-pulse 1.2s infinite ease-in-out;
}

.vm-support-dot:nth-child(2) { animation-delay: 0.2s; }
.vm-support-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes vm-pulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* Handoff Banner */
.vm-support-handoff-banner {
  background: #eff6ff;
  border-top: 1px solid #bfdbfe;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vm-support-handoff-msg {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #1e40af;
}

.vm-support-handoff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#vm-support-handoff-status {
  flex-basis: 100%;
}

.vm-support-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.vm-support-btn-primary {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #2563eb;
}

.vm-support-btn-primary:hover {
  background: #1d4ed8;
}

.vm-support-btn-secondary {
  background: #ffffff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.vm-support-btn-secondary:hover {
  background: #dbeafe;
}

.vm-support-copy-toast {
  font-size: 11px;
  color: #166534;
  font-weight: 600;
}

/* Footer / Form */
.vm-support-footer {
  padding: 12px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.vm-support-form {
  margin: 0;
}

.vm-support-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vm-support-input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  max-height: 80px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.vm-support-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.vm-support-send-btn,
.vm-support-stop-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}

.vm-support-send-btn {
  background: #2563eb;
  color: #ffffff;
}

.vm-support-send-btn:hover {
  background: #1d4ed8;
}

.vm-support-send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

.vm-support-stop-btn {
  background: #dc2626;
  color: #ffffff;
}

/* Elements whose display rules would otherwise override the [hidden] attribute */
.vm-support-send-btn[hidden],
.vm-support-stop-btn[hidden],
.vm-support-welcome[hidden],
.vm-support-handoff-banner[hidden],
.vm-support-copy-toast[hidden] {
  display: none !important;
}

/* Responsive Mobile Bottom Sheet */
@media (max-width: 640px) {
  .vm-support-widget {
    bottom: 16px;
    right: 16px;
  }

  .vm-support-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    height: 85vh;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.25);
  }
}
