﻿/*
 * CSS voor de chat functionaliteit op de dashboard pagina's
 */
.hw-ai-chat {
	--hw-chat-accent: #ff3f4b;
	--hw-chat-accent-dark: #d92332;
	--hw-chat-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
	bottom: 24px;
	opacity: 1;
	position: fixed;
	right: 24px;
	z-index: 99999;
}

.hw-ai-chat .screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.hw-ai-chat-toggle {
	align-items: center;
	animation: hw-ai-chat-pulse 3.8s ease-in-out infinite;
	background: linear-gradient(135deg, var(--hw-chat-accent), var(--hw-chat-accent-dark));
	border: 0;
	border-radius: 50%;
	box-shadow: 0 14px 34px rgba(217, 35, 50, 0.32);
	color: #ffffff;
	cursor: pointer;
	display: flex;
	font-size: 1.75rem;
	font-weight: 800;
	height: 60px;
	justify-content: center;
	line-height: 1;
	position: relative;
	transition: box-shadow 180ms ease, transform 180ms ease;
	width: 60px;
}

.hw-ai-chat-unread {
	align-items: center;
	background: #dc2626;
	border: 2px solid #ffffff;
	border-radius: 999px;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.22);
	color: #ffffff;
	display: inline-flex;
	font-size: 11px;
	font-weight: 900;
	height: 22px;
	justify-content: center;
	line-height: 1;
	min-width: 22px;
	padding: 0 6px;
	position: absolute;
	right: -4px;
	top: -4px;
	width: auto;
}

.hw-ai-chat-unread[hidden] {
	display: none;
}


.hw-ai-chat.is-staff-support.has-unread .hw-ai-chat-toggle::after {
	background: #ffffff;
	border-radius: 999px;
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
	color: #9a3412;
	content: "Klant heeft hulp nodig";
	font-size: 12px;
	font-weight: 900;
	line-height: 1.15;
	padding: 7px 10px;
	position: absolute;
	right: 66px;
	top: 50%;
	transform: translateY(-50%);
	white-space: nowrap;
}

.hw-ai-chat.is-staff-support.has-multiple-unread .hw-ai-chat-toggle::after {
	content: none;
}

.hw-ai-chat-toggle:hover,
.hw-ai-chat-toggle:focus {
	box-shadow: 0 18px 42px rgba(217, 35, 50, 0.4);
	outline: none;
	transform: translateY(-3px) scale(1.03);
}

.hw-ai-chat-panel {
	background: #ffffff;
	backdrop-filter: none;
	border: 1px solid rgba(217, 222, 231, 0.95);
	border-radius: 18px;
	bottom: 76px;
	box-shadow: var(--hw-chat-shadow);
	display: flex;
	flex-direction: column;
	max-height: min(620px, calc(100vh - 124px));
	opacity: 0;
	overflow: hidden;
	pointer-events: none;
	position: absolute;
	right: 0;
	transform: translateY(14px);
	transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
	visibility: hidden;
	width: 400px;
	z-index: 99999;
}

.hw-ai-chat.is-open .hw-ai-chat-panel {
	background: #ffffff;
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
	visibility: visible;
}

.hw-ai-chat-header {
	align-items: flex-start;
	background: #1f2433;
	color: #ffffff;
	display: flex;
	gap: 16px;
	justify-content: space-between;
	padding: 18px 18px 16px;
}

.hw-ai-chat-header h2 {
	color: #ffffff;
	font-size: 1rem;
	line-height: 1.2;
	margin: 0 0 5px;
}

.hw-ai-chat-header p {
	color: rgba(255, 255, 255, 0.78);
	font-size: 0.82rem;
	line-height: 1.35;
	margin: 0;
}

.hw-ai-chat-close,
.hw-ai-chat-history-toggle,
.hw-ai-chat-send {
	align-items: center;
	border: 0;
	cursor: pointer;
	display: flex;
	justify-content: center;
	transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}


.hw-ai-chat-header > div:first-child {
	min-width: 0;
}

.hw-ai-chat-header-actions {
	align-items: center;
	display: flex;
	flex: 0 0 auto;
	gap: 8px;
}

