/**
 * UniteElements WhatsApp Senior Engineering Desk Stylesheet (Brand White & AI Synthesis Studio)
 *
 * High-tech glassmorphic floating launcher, brand white conversational modal,
 * Space Grotesk typography, typing indicator, intent chips, and AI Message Synthesis Terminal.
 *
 * @package UniteElements_Theme
 * @author Jyotirmay Ray <https://jyotirmayray.in/>
 */

/* ==========================================================================
   1. Floating Wrapper & Placement
   ========================================================================== */
.ue-wa-wrapper {
	position: fixed;
	bottom: 28px;
	right: 28px;
	z-index: 99999;
	font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   2. Floating Tooltip Prompt Bubble (Brand White & Soft Blue)
   ========================================================================== */
.ue-wa-prompt {
	position: absolute;
	bottom: 76px;
	right: 0;
	background: #FFFFFF;
	background: linear-gradient(145deg, #FFFFFF 0%, #F8FAFC 100%);
	border: 1px solid rgba(43, 93, 245, 0.22);
	border-radius: 16px;
	padding: 12px 16px;
	box-shadow: 0 16px 36px -8px rgba(43, 93, 245, 0.18), 0 0 0 1px rgba(43, 93, 245, 0.06);
	min-width: 270px;
	max-width: 330px;
	opacity: 0;
	transform: translateY(12px) scale(0.95);
	pointer-events: none;
	transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ue-wa-prompt.is-active {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.ue-wa-prompt-inner {
	display: flex;
	align-items: center;
	gap: 12px;
	position: relative;
}

.ue-wa-prompt-avatar {
	position: relative;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ue-wa-prompt-avatar img,
.ue-wa-prompt-avatar .ue-wa-avatar-vector {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	box-shadow: 0 2px 8px rgba(43, 93, 245, 0.15);
}

.ue-wa-live-dot {
	position: absolute;
	bottom: -1px;
	right: -1px;
	width: 10px;
	height: 10px;
	background: #10B981;
	border: 2px solid #FFFFFF;
	border-radius: 50%;
	box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
	animation: uePulseDot 2s infinite;
}

@keyframes uePulseDot {
	0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
	70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
	100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.ue-wa-prompt-text {
	flex: 1;
}

.ue-wa-prompt-title {
	display: block;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 13.5px;
	font-weight: 700;
	color: #0F172A;
	line-height: 1.2;
}

.ue-wa-prompt-msg {
	margin: 3px 0 0 0;
	font-size: 11.5px;
	font-weight: 500;
	color: #64748B;
	line-height: 1.3;
}

.ue-wa-prompt-close {
	background: transparent;
	border: none;
	color: #94A3B8;
	font-size: 18px;
	cursor: pointer;
	padding: 0 4px;
	line-height: 1;
	transition: color 0.2s;
}

.ue-wa-prompt-close:hover {
	color: #0F172A;
}

/* ==========================================================================
   3. Floating Action Launcher Button
   ========================================================================== */
.ue-wa-launcher {
	position: relative;
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
	border: 2px solid rgba(255, 255, 255, 0.8);
	cursor: pointer;
	box-shadow: 0 10px 28px rgba(37, 211, 102, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.08);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	outline: none;
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.ue-wa-launcher:hover {
	transform: scale(1.08);
	box-shadow: 0 14px 34px rgba(37, 211, 102, 0.6), 0 0 0 3px rgba(43, 93, 245, 0.2);
}

.ue-wa-launcher:active {
	transform: scale(0.95);
}

.ue-wa-launcher-glow {
	position: absolute;
	inset: -5px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(37, 211, 102, 0.45) 0%, transparent 70%);
	animation: uePulseGlow 2.5s infinite;
	pointer-events: none;
}

@keyframes uePulseGlow {
	0% { transform: scale(1); opacity: 0.8; }
	50% { transform: scale(1.25); opacity: 0.25; }
	100% { transform: scale(1); opacity: 0.8; }
}

.ue-wa-launcher-icon {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ue-wa-badge-unread {
	position: absolute;
	top: -3px;
	right: -3px;
	background: #EF4444;
	color: #FFFFFF;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 11px;
	font-weight: 800;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #FFFFFF;
	box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
	z-index: 3;
	animation: ueBadgeBounce 1.5s ease infinite;
}

@keyframes ueBadgeBounce {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-3px); }
}

/* ==========================================================================
   4. Conversational Chat Modal Matrix (Brand White & AI Aesthetics)
   ========================================================================== */
.ue-wa-modal {
	position: absolute;
	bottom: 78px;
	right: 0;
	width: 410px;
	max-width: calc(100vw - 32px);
	background: #FFFFFF;
	background: radial-gradient(circle at 100% 0%, rgba(43, 93, 245, 0.05) 0%, transparent 50%), radial-gradient(circle at 0% 100%, rgba(16, 185, 129, 0.04) 0%, transparent 50%), #FFFFFF;
	border: 1px solid rgba(226, 232, 240, 0.95);
	border-radius: 22px;
	box-shadow: 0 28px 70px -12px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(43, 93, 245, 0.08);
	display: none;
	opacity: 0;
	transform: translateY(18px) scale(0.96);
	transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	overflow: hidden;
	z-index: 99999;
}

.ue-wa-modal::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: linear-gradient(90deg, #2B5DF5 0%, #10B981 50%, #2B5DF5 100%);
	z-index: 10;
}

.ue-wa-modal.is-open {
	display: block;
	opacity: 1;
	transform: translateY(0) scale(1);
}

.ue-wa-card {
	display: flex;
	flex-direction: column;
	max-height: 610px;
}

/* 4A. Header */
.ue-wa-header {
	background: #FFFFFF;
	border-bottom: 1px solid #E2E8F0;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.ue-wa-agent-info {
	display: flex;
	align-items: center;
	gap: 12px;
}

.ue-wa-avatar-wrap {
	position: relative;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ue-wa-avatar-wrap img,
.ue-wa-avatar-wrap .ue-wa-avatar-vector {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	box-shadow: 0 4px 14px rgba(43, 93, 245, 0.16);
	border: 2px solid #EFF4FF;
}

.ue-wa-status-indicator {
	position: absolute;
	bottom: -1px;
	right: -1px;
	width: 11px;
	height: 11px;
	background: #10B981;
	border: 2px solid #FFFFFF;
	border-radius: 50%;
	box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.ue-wa-agent-title {
	font-family: 'Space Grotesk', sans-serif;
	font-size: 15px;
	font-weight: 700;
	color: #0F172A;
	display: flex;
	align-items: center;
	gap: 6px;
	letter-spacing: -0.01em;
}

.ue-wa-verified {
	color: #2B5DF5;
	font-size: 11px;
	font-weight: 800;
	background: #EFF4FF;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(43, 93, 245, 0.2);
}

.ue-wa-agent-sub {
	font-family: 'Space Grotesk', sans-serif;
	font-size: 11.5px;
	font-weight: 500;
	color: #64748B;
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 3px;
}

.ue-wa-pulse-dot {
	width: 6px;
	height: 6px;
	background: #10B981;
	border-radius: 50%;
	display: inline-block;
	box-shadow: 0 0 6px #10B981;
}

.ue-wa-close-btn {
	background: #F1F5F9;
	border: 1px solid #E2E8F0;
	border-radius: 8px;
	color: #64748B;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s;
}

.ue-wa-close-btn:hover {
	background: #E2E8F0;
	color: #0F172A;
	transform: rotate(90deg);
}

/* 4B. Chat Stream Body (Home Hero Section Style Canvas) */
.ue-wa-body {
	padding: 18px;
	overflow-y: auto;
	max-height: 420px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	background: #F8FAFC;
	background-image: radial-gradient(#E2E8F0 1.2px, transparent 1.2px);
	background-size: 18px 18px;
}

.ue-wa-msg-bot {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.ue-wa-bubble {
	background: #FFFFFF;
	border: 1px solid rgba(43, 93, 245, 0.18);
	border-radius: 16px 16px 16px 4px;
	padding: 14px 16px;
	color: #1E293B;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 13.5px;
	line-height: 1.55;
	position: relative;
	box-shadow: 0 4px 16px rgba(43, 93, 245, 0.06);
}

.ue-wa-bubble p {
	margin: 0;
	color: #1E293B;
	font-size: 13.5px;
}

.ue-wa-bubble strong {
	color: #0F172A;
	font-weight: 700;
}

.ue-wa-time {
	display: block;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 10px;
	color: #94A3B8;
	text-align: right;
	margin-top: 6px;
	font-weight: 600;
}

/* 4C. Intent Chips (Brand White Cards) */
.ue-wa-intent-grid {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ue-wa-step-label {
	font-family: 'Space Grotesk', sans-serif;
	font-size: 11px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #64748B;
}

.ue-wa-chips {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ue-wa-chip {
	background: #FFFFFF;
	border: 1px solid #E2E8F0;
	border-radius: 12px;
	padding: 12px 14px;
	color: #0F172A;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 13px;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.ue-wa-chip::after {
	content: "→";
	color: #94A3B8;
	font-weight: 700;
	transition: transform 0.2s, color 0.2s;
}

.ue-wa-chip:hover {
	background: #EFF4FF;
	border-color: #2B5DF5;
	color: #2B5DF5;
	transform: translateX(4px);
	box-shadow: 0 6px 18px rgba(43, 93, 245, 0.12);
}

.ue-wa-chip:hover::after {
	color: #2B5DF5;
	transform: translateX(3px);
}

.ue-wa-chip.is-active {
	background: linear-gradient(135deg, #2B5DF5 0%, #1D44DB 100%);
	border-color: #1D44DB;
	color: #FFFFFF;
	box-shadow: 0 6px 20px rgba(43, 93, 245, 0.25);
}

.ue-wa-chip.is-active::after {
	color: #FFFFFF;
}

/* 4D. Typing Indicator */
.ue-wa-typing-indicator {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 8px 12px;
	background: #FFFFFF;
	border: 1px solid rgba(43, 93, 245, 0.2);
	border-radius: 12px;
	width: fit-content;
	margin-bottom: 4px;
	box-shadow: 0 2px 8px rgba(43, 93, 245, 0.08);
}

.ue-wa-typing-indicator span {
	width: 6px;
	height: 6px;
	background: #2B5DF5;
	border-radius: 50%;
	animation: ueTyping 1.4s infinite ease-in-out;
}

.ue-wa-typing-indicator span:nth-child(1) { animation-delay: 0s; }
.ue-wa-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.ue-wa-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ueTyping {
	0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
	40% { transform: scale(1.1); opacity: 1; }
}

/* 4E. Step 2 Inputs & Dynamic Budgets */
.ue-wa-form-step {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.ue-wa-label {
	display: block;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 11px;
	font-weight: 700;
	color: #475569;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 6px;
}

.ue-wa-budget-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ue-wa-budget-btn {
	background: #FFFFFF;
	border: 1px solid #CBD5E1;
	border-radius: 8px;
	padding: 7px 12px;
	color: #334155;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 11.5px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.ue-wa-budget-btn:hover {
	border-color: #2B5DF5;
	color: #2B5DF5;
	background: #EFF4FF;
}

.ue-wa-budget-btn.is-active {
	background: linear-gradient(135deg, #2B5DF5 0%, #1D44DB 100%);
	border-color: #1D44DB;
	color: #FFFFFF;
	box-shadow: 0 4px 12px rgba(43, 93, 245, 0.25);
}

.ue-wa-input,
.ue-wa-textarea {
	width: 100%;
	background: #FFFFFF;
	border: 1px solid #CBD5E1;
	border-radius: 10px;
	padding: 10px 14px;
	color: #0F172A;
	font-size: 13.5px;
	font-family: 'Space Grotesk', -apple-system, sans-serif;
	font-weight: 500;
	box-sizing: border-box;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.ue-wa-input:focus,
.ue-wa-textarea:focus {
	background: #FFFFFF;
	border-color: #2B5DF5;
	box-shadow: 0 0 0 3px rgba(43, 93, 245, 0.15);
}

.ue-wa-input::placeholder,
.ue-wa-textarea::placeholder {
	color: #94A3B8;
	font-weight: 400;
}

/* ==========================================================================
   4F. Intelligent AI Prompt & WhatsApp Message Preview Studio
   ========================================================================== */
.ue-wa-ai-preview-card {
	background: #FFFFFF;
	border: 1px solid rgba(43, 93, 245, 0.25);
	border-radius: 14px;
	box-shadow: 0 8px 24px -6px rgba(43, 93, 245, 0.12);
	overflow: hidden;
	margin-top: 4px;
}

.ue-wa-ai-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 9px 13px;
	background: linear-gradient(135deg, #EFF4FF 0%, #F8FAFC 100%);
	border-bottom: 1px solid rgba(43, 93, 245, 0.15);
}

.ue-wa-ai-badge {
	display: flex;
	align-items: center;
	gap: 6px;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 11px;
	font-weight: 800;
	color: #2B5DF5;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.ue-wa-ai-icon {
	font-size: 12px;
}

.ue-wa-live-sync-dot {
	width: 6px;
	height: 6px;
	background: #10B981;
	border-radius: 50%;
	box-shadow: 0 0 6px #10B981;
	animation: uePulseDot 1.5s infinite;
}

.ue-wa-copy-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 11px;
	font-weight: 700;
	color: #2B5DF5;
	background: #FFFFFF;
	border: 1px solid rgba(43, 93, 245, 0.25);
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 1px 3px rgba(43, 93, 245, 0.08);
}

.ue-wa-copy-btn:hover {
	background: #2B5DF5;
	color: #FFFFFF;
	border-color: #2B5DF5;
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(43, 93, 245, 0.25);
}

.ue-wa-copy-btn.is-copied {
	background: #10B981;
	color: #FFFFFF;
	border-color: #10B981;
}

.ue-wa-terminal-window {
	background: #0B1120;
	padding: 10px 14px 12px;
	border-radius: 0 0 13px 13px;
}

.ue-wa-terminal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 7px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	margin-bottom: 8px;
}

.ue-wa-dots {
	display: flex;
	gap: 5px;
}

.ue-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.ue-dot-red { background: #EF4444; }
.ue-dot-yellow { background: #F59E0B; }
.ue-dot-green { background: #10B981; }

.ue-terminal-title {
	font-family: 'Space Grotesk', sans-serif;
	font-size: 10px;
	font-weight: 600;
	color: #94A3B8;
	letter-spacing: 0.03em;
}

.ue-wa-preview-text {
	font-family: ui-monospace, 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;
	font-size: 11.5px;
	color: #38BDF8;
	margin: 0;
	white-space: pre-wrap;
	line-height: 1.5;
	max-height: 110px;
	overflow-y: auto;
}

/* Custom Scrollbar for Preview */
.ue-wa-preview-text::-webkit-scrollbar {
	width: 4px;
}
.ue-wa-preview-text::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.05);
}
.ue-wa-preview-text::-webkit-scrollbar-thumb {
	background: rgba(56, 189, 248, 0.3);
	border-radius: 4px;
}

/* ==========================================================================
   4G. Footer Actions (Brand White Foundation)
   ========================================================================== */
.ue-wa-footer {
	background: #FFFFFF;
	border-top: 1px solid #E2E8F0;
	padding: 14px 18px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ue-wa-btn-fast {
	width: 100%;
	background: linear-gradient(135deg, #2B5DF5 0%, #1D44DB 100%);
	border: 1px solid #1D44DB;
	border-radius: 11px;
	padding: 12px 14px;
	color: #FFFFFF;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 13.5px;
	font-weight: 800;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-shadow: 0 6px 20px rgba(43, 93, 245, 0.35);
}

.ue-wa-btn-fast:hover {
	background: linear-gradient(135deg, #1D44DB 0%, #1738B5 100%);
	transform: translateY(-1px);
	box-shadow: 0 10px 24px rgba(43, 93, 245, 0.5);
}

.ue-wa-btn-back {
	background: #F1F5F9;
	border: 1px solid #CBD5E1;
	border-radius: 11px;
	padding: 11px 16px;
	color: #475569;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s;
}

.ue-wa-btn-back:hover {
	background: #E2E8F0;
	color: #0F172A;
}

.ue-wa-btn-submit {
	flex: 1;
	background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 11px;
	padding: 12px 18px;
	color: #FFFFFF !important;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 13.5px;
	font-weight: 800;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.ue-wa-btn-submit:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 26px rgba(37, 211, 102, 0.55);
}

.ue-wa-secure-badge {
	text-align: center;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 10.5px;
	color: #64748B;
	font-weight: 600;
}

/* ==========================================================================
   5. Mobile Responsive Optimization
   ========================================================================== */
@media (max-width: 640px) {
	.ue-wa-wrapper {
		bottom: 18px;
		right: 18px;
	}

	/* Elevate floating launcher when sticky mobile action docks are present */
	.single-product .ue-wa-wrapper,
	.post-type-archive-uniteelements_offer .ue-wa-wrapper,
	.page-template-page-bundles .ue-wa-wrapper,
	body:has(#uniteelements-bottom-dock, .uniteelements-offers-mobile-dock, #uniteelements-catalog-mobile-dock) .ue-wa-wrapper {
		bottom: 86px;
	}

	.ue-wa-prompt {
		min-width: 220px;
		max-width: calc(100vw - 40px);
		bottom: 74px;
	}

	.ue-wa-modal {
		position: fixed;
		bottom: 0;
		right: 0;
		left: 0;
		width: 100vw;
		max-width: 100vw;
		border-radius: 24px 24px 0 0;
		max-height: 88vh;
		z-index: 100000;
	}

	.ue-wa-card {
		max-height: 88vh;
	}

	.ue-wa-body {
		max-height: calc(88vh - 190px);
	}
}
