/**
 * Spektakel WhatsApp Button - Frontend Styling
 * Design gebaseerd op het strakke witte pill-ontwerp met WhatsApp groen accent.
 */

:root {
	--spektakel-wa-green: #25D366;
	--spektakel-wa-green-hover: #20ba59;
	--spektakel-wa-dark: #128C7E;
	--spektakel-wa-darker: #075E54;
	--spektakel-wa-text-color: #1a1a1a;
	--spektakel-wa-bg: #ffffff;
	--spektakel-wa-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
	--spektakel-wa-shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.18), 0 3px 8px rgba(0, 0, 0, 0.08);
	--spektakel-wa-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Container */
.spektakel-wa-container {
	position: fixed;
	z-index: 999999;
	font-family: var(--spektakel-wa-font);
	box-sizing: border-box;
	line-height: 1.4;
}

.spektakel-wa-container *,
.spektakel-wa-container *::before,
.spektakel-wa-container *::after {
	box-sizing: border-box;
}

/* Posities */
.spektakel-wa-container.pos-bottom-right {
	right: 24px;
	bottom: 24px;
}

.spektakel-wa-container.pos-bottom-left {
	left: 24px;
	bottom: 24px;
}

/* De Pill Button (Exact zoals in voorbeeld) */
.spektakel-wa-btn-pill {
	display: inline-flex;
	align-items: center;
	background-color: var(--spektakel-wa-bg);
	color: var(--spektakel-wa-text-color);
	text-decoration: none;
	padding: 5px 22px 5px 6px;
	border-radius: 9999px;
	box-shadow: var(--spektakel-wa-shadow);
	border: 1px solid rgba(0, 0, 0, 0.04);
	cursor: pointer;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -0.01em;
	transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	user-select: none;
	outline: none;
	position: relative;
	white-space: nowrap;
}

.spektakel-wa-btn-pill:hover,
.spektakel-wa-btn-pill:focus-visible {
	background-color: #ffffff;
	color: var(--spektakel-wa-text-color);
	box-shadow: var(--spektakel-wa-shadow-hover);
	transform: translateY(-3px) scale(1.02);
	text-decoration: none;
}

.spektakel-wa-btn-pill:active {
	transform: translateY(-1px) scale(0.99);
}

/* Groene ronde WhatsApp Bubble */
.spektakel-wa-icon-bubble {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	background: linear-gradient(135deg, #2ae771 0%, var(--spektakel-wa-green) 100%);
	color: #ffffff;
	border-radius: 50%;
	margin-right: 12px;
	flex-shrink: 0;
	box-shadow: 0 2px 6px rgba(37, 211, 102, 0.35);
	transition: transform 0.25s ease;
}

.spektakel-wa-btn-pill:hover .spektakel-wa-icon-bubble {
	transform: scale(1.08) rotate(-4deg);
}

.spektakel-wa-icon-svg {
	width: 24px;
	height: 24px;
	fill: currentColor;
}

/* Knoptekst */
.spektakel-wa-btn-text {
	color: #111827;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
}

/* Pulse animatie */
.spektakel-wa-container.has-pulse .spektakel-wa-icon-bubble::after {
	content: '';
	position: absolute;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: rgba(37, 211, 102, 0.4);
	animation: spektakel-wa-pulse-anim 2.5s infinite;
	z-index: -1;
}

@keyframes spektakel-wa-pulse-anim {
	0% {
		transform: scale(0.95);
		opacity: 0.8;
	}
	70% {
		transform: scale(1.4);
		opacity: 0;
	}
	100% {
		transform: scale(1.4);
		opacity: 0;
	}
}

/* Inline Shortcode knop */
.spektakel-wa-inline-wrapper {
	display: inline-block;
	margin: 10px 0;
}

.spektakel-wa-inline-wrapper .spektakel-wa-btn-pill {
	display: inline-flex;
}

/* Keuzemenu Modal / Popup Venster */
.spektakel-wa-widget-popup {
	position: absolute;
	bottom: calc(100% + 16px);
	right: 0;
	width: 360px;
	max-width: calc(100vw - 32px);
	background: #ffffff;
	border-radius: 20px;
	box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.08);
	overflow: hidden;
	z-index: 1000000;
	border: 1px solid rgba(0, 0, 0, 0.06);
	animation: spektakel-wa-popup-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	transform-origin: bottom right;
}

.spektakel-wa-container.pos-bottom-left .spektakel-wa-widget-popup {
	right: auto;
	left: 0;
	transform-origin: bottom left;
}

