/* ==========================================================================
   Multi Agent WhatsApp Chat — Frontend Styles
   ========================================================================== */

.mawc-widget-wrapper * {
	box-sizing: border-box;
}

/* ---------- Floating Button ---------- */
.mawc-widget {
	position: fixed;
	bottom: var(--mawc-offset-bottom, 20px);
	width: var(--mawc-btn-size, 60px);
	height: var(--mawc-btn-size, 60px);
	border-radius: 50%;
	background: var(--mawc-btn-bg, #25D366);
	color: var(--mawc-btn-icon, #ffffff);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	z-index: 999998;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mawc-widget:hover {
	transform: scale(1.06);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.mawc-widget .mawc-icon {
	width: 56%;
	height: 56%;
	display: flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.mawc-widget .mawc-icon svg {
	width: 100%;
	height: 100%;
}

.mawc-widget .mawc-icon-close {
	opacity: 0;
	transform: scale(0.5) rotate(-45deg);
}

.mawc-widget.is-open .mawc-icon-whatsapp {
	opacity: 0;
	transform: scale(0.5) rotate(45deg);
}

.mawc-widget.is-open .mawc-icon-close {
	opacity: 1;
	transform: scale(1) rotate(0deg);
}

/* Animations */
.mawc-anim-pulse::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: inherit;
	animation: mawc-pulse 2s infinite;
	z-index: -1;
}

@keyframes mawc-pulse {
	0% { transform: scale(1); opacity: 0.6; }
	70% { transform: scale(1.7); opacity: 0; }
	100% { transform: scale(1.7); opacity: 0; }
}

.mawc-anim-bounce {
	animation: mawc-bounce 1.8s infinite;
}

@keyframes mawc-bounce {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-8px); }
}

/* Tooltip */
.mawc-tooltip {
	position: fixed;
	bottom: calc(var(--mawc-offset-bottom, 20px) + var(--mawc-btn-size, 60px) + 8px);
	right: var(--mawc-offset-side, 20px);
	background: #ffffff;
	color: #333;
	padding: 8px 14px;
	border-radius: 20px;
	font-size: 13px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	white-space: nowrap;
	z-index: 999997;
	animation: mawc-fadein 0.4s ease 1s both;
}

[dir="rtl"] .mawc-tooltip,
.mawc-widget[style*="left"] ~ .mawc-tooltip {
	right: auto;
}

@keyframes mawc-fadein {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

.mawc-widget-wrapper.mawc-panel-open .mawc-tooltip {
	display: none;
}

/* ---------- Overlay (mobile) ---------- */
.mawc-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	z-index: 999996;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease;
}

.mawc-widget-wrapper.mawc-panel-open .mawc-overlay {
	opacity: 1;
	visibility: visible;
}

/* ---------- Panel ---------- */
.mawc-panel {
	position: fixed;
	bottom: calc(var(--mawc-offset-bottom, 20px) + var(--mawc-btn-size, 60px) + 16px);
	width: var(--mawc-panel-width, 360px);
	max-width: calc(100vw - 24px);
	max-height: 70vh;
	background: var(--mawc-panel-bg, #ffffff);
	border-radius: 14px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	z-index: 999997;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px) scale(0.97);
	transform-origin: bottom right;
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.mawc-widget-wrapper.mawc-panel-open .mawc-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

.mawc-panel-header {
	background: var(--mawc-panel-header-bg, #075E54);
	color: #ffffff;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

.mawc-brand-logo {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	background: #fff;
}

.mawc-header-text {
	flex: 1;
	min-width: 0;
}

.mawc-header-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

.mawc-header-subtitle {
	margin: 2px 0 0;
	font-size: 12.5px;
	opacity: 0.85;
	line-height: 1.3;
}

.mawc-panel-close {
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: #fff;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.2s ease;
}

.mawc-panel-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

.mawc-intro-message {
	padding: 12px 18px;
	background: #ecf5f3;
	border-bottom: 1px solid #e2e2e2;
}

.mawc-intro-message p {
	margin: 0;
	font-size: 13px;
	color: #444;
	line-height: 1.4;
}

.mawc-agent-list {
	overflow-y: auto;
	flex: 1;
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.mawc-agent-row {
	display: flex;
	align-items: center;
	gap: 12px;
	background: var(--mawc-agent-row-bg, #f7f7f7);
	border-left: 3px solid transparent;
	border-radius: 8px;
	padding: 10px 12px;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.18s ease, border-color 0.18s ease;
}

.mawc-agent-row.is-online {
	border-left-color: var(--mawc-agent-active-border, #25D366);
}

.mawc-agent-row:hover {
	background: #eef1f0;
}

.mawc-agent-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
	background: #dfe4e3;
}

.mawc-agent-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mawc-agent-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	line-height: 1.35;
}

.mawc-agent-name {
	font-size: 14.5px;
	font-weight: 600;
	color: #222;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mawc-agent-designation {
	font-size: 12px;
	color: #8a8a8a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mawc-agent-status {
	font-size: 11.5px;
	color: #e0a93f;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mawc-agent-action {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: #25D366;
	background: rgba(37, 211, 102, 0.1);
}

.mawc-agent-row.is-offline .mawc-agent-action {
	color: #b9b9b9;
	background: rgba(0, 0, 0, 0.04);
}

.mawc-empty-agents {
	padding: 30px 16px;
	text-align: center;
}

.mawc-empty-agents p {
	margin: 0;
	font-size: 13px;
	color: #999;
}

.mawc-panel-footer {
	padding: 8px 14px;
	text-align: center;
	border-top: 1px solid #eee;
	flex-shrink: 0;
}

.mawc-panel-footer span {
	font-size: 11px;
	color: #aaa;
}

/* ---------- Scrollbar ---------- */
.mawc-agent-list::-webkit-scrollbar {
	width: 6px;
}

.mawc-agent-list::-webkit-scrollbar-thumb {
	background: #d3d3d3;
	border-radius: 3px;
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
	.mawc-widget {
		bottom: var(--mawc-offset-bottom-mobile, 20px);
	}

	.mawc-panel {
		bottom: calc(var(--mawc-offset-bottom-mobile, 20px) + var(--mawc-btn-size, 60px) + 12px);
		width: calc(100vw - 24px);
		left: 12px !important;
		right: 12px !important;
		max-height: 75vh;
	}

	.mawc-tooltip {
		display: none;
	}
}
