/* ===== Vapi Voice Agent Widget ===== */

/* Safety net: never show the vendor SDK's own default button — this
   plugin renders 100% custom UI, driven by the same call engine. */
.vapi-btn { display: none !important; }

/* Hardened icon visibility — some themes/plugins apply global resets
   (e.g. "button { color: transparent }" or "svg { display: none }")
   that would otherwise make our currentColor-based icons invisible. */
#vva-root svg,
.vva-modal-overlay svg {
	display: inline-block !important;
	visibility: visible !important;
	opacity: 1 !important;
	vertical-align: middle !important;
	flex-shrink: 0 !important;
}
#vva-root button svg path {
	fill: currentColor !important;
}
#vva-root .vva-trigger,
#vva-root .vva-header-btn,
#vva-root .vva-icon-btn,
#vva-root .vva-call-btn,
#vva-root .vva-icon-btn-sm,
#vva-root .vva-send-btn {
	color: #ffffff !important;
}
#vva-root .vva-icon-btn { color: #cbd5e1 !important; }
#vva-root .vva-icon-btn-sm { color: #94a3b8 !important; }

#vva-root .vva-trigger,
#vva-root .vva-header-btn,
#vva-root .vva-icon-btn,
#vva-root .vva-call-btn,
#vva-root .vva-icon-btn-sm,
#vva-root .vva-send-btn {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
}
#vva-root .vva-trigger svg,
#vva-root .vva-call-btn svg { width: 26px !important; height: 26px !important; }
#vva-root .vva-header-btn svg,
#vva-root .vva-icon-btn svg,
#vva-root .vva-icon-btn-sm svg,
#vva-root .vva-send-btn svg { width: 18px !important; height: 18px !important; }

#vva-root {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Floating trigger button ---- */
.vva-trigger {
	position: fixed !important;
	bottom: 24px !important;
	z-index: 999999 !important;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--vva-primary, #2563eb), var(--vva-accent, #7c3aed));
	color: #fff;
	box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	overflow: hidden;
	padding: 0;
}
.vva-pos-bottom-right .vva-trigger { right: 24px !important; left: auto !important; }
.vva-pos-bottom-left .vva-trigger  { left: 24px !important; right: auto !important; }
.vva-trigger:hover { transform: scale(1.06); box-shadow: 0 10px 28px rgba(37, 99, 235, 0.55); }
.vva-trigger:active { transform: scale(0.97); }
.vva-trigger-logo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.vva-panel-open .vva-trigger { display: none; }

