/* WXT AI Chatbot — Widget-Styles (Plain CSS, self-contained). */

.wxtc {
	--wxtc-accent: #2f7d6b;
	--wxtc-accent-ink: #ffffff;
	--wxtc-bg: #ffffff;
	--wxtc-ink: #1f2a28;
	--wxtc-muted: #6b7a77;
	--wxtc-line: #e4e9e8;
	--wxtc-bot-bg: #f2f6f5;
	--wxtc-radius: 16px;
	--wxtc-shadow: 0 12px 40px rgba(20, 40, 36, 0.18);

	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99990;
	font-family: inherit;
}

/* --- Toggle-Button --- */
.wxtc__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 18px;
	border: 0;
	border-radius: 999px;
	background: var(--wxtc-accent);
	color: var(--wxtc-accent-ink);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: var(--wxtc-shadow);
	transition: transform 0.15s ease, filter 0.15s ease;
}

.wxtc__toggle:hover {
	filter: brightness(1.06);
	transform: translateY(-1px);
}

.wxtc__toggle-icon {
	font-size: 18px;
	line-height: 1;
}

.wxtc[data-open="true"] .wxtc__toggle {
	display: none;
}

.wxtc[data-open="true"] .wxtc__panel {
	display: flex;
}

/* --- Panel --- */
.wxtc__panel {
	display: none; /* startet minimiert; wird über data-open eingeblendet */
	flex-direction: column;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 40px);
	background: var(--wxtc-bg);
	color: var(--wxtc-ink);
	border-radius: var(--wxtc-radius);
	box-shadow: var(--wxtc-shadow);
	overflow: hidden;
}

.wxtc__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--wxtc-accent);
	color: var(--wxtc-accent-ink);
}

.wxtc__title {
	font-weight: 700;
	font-size: 16px;
}

.wxtc__close {
	border: 0;
	background: transparent;
	color: var(--wxtc-accent-ink);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

.wxtc__log {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--wxtc-bg);
}

.wxtc__msg {
	max-width: 85%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 14.5px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.wxtc__msg--bot {
	align-self: flex-start;
	background: var(--wxtc-bot-bg);
	color: var(--wxtc-ink);
	border-bottom-left-radius: 4px;
}

.wxtc__msg--user {
	align-self: flex-end;
	background: var(--wxtc-accent);
	color: var(--wxtc-accent-ink);
	border-bottom-right-radius: 4px;
}

.wxtc__msg--bot a {
	color: var(--wxtc-accent);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.wxtc__msg--bot a:hover,
.wxtc__msg--bot a:focus {
	text-decoration: none;
}

/* Tipp-Indikator */
.wxtc__typing {
	align-self: flex-start;
	display: inline-flex;
	gap: 4px;
	padding: 12px 14px;
	background: var(--wxtc-bot-bg);
	border-radius: 14px;
	border-bottom-left-radius: 4px;
}

.wxtc__typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--wxtc-muted);
	animation: wxtc-blink 1.2s infinite ease-in-out both;
}

.wxtc__typing span:nth-child(2) { animation-delay: 0.2s; }
.wxtc__typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wxtc-blink {
	0%, 80%, 100% { opacity: 0.25; }
	40% { opacity: 1; }
}

/* --- Eingabe --- */
.wxtc__form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid var(--wxtc-line);
}

.wxtc__input {
	flex: 1 1 auto;
	resize: none;
	border: 1px solid var(--wxtc-line);
	border-radius: 12px;
	padding: 10px 12px;
	font-size: 14.5px;
	font-family: inherit;
	line-height: 1.4;
	max-height: 120px;
	color: var(--wxtc-ink);
	background: #fff;
}

.wxtc__input:focus {
	outline: 2px solid var(--wxtc-accent);
	outline-offset: -1px;
}

.wxtc__send {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 12px;
	background: var(--wxtc-accent);
	color: var(--wxtc-accent-ink);
	font-size: 17px;
	cursor: pointer;
}

.wxtc__send:disabled {
	opacity: 0.5;
	cursor: default;
}

.wxtc__disclaimer {
	margin: 0;
	padding: 8px 14px 12px;
	font-size: 11px;
	line-height: 1.35;
	color: var(--wxtc-muted);
	text-align: center;
}

/* --- Mobile --- */
@media (max-width: 480px) {
	.wxtc {
		right: 12px;
		bottom: 12px;
	}

	.wxtc__panel {
		width: calc(100vw - 24px);
		height: calc(100vh - 24px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.wxtc__toggle,
	.wxtc__typing span {
		transition: none;
		animation: none;
	}
}

/* Utility (falls das Theme .screen-reader-text nicht liefert) */
.wxtc .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