@keyframes spektakel-wa-popup-in {
	from {
		opacity: 0;
		transform: translateY(16px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* Popup Header */
.spektakel-wa-popup-header {
	background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
	color: #ffffff;
	padding: 18px 20px;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	position: relative;
}

.spektakel-wa-popup-header-content {
	display: flex;
	align-items: center;
	gap: 12px;
}

.spektakel-wa-popup-badge-icon {
	width: 36px;
	height: 36px;
	background: rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(4px);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	flex-shrink: 0;
}

.spektakel-wa-popup-badge-icon .spektakel-wa-icon-svg {
	width: 20px;
	height: 20px;
}

.spektakel-wa-popup-title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.25;
}

.spektakel-wa-popup-subtitle {
	margin: 3px 0 0 0;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.85);
	line-height: 1.35;
}

.spektakel-wa-popup-close {
	background: transparent;
	border: none;
	color: rgba(255, 255, 255, 0.8);
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.2s ease;
}

.spektakel-wa-popup-close:hover {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.15);
}

/* Popup Body */
.spektakel-wa-popup-body {
	padding: 12px 14px;
	max-height: 340px;
	overflow-y: auto;
	background-color: #f7f9fa;
}

.spektakel-wa-contacts-scroll {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Contactpersoon Kaart */
.spektakel-wa-contact-card {
	display: flex;
	align-items: center;
	background: #ffffff;
	padding: 12px 14px;
	border-radius: 12px;
	text-decoration: none;
	color: inherit;
	border: 1px solid #e5e7eb;
	transition: all 0.2s ease;
	position: relative;
}

.spektakel-wa-contact-card:hover {
	background: #ffffff;
	border-color: var(--spektakel-wa-green);
	box-shadow: 0 4px 14px rgba(37, 211, 102, 0.15);
	transform: translateY(-2px);
	text-decoration: none;
}

/* Contact Avatar */
.spektakel-wa-contact-avatar {
	position: relative;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	margin-right: 12px;
	flex-shrink: 0;
}

.spektakel-wa-contact-avatar img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.spektakel-wa-contact-avatar .avatar-letter {
	width: 100%;
	height: 100%;
	background: #e0f2fe;
	color: #0369a1;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 18px;
}

.spektakel-wa-contact-avatar .online-indicator {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 12px;
	height: 12px;
	background-color: #22c55e;
	border: 2px solid #ffffff;
	border-radius: 50%;
}

/* Contact Info */
.spektakel-wa-contact-info {
	flex: 1;
	min-width: 0;
}

.spektakel-wa-contact-info .name-row {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 2px;
}

.spektakel-wa-contact-info .contact-name {
	font-size: 14px;
	font-weight: 700;
	color: #111827;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.spektakel-wa-contact-info .badge {
	font-size: 10px;
	font-weight: 600;
	background: #dcfce7;
	color: #15803d;
	padding: 2px 6px;
	border-radius: 9999px;
}

.spektakel-wa-contact-info .role-row {
	font-size: 12px;
	color: #6b7280;
	margin-bottom: 3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.spektakel-wa-contact-info .cta-row {
	font-size: 12px;
	font-weight: 600;
	color: #059669;
}

/* Pijltje / Actie icoon */
.spektakel-wa-contact-arrow {
	margin-left: 8px;
	flex-shrink: 0;
}

.wa-action-icon {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #f0fdf4;
	color: #16a34a;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, color 0.2s;
}

.spektakel-wa-contact-card:hover .wa-action-icon {
	background: var(--spektakel-wa-green);
	color: #ffffff;
}

.wa-action-icon .spektakel-wa-icon-svg {
	width: 16px;
	height: 16px;
}

/* Popup Footer */
.spektakel-wa-popup-footer {
	background: #ffffff;
	padding: 10px 16px;
	text-align: center;
	font-size: 11px;
	color: #9ca3af;
	border-top: 1px solid #f3f4f6;
}

.spektakel-wa-no-contacts {
	padding: 20px;
	text-align: center;
	color: #6b7280;
	font-size: 13px;
	margin: 0;
}

/* Mobiele stijlen */
@media (max-width: 640px) {
	.spektakel-wa-container.mobile-icon_only .spektakel-wa-btn-pill {
		padding: 4px;
		border-radius: 50%;
	}

	.spektakel-wa-container.mobile-icon_only .spektakel-wa-icon-bubble {
		margin-right: 0;
		width: 48px;
		height: 48px;
	}

	.spektakel-wa-container.mobile-icon_only .spektakel-wa-btn-text {
		display: none;
	}

	.spektakel-wa-widget-popup {
		position: fixed;
		bottom: 80px;
		right: 16px;
		left: 16px;
		width: auto;
		max-width: none;
	}

	.spektakel-wa-popup-backdrop {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: rgba(0, 0, 0, 0.4);
		backdrop-filter: blur(2px);
		z-index: 999998;
	}
}
