/* WhatsApp Widget Base */
:root {
	--ww-primary: #25D366;
	--ww-primary-dark: #1EBE5D;
	--ww-bg: #ffffff;
	--ww-text: #333333;
	--ww-gray: #f0f2f5;
	--ww-border: #e1e8ed;
}

.ww-widget-container {
	position: fixed;
	bottom: var(--ww-offset-y, 20px);
	right: var(--ww-offset-x, 20px);
	z-index: 2147483647;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Toggle Button */
.ww-widget-container .ww-widget-toggle {
	width: 60px !important;
	height: 60px !important;
	border-radius: 50% !important;
	background-color: var(--ww-primary) !important;
	color: white !important;
	border: none !important;
	box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4) !important;
	cursor: pointer !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease !important;
	animation: wwPulse 2s infinite !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box !important;
}
.ww-widget-container .ww-widget-toggle:hover {
	transform: scale(1.1) !important;
	box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5) !important;
	animation: none !important;
}
.ww-widget-container .ww-widget-toggle svg {
	margin: 0 !important;
	padding: 0 !important;
	width: 32px !important;
	height: 32px !important;
	display: block !important;
}

@keyframes wwPulse {
	0% {
		box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
	}
	70% {
		box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
	}
}

/* Notification Badge */
/* Notification Badge */
.ww-widget-container .ww-widget-badge {
	position: absolute !important;
	bottom: 80px !important;
	right: 0 !important;
	background: #fff !important;
	border-radius: 12px !important;
	box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
	padding: 12px 16px !important;
	display: flex !important;
	align-items: flex-start !important;
	width: max-content !important;
	max-width: min(300px, calc(100vw - 40px)) !important;
	transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
	transform-origin: bottom right !important;
	z-index: 10 !important;
	box-sizing: border-box !important;
	margin: 0 !important;
	border: none !important;
}
.ww-widget-container .ww-widget-badge.ww-hidden {
	opacity: 0 !important;
	transform: translateY(20px) scale(0.9) !important;
	pointer-events: none !important;
}
.ww-widget-container .ww-badge-content {
	display: flex !important;
	align-items: center !important;
	cursor: pointer !important;
	margin: 0 !important;
	padding: 0 !important;
}
.ww-widget-container .ww-badge-avatar-wrap {
	position: relative !important;
	margin: 0 12px 0 0 !important;
	padding: 0 !important;
}
.ww-widget-container .ww-badge-avatar {
	width: 40px !important;
	height: 40px !important;
	border-radius: 50% !important;
	object-fit: cover !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	box-shadow: none !important;
	max-width: none !important;
}
.ww-widget-container .ww-badge-online {
	position: absolute !important;
	bottom: 0 !important;
	right: 0 !important;
	width: 12px !important;
	height: 12px !important;
	background-color: var(--ww-primary) !important;
	border: 2px solid #fff !important;
	border-radius: 50% !important;
	box-sizing: content-box !important;
}
.ww-widget-container .ww-badge-text {
	display: flex !important;
	flex-direction: column !important;
	margin: 0 !important;
	padding: 0 !important;
	text-align: left !important;
}
.ww-widget-container .ww-badge-title {
	font-weight: 600 !important;
	font-size: 14px !important;
	color: #333 !important;
	margin: 0 0 2px 0 !important;
	padding: 0 !important;
	line-height: 1.2 !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
	word-break: break-word !important;
	white-space: normal !important;
}
.ww-widget-container .ww-badge-desc {
	font-size: 13px !important;
	color: #666 !important;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1.3 !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
	word-break: break-word !important;
	white-space: normal !important;
}
.ww-widget-container .ww-badge-close {
	background: none !important;
	border: none !important;
	color: #999 !important;
	font-size: 18px !important;
	line-height: 1 !important;
	cursor: pointer !important;
	padding: 0 0 0 12px !important;
	margin: -4px 0 0 0 !important;
	box-shadow: none !important;
}
.ww-widget-container .ww-badge-close:hover {
	color: #333 !important;
}

/* Chat Window */
.ww-chat-window {
	position: absolute;
	bottom: 80px;
	right: 0;
	width: 350px;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-radius: 16px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
	transform-origin: bottom right;
	border: 1px solid rgba(255, 255, 255, 0.2);
}
.ww-chat-window.ww-hidden {
	opacity: 0;
	transform: scale(0.8);
	pointer-events: none;
}

