/* Kleuren worden als CSS custom properties ingesteld vanuit PHP */

/* ── Ring animatie ──────────────────────────────────────────────────────────── */

@keyframes ca-ring {
	0%   { transform: rotate(0deg)   scale(1); }
	10%  { transform: rotate(-12deg) scale(1.12); }
	25%  { transform: rotate(12deg)  scale(1.12); }
	40%  { transform: rotate(-8deg)  scale(1.08); }
	55%  { transform: rotate(8deg)   scale(1.08); }
	70%  { transform: rotate(-4deg)  scale(1.04); }
	85%  { transform: rotate(4deg)   scale(1.04); }
	100% { transform: rotate(0deg)   scale(1); }
}

#candyaid-chat-btn.ca-is-ringing {
	animation: ca-ring .7s cubic-bezier(.36, .07, .19, .97);
	transform-origin: center center;
}

/* ── Chat knop ──────────────────────────────────────────────────────────────── */

#candyaid-chat-btn {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 99998;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--ca-color, #da2b4c);
	color: #fff;
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	transition: background .2s, transform .2s;
}

#candyaid-chat-btn:hover {
	background: var(--ca-color-hover, #b81f38);
	transform: scale(1.08);
}

/* ── Badge ──────────────────────────────────────────────────────────────────── */

@keyframes ca-badge-appear {
	from {
		opacity: 0;
		transform: scale(0.5);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

#candyaid-chat-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--ca-badge-color, #ff0000);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
	opacity: 0;
	animation: ca-badge-appear 0.3s ease var(--ca-badge-delay, 0s) forwards;
}

#candyaid-chat-badge.is-hidden {
	opacity: 0;
	animation: none;
}

/* ── Overlay ────────────────────────────────────────────────────────────────── */

#candyaid-chat-overlay {
	display: none;
	position: fixed;
	bottom: 92px;
	right: 24px;
	z-index: 99997;
	width: 380px;
	max-width: calc(100vw - 48px);
	height: 560px;
	max-height: calc(100vh - 112px);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0, 0, 0, .22);
	background: #fff;
}

#candyaid-chat-overlay.is-open {
	display: block;
}

/* ── iFrame ─────────────────────────────────────────────────────────────────── */

#candyaid-chat-iframe {
	width: 100%;
	height: 100%;
	border: none;
}
