/* WA Floating Chat — Frontend Styles */

.wafc-widget {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 999999;
	font-family: inherit;
}

/* Floating round button */
.wafc-toggle {
	position: relative;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #25D366;
	border: none;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	padding: 0;
}

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

.wafc-wa-icon {
	width: 40px;
	height: 40px;
	position: relative;
	z-index: 1;
}

.wafc-pulse-ring {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	height: 100%;
	transform: translate(-50%, -50%) scale(1);
	border-radius: 50%;
	border: var(--wafc-pulse-width, 4px) solid #25D366;
	opacity: var(--wafc-pulse-opacity, 0.6);
	animation: wafc-pulse-ring var(--wafc-pulse-delay, 2s) cubic-bezier(0.4, 0, 0.6, 1) infinite;
	pointer-events: none;
	z-index: 0;
}

@keyframes wafc-pulse-ring {
	0% {
		transform: translate(-50%, -50%) scale(1);
		opacity: var(--wafc-pulse-opacity, 0.6);
	}
	100% {
		transform: translate(-50%, -50%) scale(1.8);
		opacity: 0;
	}
}

.wafc-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	background: #FF3B30;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	min-width: 20px;
	height: 20px;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 4px;
	border: 2px solid #fff;
	z-index: 2;
	line-height: 1;
}

/* Panel chat window */
.wafc-panel {
	position: absolute;
	right: 0;
	bottom: 76px;
	width: 320px;
	max-width: calc(100vw - 48px);
	background: #fff;
	border-radius: var(--wafc-panel-border-radius, 12px);
	border: var(--wafc-panel-border-width, 0px) solid var(--wafc-panel-border-color, transparent);
	overflow: hidden;
	box-shadow: var(--wafc-panel-shadow, 0 12px 32px rgba(0, 0, 0, 0.22));
	animation: wafc-pop-in 0.22s ease;
}

.wafc-panel[hidden] {
	display: none;
}

@keyframes wafc-pop-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes wafc-pop-out {
	from {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
	to {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
}

.wafc-panel.wafc-closing {
	animation: wafc-pop-out 0.18s ease forwards;
}

/* Header */
.wafc-header {
	background: #075E54;
	color: #fff;
	padding: 16px 16px 20px;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
}

.wafc-header-left {
	display: flex;
	align-items: center;
	gap: 10px;
}

.wafc-avatar-wrap {
	position: relative;
	flex-shrink: 0;
}

.wafc-avatar {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	background: #fff;
}

.wafc-online-dot {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #4CD964;
	border: 2px solid #075E54;
}

.wafc-header-text {
	display: flex;
	flex-direction: column;
	line-height: 1.35;
}

.wafc-header-text strong {
	font-size: 15px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 4px;
}

.wafc-verified-badge {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.wafc-header-text span {
	font-size: 12.5px;
	opacity: 0.85;
}

.wafc-close {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.85;
	padding: 2px;
}

.wafc-close:hover {
	opacity: 1;
}

/* Body */
.wafc-body {
	background-color: #ECE5DD; /* fallback otomatis kalau browser lawas belum dukung WebP */
	background-image: url('chat-bg.webp');
	background-repeat: repeat;
	background-position: top left;
	background-size: 210px auto; /* ukuran tile - dijaga kecil supaya file tetap ringan */
	padding: 18px 14px 16px;
}

.wafc-timestamp {
	text-align: center;
	font-size: 11px;
	color: #7a7a7a;
	margin-bottom: 10px;
}

.wafc-bubble {
	position: relative;
	background: #fff;
	color: #111;
	font-size: 14px;
	line-height: 1.4;
	padding: 9px 12px;
	border-radius: 10px;
	box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
	max-width: 85%;
	margin-bottom: 8px;
	margin-left: 6px;
	transition: opacity 0.28s ease, transform 0.28s ease;
}

.wafc-bubble-first {
	border-top-left-radius: 2px;
}

.wafc-bubble-first::before {
	content: "";
	position: absolute;
	top: 0;
	left: -6px;
	width: 0;
	height: 0;
	border-top: 8px solid #fff;
	border-left: 6px solid transparent;
}

.wafc-bubble a {
	color: #075E54;
	font-weight: 600;
	text-decoration: underline;
	word-break: break-word;
}

.wafc-bubble a:hover {
	color: #128C7E;
}

.wafc-bubble i {
	margin-right: 4px;
	font-size: 14px;
	vertical-align: -1px;
}

.wafc-cta {
	margin-top: 35px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #25D366;
	color: #fff !important;
	text-decoration: none;
	font-weight: 600;
	font-size: 14.5px;
	padding: 12px 16px;
	border-radius: 999px;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
	transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.28s ease, transform 0.28s ease;
}

.wafc-cta:hover {
	background: #1fb958;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.wafc-cta-icon {
	width: 18px;
	height: 18px;
}

@media (max-width: 380px) {
	.wafc-widget {
		right: 14px;
		bottom: 14px;
	}
	.wafc-panel {
		width: calc(100vw - 28px);
	}
}