/* Header */
.ww-chat-header {
	background: var(--ww-primary);
	color: white;
	padding: 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	position: relative;
}
.ww-header-logo {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	margin-right: 12px;
	border: 2px solid rgba(255, 255, 255, 0.3);
}
.ww-header-text {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
}
.ww-chat-title {
	font-weight: 600;
	font-size: 16px;
	line-height: 1.2;
}
.ww-chat-subtitle {
	font-size: 13px;
	opacity: 0.9;
	margin-top: 3px;
}
.ww-chat-close {
	background: none;
	border: none;
	color: white;
	font-size: 24px;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	opacity: 0.8;
	transition: opacity 0.2s ease;
}
.ww-chat-close:hover {
	opacity: 1;
}

/* Body */
.ww-chat-body {
	max-height: 500px;
	overflow-y: auto;
	padding: 0;
	background-color: var(--ww-gray);
}

/* FAQ Accordion */
.ww-faqs-container {
	background: white;
}
.ww-faq-item {
	border-bottom: 1px solid var(--ww-border);
}
.ww-faq-question {
	padding: 15px 20px;
	cursor: pointer;
	font-weight: 500;
	font-size: 14px;
	color: var(--ww-text);
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: background-color 0.2s ease;
}
.ww-faq-question:hover {
	background-color: #fafafa;
}
.ww-faq-question::after {
	content: '+';
	font-size: 18px;
	color: #999;
	transition: transform 0.3s ease;
}
.ww-faq-item.active .ww-faq-question::after {
	transform: rotate(45deg);
}
.ww-faq-answer {
	padding: 0 20px;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease, padding 0.3s ease;
	font-size: 13px;
	color: #666;
	line-height: 1.5;
}
.ww-faq-item.active .ww-faq-answer {
	padding: 0 20px 15px;
	max-height: 500px; /* arbitrary max height for animation */
}

/* Agents */
.ww-agents-container {
	padding: 15px;
}
.ww-agent-card {
	background: white;
	border-radius: 12px;
	padding: 15px;
	display: flex;
	align-items: center;
	margin-bottom: 10px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.04);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	text-decoration: none;
	color: inherit;
}
.ww-agent-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.ww-agent-avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
	margin-right: 15px;
	border: 2px solid var(--ww-primary);
	padding: 2px;
}
.ww-agent-info {
	flex-grow: 1;
}
.ww-agent-name {
	font-weight: 600;
	font-size: 15px;
	color: var(--ww-text);
	margin-bottom: 3px;
}
.ww-agent-title {
	font-size: 12px;
	color: #888;
}
.ww-agent-icon {
	color: var(--ww-primary);
	background: #e8f9ef;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* WC Button */
.ww-wc-button {
	background-color: var(--ww-primary) !important;
	color: white !important;
	border: none !important;
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	margin: 20px 0 !important;
	padding: 8px 15px !important;
	border-radius: 8px !important;
	text-decoration: none !important;
	box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3) !important;
	transition: all 0.3s ease !important;
	width: 100% !important;
	max-width: 350px !important;
	box-sizing: border-box !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}
.ww-wc-button:hover {
	background-color: var(--ww-primary-dark) !important;
	transform: translateY(-2px) !important;
	box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4) !important;
}
.ww-wc-button-avatar {
	width: 36px !important;
	height: 36px !important;
	border-radius: 50% !important;
	object-fit: cover !important;
	border: 2px solid white !important;
	margin: 0 12px 0 0 !important;
	padding: 0 !important;
	background: white !important;
	box-shadow: none !important;
	max-width: none !important;
}
.ww-wc-button-text-group {
	flex-grow: 1 !important;
	display: flex !important;
	flex-direction: column !important;
	text-align: left !important;
	margin: 0 !important;
	padding: 0 !important;
}
.ww-wc-button-title {
	font-weight: 600 !important;
	font-size: 15px !important;
	line-height: 1.2 !important;
	margin: 0 !important;
	padding: 0 !important;
	color: white !important;
}
.ww-wc-button-subtitle {
	font-size: 11px !important;
	opacity: 0.9 !important;
	margin: 0 !important;
	padding: 0 !important;
	color: white !important;
}
.ww-wc-button-icon {
	margin: 0 0 0 10px !important;
	animation: wwPulse 2s infinite !important;
	border-radius: 50% !important;
	width: 24px !important;
	height: 24px !important;
	display: block !important;
}