.hw-ai-chat-history-toggle {
	background: rgba(255, 255, 255, 0.12);
	border-radius: 50%;
	color: #ffffff;
	flex: 0 0 44px;
	height: 44px;
	padding: 0;
	width: 44px;
}

.hw-ai-chat-history-toggle svg {
	display: block;
	fill: currentColor;
	height: 21px;
	width: 21px;
}

.hw-ai-chat-history-toggle .hw-ai-chat-icon-back,
.hw-ai-chat-history-toggle.is-active .hw-ai-chat-icon-history {
	display: none;
}

.hw-ai-chat-history-toggle.is-active .hw-ai-chat-icon-back {
	display: block;
}
.hw-ai-chat-history-toggle:hover,
.hw-ai-chat-history-toggle:focus,
.hw-ai-chat-history-toggle.is-active {
	background: rgba(255, 255, 255, 0.22);
	outline: none;
	transform: translateY(-1px);
}
.hw-ai-chat-close {
	background: rgba(255, 255, 255, 0.12);
	border-radius: 50%;
	color: #ffffff;
	flex: 0 0 44px;
	font-size: 1.45rem;
	font-weight: 600;
	height: 44px;
	line-height: 1;
	width: 44px;
}

.hw-ai-chat-close:hover,
.hw-ai-chat-close:focus {
	background: rgba(255, 255, 255, 0.2);
	outline: none;
	transform: rotate(4deg);
}

.hw-ai-chat-messages {
	background: #f8fafc;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 10px;
	min-height: 260px;
	overflow-y: auto;
	padding: 18px;
	scroll-behavior: smooth;
}

.hw-ai-chat-message {
	display: flex;
	width: 100%;
}

.hw-ai-chat-message-user {
	justify-content: flex-end;
}

.hw-ai-chat-message-bot {
	justify-content: flex-start;
}

