/**
 * Webchimp Chatassistent — widget styles.
 *
 * Themap via CSS custom properties: --wcca-accent, --wcca-bg, --wcca-text,
 * --wcca-radius. Deze worden via wp_add_inline_style gezet uit de instellingen.
 */

.wcca-root {
	--wcca-accent: #1d4ed8;
	--wcca-accent-contrast: #ffffff;
	--wcca-bg: #ffffff;
	--wcca-text: #1f2937;
	--wcca-border: #e2e8f0;
	--wcca-radius: 14px;
	--wcca-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--wcca-z: 99999;
	--wcca-shadow: 0 10px 40px rgba(0, 0, 0, 0.22);

	font-family: var(--wcca-font);
	font-size: 15px;
	line-height: 1.5;
	color: var(--wcca-text);
	z-index: var(--wcca-z);
}

/* Inline (shortcode) weergave */
.wcca-root.wcca-inline {
	position: static;
	width: 100%;
	max-width: 480px;
	margin: 0 auto;
	z-index: auto;
}

/* Zwevende knop */
.wcca-launcher {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 18px;
	border: none;
	border-radius: 999px;
	background: var(--wcca-accent);
	color: var(--wcca-accent-contrast);
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	box-shadow: var(--wcca-shadow);
	transition: transform 0.15s ease;
}

.wcca-launcher:hover,
.wcca-launcher:focus-visible {
	transform: scale(1.04);
	outline: 2px solid var(--wcca-accent);
	outline-offset: 3px;
}

.wcca-floating {
	position: fixed;
	bottom: 20px;
	z-index: var(--wcca-z);
}
.wcca-pos-right { right: 20px; }
.wcca-pos-left { left: 20px; }
.wcca-floating .wcca-launcher {
	position: absolute;
	bottom: 0;
}
.wcca-pos-right .wcca-launcher { right: 0; }
.wcca-pos-left .wcca-launcher { left: 0; }

/* Paneel */
.wcca-panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(380px, calc(100vw - 24px));
	height: min(560px, 78vh);
	margin-top: 8px;
	background: var(--wcca-bg);
	border-radius: var(--wcca-radius);
	box-shadow: var(--wcca-shadow);
	overflow: hidden;
}
.wcca-floating .wcca-panel {
	position: fixed;
	bottom: 76px;
}
.wcca-pos-right .wcca-panel { right: 20px; }
.wcca-pos-left .wcca-panel { left: 20px; }

/* Inline weergave */
.wcca-root:not(.wcca-floating) .wcca-panel {
	width: 100%;
	height: 560px;
	max-height: 78vh;
}

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

/* Kop */
.wcca-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--wcca-accent);
	color: var(--wcca-accent-contrast);
	flex-shrink: 0;
	gap: 8px;
}
.wcca-title {
	font-weight: 700;
	font-size: 16px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.wcca-close {
	background: none;
	border: none;
	color: var(--wcca-accent-contrast);
	font-size: 16px;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 6px;
}
.wcca-close:hover,
.wcca-close:focus-visible {
	background: rgba(255, 255, 255, 0.2);
	outline: none;
}

/* Melding */
.wcca-notice {
	padding: 8px 16px;
	font-size: 12px;
	line-height: 1.4;
	background: #eef2ff;
	color: #1e293b;
	flex-shrink: 0;
}
.wcca-notice[hidden] { display: none; }

/* Berichten */
.wcca-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	overscroll-behavior: contain;
}

