/**
 * Tunai WhatsApp Float – Frontend styles
 */

/* ── Container ─────────────────────────────────────────────── */
.tunai-wa-float {
	--tunai-wa-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
	--tunai-wa-shadow-hover: 0 8px 28px rgba(37, 211, 102, 0.5);
	position: fixed;
	bottom: var(--tunai-wa-bottom, 24px);
	z-index: 999999;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	line-height: 1.4;
	pointer-events: none;
}

.tunai-wa-float--right {
	right: var(--tunai-wa-side, 24px);
	align-items: flex-end;
}

.tunai-wa-float--left {
	left: var(--tunai-wa-side, 24px);
	align-items: flex-start;
}

/* ── Visibility breakpoints ────────────────────────────────── */
@media (min-width: 768px) {
	.tunai-wa-float--hide-desktop {
		display: none !important;
	}
}

@media (max-width: 767px) {
	.tunai-wa-float--hide-mobile {
		display: none !important;
	}
}

/* ── Button ────────────────────────────────────────────────── */
.tunai-wa-btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--tunai-wa-size, 60px);
	height: var(--tunai-wa-size, 60px);
	background: var(--tunai-wa-color, #25D366);
	color: #fff;
	border-radius: 50%;
	box-shadow: var(--tunai-wa-shadow);
	text-decoration: none;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	pointer-events: auto;
	overflow: visible;
}

.tunai-wa-btn svg {
	width: 55%;
	height: 55%;
}

.tunai-wa-btn:hover,
.tunai-wa-btn:focus-visible {
	transform: scale(1.08);
	box-shadow: var(--tunai-wa-shadow-hover);
	color: #fff;
	outline: none;
}

.tunai-wa-btn:focus-visible {
	box-shadow: var(--tunai-wa-shadow-hover), 0 0 0 3px rgba(37, 211, 102, 0.4);
}

/* ── Pulse animation ───────────────────────────────────────── */
.tunai-wa-float--pulse .tunai-wa-btn::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--tunai-wa-color, #25D366);
	opacity: 0;
	z-index: -1;
	animation: tunai-wa-pulse 4s ease-out infinite;
}

.tunai-wa-float--pulse .tunai-wa-btn:hover::before,
.tunai-wa-float--pulse .tunai-wa-btn:focus-visible::before {
	animation-play-state: paused;
	opacity: 0;
}

@keyframes tunai-wa-pulse {
	0%, 100% {
		transform: scale(1);
		opacity: 0;
	}
	10% {
		transform: scale(1);
		opacity: 0.5;
	}
	40% {
		transform: scale(1.6);
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tunai-wa-float--pulse .tunai-wa-btn::before {
		animation: none;
	}

	.tunai-wa-btn {
		transition: none;
	}

	.tunai-wa-btn:hover,
	.tunai-wa-btn:focus-visible {
		transform: none;
	}

	.tunai-wa-card {
		animation: none !important;
	}

	.tunai-wa-float--bounce .tunai-wa-btn {
		animation: none !important;
	}
}

/* ── Bounce (after card dismiss) ───────────────────────────── */
@keyframes tunai-wa-bounce {
	0%, 100% { transform: scale(1); }
	30% { transform: scale(1.12); }
	60% { transform: scale(0.96); }
}

.tunai-wa-float--bounce .tunai-wa-btn {
	animation: tunai-wa-bounce 0.5s ease;
}

/* ── Tooltip ───────────────────────────────────────────────── */
.tunai-wa-tooltip {
	position: absolute;
	bottom: calc(var(--tunai-wa-size, 60px) + 10px);
	right: 0;
	background: #1a1a2e;
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	padding: 8px 14px;
	border-radius: 8px;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
	pointer-events: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tunai-wa-float--left .tunai-wa-tooltip {
	right: auto;
	left: 0;
}

.tunai-wa-tooltip::after {
	content: "";
	position: absolute;
	bottom: -5px;
	right: 20px;
	width: 10px;
	height: 10px;
	background: #1a1a2e;
	transform: rotate(45deg);
}

.tunai-wa-float--left .tunai-wa-tooltip::after {
	right: auto;
	left: 20px;
}

.tunai-wa-float:hover .tunai-wa-tooltip,
.tunai-wa-float:focus-within .tunai-wa-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* ── Welcome card ──────────────────────────────────────────── */
.tunai-wa-card {
	position: relative;
	background: #fff;
	color: #1a1a2e;
	border-radius: 14px;
	padding: 16px 36px 16px 18px;
	margin-bottom: 14px;
	max-width: 260px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
	pointer-events: auto;
	opacity: 0;
	transform: translateY(12px);
	animation: tunai-wa-card-in 0.5s ease forwards;
}

.tunai-wa-float--right .tunai-wa-card {
	margin-right: 4px;
}

.tunai-wa-float--left .tunai-wa-card {
	margin-left: 4px;
}

.tunai-wa-card::after {
	content: "";
	position: absolute;
	bottom: -7px;
	width: 14px;
	height: 14px;
	background: #fff;
	transform: rotate(45deg);
	box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.06);
}

.tunai-wa-float--right .tunai-wa-card::after {
	right: 22px;
}

.tunai-wa-float--left .tunai-wa-card::after {
	left: 22px;
}

@keyframes tunai-wa-card-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.tunai-wa-card.tunai-wa-card--out {
	animation: tunai-wa-card-out 0.35s ease forwards;
	pointer-events: none;
}

@keyframes tunai-wa-card-out {
	to {
		opacity: 0;
		transform: translateY(8px);
	}
}

.tunai-wa-card__close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: none;
	background: transparent;
	color: #999;
	cursor: pointer;
	border-radius: 4px;
	transition: color 0.2s, background 0.2s;
}

.tunai-wa-card__close:hover,
.tunai-wa-card__close:focus-visible {
	color: #333;
	background: #f0f0f0;
	outline: none;
}

.tunai-wa-card__title {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.tunai-wa-card__subtitle {
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 600;
	color: #333;
}

.tunai-wa-card__text {
	margin: 0;
	font-size: 13px;
	color: #25D366;
	font-weight: 500;
}

/* ── Badge ─────────────────────────────────────────────────── */
.tunai-wa-badge {
	position: absolute;
	top: -2px;
	right: -2px;
	pointer-events: none;
}

.tunai-wa-badge--dot {
	width: 14px;
	height: 14px;
	background: #ff3b30;
	border: 2px solid #fff;
	border-radius: 50%;
}

.tunai-wa-badge--number {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	background: #ff3b30;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	border: 2px solid #fff;
	border-radius: 10px;
	line-height: 1;
}

.tunai-wa-badge--text {
	padding: 2px 7px;
	background: #ff3b30;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	border: 2px solid #fff;
	border-radius: 8px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	white-space: nowrap;
}