/* ---- Panel shell ---- */
.vva-panel {
	position: fixed !important;
	bottom: 100px !important;
	z-index: 999999 !important;
	width: 400px;
	max-width: calc(100vw - 32px);
	height: 480px;
	max-height: calc(100vh - 140px);
	background: #0c0f1a;
	border-radius: 22px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	opacity: 0;
	transform: translateY(16px) scale(0.97);
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
}
.vva-pos-bottom-right .vva-panel { right: 24px !important; left: auto !important; }
.vva-pos-bottom-left .vva-panel  { left: 24px !important; right: auto !important; }
.vva-panel.vva-show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* ---- Header ---- */
.vva-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	background: linear-gradient(120deg, var(--vva-primary, #2563eb), var(--vva-accent, #7c3aed));
	flex-shrink: 0;
}
.vva-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vva-logo { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; background: rgba(255,255,255,0.15); }
.vva-logo-img { width: 100%; height: 100%; object-fit: cover; }
.vva-logo-fallback { font-size: 16px; }
.vva-header-title { color: #fff; font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vva-header-btn {
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: #fff;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.15s ease;
}
.vva-header-btn:hover { background: rgba(255, 255, 255, 0.28); }

/* ---- Body (shared) ---- */
.vva-body {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	padding: 16px 20px;
	overflow-y: auto;
	scrollbar-width: none;      /* Firefox */
	-ms-overflow-style: none;   /* old Edge/IE */
}
.vva-body::-webkit-scrollbar { display: none; } /* Chrome/Safari */

/* ---- Voice mode ---- */
#vva-body-voice { align-items: center; justify-content: flex-start; text-align: center; }
.vva-voice-status { color: #f1f5f9; font-size: 17px; font-weight: 600; margin: 4px 0 18px; }
.vva-voice-sub { color: #94a3b8; font-size: 13.5px; margin: 18px 0 0; min-height: 18px; }

.vva-orb-wrap { display: flex; align-items: center; justify-content: center; padding: 2px; }
.vva-orb {
	width: 90px;
	height: 90px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #a5b4fc, #6366f1 40%, #7c3aed 72%, #1e1b4b 100%);
	box-shadow: 0 0 50px rgba(99, 102, 241, 0.5), inset 0 0 30px rgba(255, 255, 255, 0.12);
	animation: vva-orb-idle 3.2s ease-in-out infinite;
}
@keyframes vva-orb-idle { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }

.vva-orb-connecting { animation: vva-orb-connecting 1s linear infinite; }
@keyframes vva-orb-connecting {
	0% { transform: scale(0.96) rotate(0deg); }
	50% { transform: scale(1.02) rotate(180deg); }
	100% { transform: scale(0.96) rotate(360deg); }
}

.vva-orb-active { animation: vva-orb-idle 2.4s ease-in-out infinite; }
.vva-orb-speaking {
	animation: vva-orb-speaking 0.9s ease-in-out infinite !important;
	box-shadow: 0 0 80px rgba(124, 58, 237, 0.75), inset 0 0 30px rgba(255, 255, 255, 0.18) !important;
}
@keyframes vva-orb-speaking { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }

.vva-transcript-wrap { width: 100%; margin-top: auto; }
.vva-transcript-bubble {
	background: #1a1f2e;
	color: #e2e8f0;
	border-radius: 14px;
	padding: 12px 16px;
	font-size: 14px;
	line-height: 1.5;
	text-align: left;
	max-width: 100%;
}

.vva-clinic-info {
	color: #94a3b8;
	font-size: 13px;
	line-height: 1.7;
	margin: 4px 0 8px;
}
.vva-clinic-info p { margin: 0; }
.vva-clinic-info p:first-child { color: #cbd5e1; font-weight: 600; font-size: 14px; margin-bottom: 2px; }

/* ---- Text mode ---- */
.vva-body-text { padding-top: 18px; }
.vva-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; flex-shrink: 0; }
.vva-chip {
	background: #171b2b;
	border: 1px solid #2a3149;
	color: #cbd5e1;
	border-radius: 999px;
	padding: 8px 14px;
	font-size: 12.5px;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
	white-space: nowrap;
}
.vva-chip:hover { background: #1f2438; border-color: var(--vva-primary, #2563eb); }

.vva-messages { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.vva-messages-divider { display: flex; align-items: center; gap: 10px; color: #64748b; font-size: 11.5px; margin: 4px 0 8px; }
.vva-messages-divider::before, .vva-messages-divider::after { content: ""; flex: 1; height: 1px; background: #262b3d; }

.vva-bubble { max-width: 85%; padding: 12px 15px; border-radius: 14px; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.vva-bubble-user { align-self: flex-end; background: #1a1f2e; color: #e2e8f0; border-bottom-right-radius: 4px; }
.vva-bubble-assistant { align-self: flex-start; background: linear-gradient(135deg, var(--vva-primary, #2563eb), var(--vva-accent, #7c3aed)); color: #fff; border-bottom-left-radius: 4px; }

/* ---- Footers ---- */
.vva-footer {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 24px 22px;
	gap: 14px;
}
.vva-icon-btn {
	background: #171b2b;
	border: 1px solid #2a3149;
	color: #cbd5e1;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.15s ease;
	flex-shrink: 0;
}
.vva-icon-btn:hover { background: #1f2438; }
.vva-icon-btn-spacer { width: 44px; height: 44px; flex-shrink: 0; }

.vva-call-btn {
	width: 68px;
	height: 68px;
	border-radius: 50%;
	border: 4px solid rgba(255, 255, 255, 0.08);
	background: linear-gradient(135deg, var(--vva-primary, #2563eb), var(--vva-accent, #7c3aed));
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
	transition: transform 0.15s ease;
	flex-shrink: 0;
}
.vva-call-btn:hover { transform: scale(1.05); }
.vva-call-btn.vva-call-active-btn { background: linear-gradient(135deg, #dc2626, #b91c1c); box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.2); }

.vva-footer-text { padding: 10px 16px 18px; flex-direction: column; align-items: stretch; gap: 8px; }

.vva-call-status-bar {
	display: none;
	align-items: center;
	gap: 8px;
	background: rgba(220, 38, 38, 0.12);
	border: 1px solid rgba(220, 38, 38, 0.35);
	border-radius: 12px;
	padding: 8px 10px 8px 12px;
	font-size: 12.5px;
	color: #fca5a5;
}
.vva-call-status-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #ef4444;
	flex-shrink: 0;
	animation: vva-status-pulse 1.4s ease-in-out infinite;
}
@keyframes vva-status-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
#vva-call-status-text { flex: 1; }
.vva-text-end-btn {
	display: flex;
	align-items: center;
	gap: 5px;
	background: #dc2626;
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 6px 10px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	flex-shrink: 0;
}
.vva-text-end-btn:hover { background: #b91c1c; }
.vva-input-row {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #12162350;
	border: 1px solid #2a3149;
	border-radius: 14px;
	padding: 6px 8px 6px 14px;
	width: 100%;
}
.vva-text-input {
	flex: 1;
	background: transparent;
	border: none;
	outline: none;
	color: #e2e8f0;
	font-size: 14px;
	padding: 8px 0;
	min-width: 0;
}
.vva-text-input::placeholder { color: #64748b; }
.vva-icon-btn-sm {
	background: #1a1f2e;
	border: 1px solid #2a3149;
	color: #94a3b8;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
}
.vva-send-btn {
	background: linear-gradient(135deg, var(--vva-primary, #2563eb), var(--vva-accent, #7c3aed));
	border: none;
	color: #fff;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
}
.vva-send-btn:hover { opacity: 0.9; }

/* ---- Inline shortcode trigger ---- */
.vva-inline-trigger {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	background: linear-gradient(135deg, var(--vva-primary, #2563eb), var(--vva-accent, #7c3aed));
	color: #fff;
	border: none;
	border-radius: 12px;
	padding: 13px 26px;
	font-size: 14.5px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.15s ease, opacity 0.15s ease;
}
.vva-inline-trigger:hover { transform: translateY(-1px); opacity: 0.94; }

/* ---- Consent modal ---- */
.vva-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(5, 8, 16, 0.65);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000000;
	padding: 20px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}
.vva-modal-overlay.vva-show { opacity: 1; pointer-events: auto; }
.vva-modal {
	background: #12162a;
	border: 1px solid #262b3d;
	border-radius: 18px;
	max-width: 400px;
	width: 100%;
	padding: 26px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	transform: translateY(12px) scale(0.98);
	transition: transform 0.25s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.vva-modal-overlay.vva-show .vva-modal { transform: translateY(0) scale(1); }
.vva-modal-title { font-size: 18px; font-weight: 700; color: #f1f5f9; margin: 0 0 10px; }
.vva-modal-text { font-size: 13.5px; line-height: 1.6; color: #94a3b8; margin: 0 0 8px; }
.vva-modal-privacy-link { font-size: 13px; }
.vva-modal-privacy-link a { color: var(--vva-primary, #2563eb); }
.vva-modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.vva-modal-actions .vva-btn-cancel { flex: 1; background: #1a1f2e; color: #cbd5e1; border: 1px solid #2a3149; border-radius: 10px; padding: 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.vva-modal-actions .vva-btn-accept { flex: 1.4; background: linear-gradient(135deg, var(--vva-primary, #2563eb), var(--vva-accent, #7c3aed)); color: #fff; border: none; border-radius: 10px; padding: 12px; font-size: 14px; font-weight: 700; cursor: pointer; }
.vva-modal-actions button:hover { opacity: 0.92; }

/* ---- Responsive: mobile ---- */
@media (max-width: 640px) {
	.vva-panel {
		position: fixed !important;
		width: calc(100vw - 24px) !important;
		max-width: 400px !important;
		height: 480px !important;
		max-height: calc(100vh - 100px) !important;
		bottom: 88px !important;
		border-radius: 22px;
	}
	.vva-pos-bottom-right .vva-panel { right: 12px !important; left: auto !important; }
	.vva-pos-bottom-left .vva-panel  { left: 12px !important; right: auto !important; }

	.vva-trigger { bottom: 20px !important; width: 58px; height: 58px; }
	.vva-pos-bottom-right .vva-trigger { right: 20px !important; }
	.vva-pos-bottom-left .vva-trigger  { left: 20px !important; }
	.vva-orb { width: 100px; height: 100px; }
	.vva-modal { max-width: 100%; }
}

@media (max-width: 420px) {
	.vva-panel { height: 440px !important; }
	.vva-orb { width: 90px; height: 90px; }
}