.wcca-msg {
	max-width: 86%;
	padding: 10px 14px;
	border-radius: var(--wcca-radius);
	font-size: 14px;
	line-height: 1.5;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.wcca-msg-user {
	align-self: flex-end;
	background: var(--wcca-accent);
	color: var(--wcca-accent-contrast);
	border-bottom-right-radius: 4px;
}

.wcca-msg-bot {
	align-self: flex-start;
	background: #f1f5f9;
	color: var(--wcca-text);
	border-bottom-left-radius: 4px;
}

.wcca-msg-bot p:first-child { margin-top: 0; }
.wcca-msg-bot p:last-child { margin-bottom: 0; }

.wcca-msg-bot a {
	color: var(--wcca-accent);
	text-decoration: underline;
}

.wcca-msg-typing {
	align-self: flex-start;
	background: #f1f5f9;
	padding: 12px 14px;
	border-radius: 12px;
	color: #64748b;
	font-style: italic;
}

/* Onderwerpen */
.wcca-topics {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 14px 8px;
	flex-shrink: 0;
}
.wcca-topic {
	padding: 7px 12px;
	border: 1px solid var(--wcca-accent);
	border-radius: 999px;
	background: transparent;
	color: var(--wcca-accent);
	font-size: 13px;
	cursor: pointer;
	font-family: inherit;
}
.wcca-topic:hover,
.wcca-topic:focus-visible {
	background: var(--wcca-accent);
	color: var(--wcca-accent-contrast);
	outline: none;
}

/* Verduidelijking */
.wcca-clarify {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 0 14px 8px;
}
.wcca-clarify-btn {
	padding: 8px 12px;
	border: 1px solid var(--wcca-accent);
	border-radius: 10px;
	background: #ffffff;
	color: var(--wcca-accent);
	font-size: 14px;
	cursor: pointer;
	font-family: inherit;
	text-align: left;
}
.wcca-clarify-btn:hover,
.wcca-clarify-btn:focus-visible {
	background: var(--wcca-accent);
	color: var(--wcca-accent-contrast);
	outline: none;
}

/* Contactopties */
.wcca-contacts {
	padding: 8px 14px;
	flex-shrink: 0;
}
.wcca-contacts ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.wcca-contacts a {
	display: inline-block;
	background: var(--wcca-accent);
	color: var(--wcca-accent-contrast);
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 13px;
	text-decoration: none;
}
.wcca-contacts a:hover,
.wcca-contacts a:focus-visible {
	opacity: 0.85;
	outline: 2px solid var(--wcca-accent);
	outline-offset: 2px;
}

/* Privacy */
.wcca-privacy {
	margin-top: 6px;
	font-size: 11px;
	color: #64748b;
	line-height: 1.4;
}
.wcca-privacy[hidden] { display: none; }

/* Formulier */
.wcca-form {
	display: flex;
	gap: 8px;
	padding: 10px 14px;
	border-top: 1px solid var(--wcca-border);
	flex-shrink: 0;
	background: var(--wcca-bg);
}
.wcca-input {
	flex: 1;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	color: var(--wcca-text);
	background: var(--wcca-bg);
}
.wcca-input:focus-visible {
	outline: 2px solid var(--wcca-accent);
	outline-offset: 1px;
}
.wcca-send {
	padding: 10px 16px;
	border: none;
	border-radius: 8px;
	background: var(--wcca-accent);
	color: var(--wcca-accent-contrast);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
}
.wcca-send:disabled {
	opacity: 0.55;
	cursor: wait;
}
.wcca-send:focus-visible {
	outline: 2px solid var(--wcca-accent);
	outline-offset: 2px;
}

/* Voettekst */
.wcca-footer {
	padding: 8px 14px 12px;
	border-top: 1px solid var(--wcca-border);
	flex-shrink: 0;
	background: var(--wcca-bg);
}

/* Mobiel */
@media (max-width: 480px) {
	.wcca-root:not(.wcca-inline) .wcca-panel {
		width: calc(100vw - 16px);
		height: calc(100vh - 120px);
		max-height: none;
	}
	.wcca-pos-right .wcca-panel,
	.wcca-pos-left .wcca-panel {
		right: 8px;
		left: 8px;
		bottom: 72px;
	}
}

/* Systeemvoorkeuren */
@media (prefers-reduced-motion: reduce) {
	.wcca-launcher,
	.wcca-topic,
	.wcca-clarify-btn {
		transition: none;
	}
}

.wcca-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	overflow: hidden;
	white-space: nowrap;
}

/* Beheer: prijslijst + voorwaardenblok (wordt ook op frontend gebruikt) */
.wcca-price-list {
	list-style: none;
	margin: 6px 0 0 0;
	padding: 0;
}
.wcca-price-list li {
	padding: 4px 0;
	border-bottom: 1px dotted var(--wcca-border);
	font-size: 14px;
}
.wcca-answer-note {
	margin-top: 8px;
	padding: 8px 10px;
	background: #fffbeb;
	border-left: 3px solid #f59e0b;
	border-radius: 4px;
	font-size: 13px;
	color: #92400e;
}
.wcca-answer-links {
	margin-top: 8px;
}
.wcca-answer-links ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.wcca-answer-links a {
	color: var(--wcca-accent);
}