.hw-ai-chat-bubble {
	border-radius: 18px;
	font-size: 0.92rem;
	line-height: 1.45;
	max-width: 84%;
	padding: 12px 14px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.hw-ai-chat-message-user .hw-ai-chat-bubble {
	background: var(--hw-chat-accent);
	border-bottom-right-radius: 5px;
	color: #ffffff;
}

.hw-ai-chat-message-bot .hw-ai-chat-bubble {
	background: #eef2f6;
	border: 1px solid #d9e0ea;
	border-bottom-left-radius: 5px;
	color: #172033;
}


.hw-ai-chat-history-toolbar {
	align-items: flex-start;
	background: #ffffff;
	border: 1px solid #d9e0ea;
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	flex: 0 0 auto;
	gap: 12px;
	justify-content: space-between;
	padding: 12px;
}

.hw-ai-chat-history-toolbar strong {
	color: #172033;
	display: block;
	font-size: 0.94rem;
	line-height: 1.25;
}

.hw-ai-chat-history-actions {
	align-items: center;
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
}

.hw-ai-chat-history-action {
	background: #eef2f6;
	border: 1px solid #d9e0ea;
	border-radius: 999px;
	color: #172033;
	cursor: pointer;
	font: inherit;
	font-size: 0.78rem;
	font-weight: 800;
	line-height: 1.2;
	padding: 8px 10px;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.hw-ai-chat-history-action-primary {
	background: var(--hw-chat-accent);
	border-color: var(--hw-chat-accent);
	color: #ffffff;
}

.hw-ai-chat-history-action:hover,
.hw-ai-chat-history-action:focus {
	border-color: var(--hw-chat-accent);
	outline: none;
	transform: translateY(-1px);
}

.hw-ai-chat-history-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.hw-ai-chat-history-item {
	align-items: flex-start;
	background: #ffffff;
	border: 1px solid #d9e0ea;
	border-radius: 12px;
	color: #172033;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	font: inherit;
	gap: 4px;
	padding: 12px;
	text-align: left;
	transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
	width: 100%;
}

.hw-ai-chat-history-item strong {
	font-size: 0.9rem;
	line-height: 1.25;
}

.hw-ai-chat-history-item small {
	color: var(--hw-muted);
	font-size: 0.77rem;
	line-height: 1.25;
}

.hw-ai-chat-history-item em {
	background: #f97316;
	border-radius: 999px;
	color: #ffffff;
	font-size: 0.7rem;
	font-style: normal;
	font-weight: 800;
	line-height: 1;
	padding: 4px 7px;
}

.hw-ai-chat-history-item:hover,
.hw-ai-chat-history-item:focus {
	border-color: var(--hw-chat-accent);
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
	outline: none;
	transform: translateY(-1px);
}

.hw-ai-chat-history-item.is-active {
	border-color: var(--hw-chat-accent);
	box-shadow: inset 4px 0 0 var(--hw-chat-accent), 0 8px 20px rgba(15, 23, 42, 0.08);
}

.hw-ai-chat-history-empty {
	color: var(--hw-muted);
	font-size: 0.9rem;
	line-height: 1.4;
	margin: 0;
}

.hw-ai-chat.is-history-view .hw-ai-chat-messages,
.hw-ai-chat.is-history-detail .hw-ai-chat-messages {
	gap: 12px;
}
.hw-ai-chat-form[hidden] {
	display: none;
}

.admin-bar .hw-ai-chat-form {
	min-height: 70px;
}

.hw-ai-chat-form {
	align-items: flex-start;
	background: #ffffff;
	border-top: 1px solid var(--hw-border);
	display: flex;
	flex: 0 0 auto;
	gap: 18px;
	min-height: 100px;
	overflow: visible;
	padding: 16px 18px 22px;
}

.hw-ai-chat-input-wrap {
	box-sizing: border-box;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.hw-ai-chat-form input {
	background: #f8fafc;
	border-radius: 999px;
	border: 1px solid #f8fafc;
	box-shadow: 0 0 0 3px rgba(255, 63, 75, 0.14);
	box-sizing: border-box;
	color: var(--hw-text);
	flex: 0 0 auto;
	font: inherit;
	height: 40px;
	min-width: 0;
	padding: 14px 18px;
	width: 100%;
}

.hw-ai-chat-form input:focus {
	background: #ffffff;
	border-color: var(--hw-chat-accent);
	border: none;
	box-shadow: 0 0 0 3px rgba(255, 63, 75, 0.14);
	outline: none;
}

.hw-ai-chat-send {
	align-items: center;
	background: var(--hw-chat-accent);
	border: 0;
	border-radius: 50%;
	color: #ffffff;
	cursor: pointer;
	display: inline-flex;
	flex: 0 0 44px;
	height: 44px;
	justify-content: center;
	padding: 0;
	transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
	width: 44px;
}

.hw-ai-chat-send svg {
	display: block;
	fill: currentColor;
	height: 20px;
	width: 20px;
}

.hw-ai-chat-send:hover,
.hw-ai-chat-send:focus {
	background: var(--hw-chat-accent-dark);
	box-shadow: 0 10px 22px rgba(217, 35, 50, 0.28);
	outline: none;
	transform: scale(1.06);
}

.hw-ai-chat-send:active {
	transform: scale(0.94);
}

.hw-ai-chat-form.is-loading input,
.hw-ai-chat-form input:disabled {
	background: #eef2f6;
	color: #667085;
	cursor: wait;
}

.hw-ai-chat-form.is-loading .hw-ai-chat-send,
.hw-ai-chat-send:disabled {
	background: #f8a4aa;
	box-shadow: none;
	cursor: wait;
	transform: none;
}

.hw-ai-chat-form.is-loading .hw-ai-chat-send:hover,
.hw-ai-chat-form.is-loading .hw-ai-chat-send:focus,
.hw-ai-chat-send:disabled:hover,
.hw-ai-chat-send:disabled:focus {
	background: #f8a4aa;
	box-shadow: none;
	transform: none;
}

.hw-ai-chat-typing-row {
	min-height: 0;
}

.hw-ai-chat-typing {
	align-items: center;
	display: inline-flex;
	justify-content: center;
	min-height: 44px;
	min-width: 76px;
	padding: 12px 16px;
}

.hw-ai-chat-typing-dots {
	align-items: center;
	display: inline-flex;
	gap: 6px;
	height: 16px;
}

.hw-ai-chat-typing-dots span {
	animation: hw-ai-chat-dot 1.05s cubic-bezier(0.4, 0, 0.2, 1) infinite;
	background: var(--hw-chat-accent);
	border-radius: 50%;
	display: block;
	height: 7px;
	opacity: 0.38;
	width: 7px;
}

.hw-ai-chat-typing-dots span:nth-child(2) {
	animation-delay: 0.15s;
}

.hw-ai-chat-typing-dots span:nth-child(3) {
	animation-delay: 0.3s;
}
@keyframes hw-ai-chat-pulse {
	0%,
	100% {
		transform: translateY(0);
	}

	50% {
		transform: translateY(-2px);
	}
}

@keyframes hw-ai-chat-dot {
	0%,
	80%,
	100% {
		opacity: 0.35;
		transform: translateY(0);
	}

	40% {
		opacity: 1;
		transform: translateY(-4px);
	}
}

/* ===========================
   Responsieve weergave
   =========================== */
@media (max-width: 640px) {
	.hw-ai-chat {
		bottom: 16px;
		left: 14px;
		right: 14px;
	}

	.hw-ai-chat-toggle {
		height: 58px;
		margin-left: auto;
		width: 58px;
	}

	.hw-ai-chat-panel {
		bottom: 74px;
		max-height: calc(100vh - 106px);
		width: 100%;
	}

	.hw-ai-chat-messages {
		min-height: 260px;
	}
	.hw-ai-chat-header {
		gap: 10px;
		padding: 16px 14px 14px;
	}

	.hw-ai-chat-header-actions {
		gap: 6px;
	}

	.hw-ai-chat-close,
	.hw-ai-chat-history-toggle {
		flex-basis: 40px;
		height: 40px;
		width: 40px;
	}

	.hw-ai-chat-history-toolbar {
		align-items: stretch;
		flex-direction: column;
	}

	.hw-ai-chat-history-actions {
		justify-content: flex-start;
	}
}

.hw-ai-chat.is-escalated .hw-ai-chat-header {
	background: #202432;
}

.hw-ai-chat.is-staff-support .hw-ai-chat-panel {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	height: min(640px, calc(100vh - 112px));
	max-height: min(640px, calc(100vh - 112px));
	min-height: 0;
	overflow: hidden;
	width: 440px;
}

.hw-ai-chat.is-staff-support .hw-ai-chat-messages {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 12px;
	min-height: 0;
	overflow: hidden;
	padding: 14px 14px 8px;
}

.hw-ai-chat.is-staff-support .hw-ai-support-detail,
.hw-ai-chat.is-staff-support .hw-ai-support-body,
.hw-ai-chat.is-staff-support .hw-ai-support-chat-area {
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

.hw-ai-support-title,
.hw-ai-support-detail-header h3 {
	font-size: 16px;
	margin: 0;
}

.hw-ai-support-ticket-list {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 10px;
	min-height: 0;
	overflow-y: auto;
	padding-right: 2px;
}

.hw-ai-support-empty,
.hw-ai-support-meta,
.hw-ai-support-last {
	color: #667085;
	font-size: 13px;
	line-height: 1.45;
	margin: 0;
}

.hw-ai-support-meta,
.hw-ai-support-last {
	background: #ffffff;
	border: 1px solid #e5ebf3;
	border-radius: 8px;
	padding: 10px 12px;
}

.hw-ai-support-info {
	align-items: center;
	background: #ffffff;
	border: 1px solid #e5ebf3;
	border-radius: 10px;
	display: flex;
	flex-direction: column;
	flex: 0 0 var(--hw-ai-support-info-height);
	gap: 9px;
	justify-content: space-between;
	min-height: 0;
	overflow: visible;
	padding: 10px;
}

.hw-ai-support-detail-header {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 0 0 auto;
	min-width: 0;
}

.hw-ai-support-detail-header h3 {
	text-align: center;
	overflow-wrap: anywhere;
}

.hw-ai-support-detail-header small {
	color: #667085;
	overflow-wrap: anywhere;
}

.hw-ai-support-actions {
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	gap: 8px;
}

.hw-ai-support-actions .button {
	background: #ffffff;
	border: 1px solid #d9dee7;
	border-radius: 8px;
	color: #111827;
	cursor: pointer;
	font-weight: 800;
	min-height: 34px;
	padding: 7px 10px;
}

.hw-ai-support-actions .button-primary {
	background: #ff3f4b;
	border-color: #ff3f4b;
	color: #ffffff;
}

.hw-ai-support-actions .button:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

.hw-ai-support-splitter {
	align-items: center;
	background: #e5e7eb;
	border: 1px solid #d1d5db;
	border-left: 0;
	border-radius: 999px;
	border-right: 0;
	color: #475467;
	cursor: row-resize;
	display: flex;
	flex: 0 0 16px;
	justify-content: center;
	margin: 0;
	padding: 0;
	touch-action: none;
	transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
	width: 100%;
}

.hw-ai-support-splitter:hover,
.hw-ai-support-splitter:focus,
.hw-ai-support-detail.is-resizing .hw-ai-support-splitter {
	background: #d1d5db;
	border-color: #9ca3af;
	color: #111827;
	outline: none;
}

.hw-ai-support-splitter-grip {
	font-size: 18px;
	font-weight: 900;
	letter-spacing: 0;
	line-height: 1;
	transform: rotate(0deg);
}

.hw-ai-support-resizing,
.hw-ai-support-resizing * {
	cursor: row-resize !important;
	user-select: none !important;
}

.hw-ai-chat.is-staff-support .hw-ai-support-thread {
	background: #ffffff;
	border: 1px solid #d9e2ee;
	border-radius: 10px;
	box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 10px;
	height: auto;
	max-height: none;
	min-width: 0;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	margin-bottom: 0;
	padding: 10px 10px 20px;
	scroll-padding-bottom: 24px;
	scrollbar-gutter: stable;
}

.hw-ai-support-detail {
	--hw-ai-support-info-height: auto;
	--hw-ai-support-min-thread-height: 40px;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 10px;
	height: 100%;
	min-height: 0;
	overflow: hidden;
}

.hw-ai-chat.is-staff-support .hw-ai-chat-form {
	flex: 0 0 auto;
	margin-top: 0;
	padding-top: 8px;
	position: static;
	z-index: auto;
}

.hw-ai-chat.is-staff-support .hw-ai-chat-form[hidden] {
	display: none;
}

.hw-ai-chat.is-staff-support .hw-support-message {
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
	color: #111827;
	font-size: 13px;
	line-height: 1.45;
	margin: 0;
	max-width: 88%;
	min-height: max-content;
	padding: 11px 13px;
	box-sizing: border-box;
	flex: 0 0 auto;
	flex-shrink: 0;
}

.hw-ai-chat.is-staff-support .hw-support-message small {
	color: #475467;
	display: block;
	flex-shrink: 0;
	font-size: 11px;
	font-weight: 800;
	margin-bottom: 5px;
}

.hw-ai-chat.is-staff-support .hw-support-message p {
	color: #111827;
	flex-shrink: 0;
	margin: 0;
	overflow-wrap: anywhere;
	white-space: pre-wrap;
}

.hw-ai-chat.is-staff-support .hw-support-message-customer {
	align-self: flex-start;
	background: #ffffff;
	border-color: #cbd5e1;
}

.hw-ai-chat.is-staff-support .hw-support-message-staff {
	align-self: flex-end;
	background: #fff1f2;
	border-color: #fda4af;
}

.hw-ai-chat.is-staff-support .hw-support-message-system,
.hw-ai-chat.is-staff-support .hw-support-message-ai {
	align-self: center;
	background: #eef2ff;
	border-color: #c7d2fe;
	max-width: 94%;
}

@media (max-width: 640px) {
	.hw-ai-chat.is-staff-support .hw-ai-chat-panel {
		height: calc(100vh - 106px);
		max-height: calc(100vh - 106px);
		width: 100%;
	}

	.hw-ai-chat.is-staff-support .hw-ai-chat-messages {
		padding: 12px;
	}

	.hw-ai-support-info {
		align-items: stretch;
		flex: 0 0 auto;
		flex-direction: column;
		max-height: none;
		min-height: 0;
		overflow: visible;
	}

	.hw-ai-support-splitter {
		display: none;
	}

	.hw-ai-chat.is-staff-support.has-unread .hw-ai-chat-toggle::after {
		right: 64px;
		white-space: normal;
		width: 150px;
	}
}