/* --- THEMES --- */
/* Dark Theme */
.ww-theme-dark .ww-chat-window {
	background: #222;
	color: #eee;
	border-color: #333;
}
.ww-theme-dark .ww-chat-header {
	background: #111;
}
.ww-theme-dark .ww-chat-body {
	background-color: #1a1a1a;
}
.ww-theme-dark .ww-faqs-container {
	background: #222;
}
.ww-theme-dark .ww-faq-item {
	border-color: #333;
}
.ww-theme-dark .ww-faq-question {
	color: #ddd;
}
.ww-theme-dark .ww-faq-question:hover {
	background-color: #2a2a2a;
}
.ww-theme-dark .ww-faq-answer {
	color: #aaa;
}
.ww-theme-dark .ww-agent-card {
	background: #333;
	color: #eee;
}
.ww-theme-dark .ww-agent-card:hover {
	box-shadow: 0 4px 12px rgba(255,255,255,0.05);
}
.ww-theme-dark .ww-agent-name {
	color: #fff;
}
.ww-theme-dark .ww-agent-title {
	color: #bbb;
}
.ww-theme-dark .ww-agent-icon {
	background: #1a1a1a;
}

/* Glass Theme */
.ww-theme-glass .ww-chat-window {
	background: rgba(255, 255, 255, 0.7);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.5);
	box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}
.ww-theme-glass .ww-chat-header {
	background: linear-gradient(135deg, var(--ww-primary), var(--ww-primary-dark));
}
.ww-theme-glass .ww-chat-body {
	background: transparent;
}
.ww-theme-glass .ww-faqs-container {
	background: rgba(255,255,255,0.5);
}
.ww-theme-glass .ww-faq-question:hover {
	background: rgba(255,255,255,0.8);
}
.ww-theme-glass .ww-agent-card {
	background: rgba(255,255,255,0.6);
	backdrop-filter: blur(5px);
}

/* --- SIZES --- */
.ww-size-small {
	transform: scale(0.85);
	transform-origin: bottom right;
}
.ww-size-large {
	transform: scale(1.15);
	transform-origin: bottom right;
}

/* --- POSITIONS --- */
.ww-pos-left {
	right: auto;
	left: var(--ww-offset-x, 20px);
}
.ww-pos-left .ww-chat-window {
	right: auto;
	left: 0;
	transform-origin: bottom left;
}
.ww-widget-container.ww-pos-left .ww-widget-badge {
	right: auto !important;
	left: 0 !important;
	transform-origin: bottom left !important;
}
.ww-size-small.ww-pos-left,
.ww-size-large.ww-pos-left {
	transform-origin: bottom left;
}

/* --- ANIMATIONS (Widget Entry) --- */
.ww-init-hidden {
	display: none !important;
}

/* Default entry for the toggle button */
@keyframes wwFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes wwBounceIn {
	0% { transform: scale(0); }
	50% { transform: scale(1.2); }
	100% { transform: scale(1); }
}
@keyframes wwSlideUp {
	from { transform: translateY(100px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

.ww-anim-fade {
	animation: wwFadeIn 0.6s ease forwards;
}
.ww-anim-bounce {
	animation: wwBounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.ww-anim-slide {
	animation: wwSlideUp 0.6s ease forwards;
}
/* Disable animation if size scaled, just apply to the container opacity/transform */
.ww-size-small.ww-anim-bounce { animation: none; opacity:0; } /* Size transforms conflict with animation transforms if applied to same node. It's better to wrap it, but for simplicity we rely on JS or simple fade for scaled items if needed, or we just let it be. Let's fix bounce to respect scale */

@keyframes wwBounceInSmall {
	0% { transform: scale(0); }
	50% { transform: scale(1); }
	100% { transform: scale(0.85); }
}
@keyframes wwBounceInLarge {
	0% { transform: scale(0); }
	50% { transform: scale(1.3); }
	100% { transform: scale(1.15); }
}

.ww-size-small.ww-anim-bounce { animation: wwBounceInSmall 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.ww-size-large.ww-anim-bounce { animation: wwBounceInLarge 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

.ww-size-small.ww-anim-slide { animation: wwSlideUp 0.6s ease forwards; /* slide doesn't use scale */ }
.ww-size-large.ww-anim-slide { animation: wwSlideUp 0.6s ease forwards; }


/* Mobile Responsive */
@media (max-width: 480px) {
	.ww-chat-window {
		width: calc(100vw - 40px);
		bottom: 90px;
	}
	.ww-size-small, .ww-size-large {
		transform: scale(1); /* Reset scale on mobile for better usability */
	}
}
