/* ==========================================================================
   Woman & Health KI-Assistentin · Leiste und schwebende Kugel (Draft)
   Ergänzt wh-ai.css (Nachrichten, Karten). Alles unter .wh-ai-leiste bzw. .wh-ai-kugel.
   ========================================================================== */
.wh-ai-leiste {
	/* dieselben Variablen wie .wh-ai, damit Nachrichten und Karten aus wh-ai.css passen */
	--wh-ai-gold: #BFA26E;
	--wh-ai-gold-dark: #9a7f4e;
	--wh-ai-ink: #2b2723;
	--wh-ai-muted: #786f65;
	--wh-ai-line: #ebe4d8;
	--wh-ai-soft: #fbf9f3;
	--wh-ai-user: #f3ece0;
	--wh-ai-radius: 18px;
	--wh-ai-gyn: #AE63A4;
	position: relative;
	isolation: isolate;
	overflow: hidden;
	box-sizing: border-box;
	min-height: 122px;          /* Platz fürs Feld schon vor dem Skript, damit nichts springt */
	color: var(--wh-ai-ink);
	font-size: 17px;
	line-height: 1.55;
	background: #fcf9f6;
	border-bottom: 1px solid rgba(191, 162, 110, .18);
}
.wh-ai-leiste *, .wh-ai-leiste *::before, .wh-ai-leiste *::after { box-sizing: border-box; }
.wh-ai-leiste button { font: inherit; color: inherit; }
.wh-ai-leiste svg, .wh-ai-kugel svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Hintergrund: helle Farbwolken in den Bereichsfarben, wandern und wechseln langsam ---- */
.wh-ai-leiste::before,
.wh-ai-leiste::after {
	content: "";
	position: absolute;
	inset: -45% -15%;
	z-index: -1;
	pointer-events: none;
}
.wh-ai-leiste::before {
	background:
		radial-gradient(38% 55% at 12% 35%, rgba(192, 85, 178, .20), transparent 70%),
		radial-gradient(34% 50% at 88% 22%, rgba(88, 174, 242, .22), transparent 70%),
		radial-gradient(40% 55% at 62% 88%, rgba(247, 144, 124, .17), transparent 70%),
		radial-gradient(36% 48% at 34% 82%, rgba(77, 184, 152, .15), transparent 70%),
		radial-gradient(30% 44% at 72% 52%, rgba(214, 172, 92, .17), transparent 70%);
	filter: blur(8px);
	animation: wh-ai-leiste-wolken 26s ease-in-out infinite alternate;
}
.wh-ai-leiste::after {
	background:
		radial-gradient(30% 45% at 78% 70%, rgba(143, 123, 218, .16), transparent 70%),
		radial-gradient(28% 40% at 22% 18%, rgba(247, 144, 124, .13), transparent 70%);
	filter: blur(14px);
	animation: wh-ai-leiste-wolken2 34s ease-in-out infinite alternate;
}
@keyframes wh-ai-leiste-wolken {
	0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); filter: blur(8px) hue-rotate(0deg); }
	50%  { transform: translate3d(5%, -4%, 0) rotate(7deg) scale(1.08); filter: blur(8px) hue-rotate(-25deg); }
	100% { transform: translate3d(-5%, 4%, 0) rotate(-5deg) scale(1.04); filter: blur(8px) hue-rotate(20deg); }
}
@keyframes wh-ai-leiste-wolken2 {
	0%   { transform: translate3d(0, 0, 0) scale(1); }
	100% { transform: translate3d(-8%, -6%, 0) scale(1.15); }
}

.wh-ai-leiste__inner {
	display: flex;
	flex-direction: column;
	max-width: 1020px;
	margin: 0 auto;
	padding: 30px 10px;
}

/* ---- Zusatz unter dem Feld: zu beim Laden, klappt beim ersten Klick ins Feld auf ---- */
.wh-ai-leiste__zusatz {
	display: grid;
	grid-template-rows: 0fr;
	opacity: 0;
	transition: grid-template-rows .45s cubic-bezier(.2, .8, .2, 1), opacity .35s ease .05s;
}
.wh-ai-leiste.is-offen .wh-ai-leiste__zusatz { grid-template-rows: 1fr; opacity: 1; }
.wh-ai-leiste__zusatz-innen { min-height: 0; overflow: hidden; padding: 0 4px; }
.wh-ai-leiste__claim {
	margin: 20px 0 0;
	font-family: "chalet-paris-sixty", sans-serif;   /* wie die Seitentitel */
	font-size: clamp(24px, 3vw, 34px);
	font-weight: 400;
	line-height: 1.3;
	color: var(--wh-ai-ink);
	letter-spacing: -.005em;
}
.wh-ai-leiste__claim em {
	font-style: normal;
	padding-bottom: .14em;      /* Verlauf reicht sonst nicht bis in die Unterlänge (g) */
	background: linear-gradient(100deg, #C055B2, #8F7BDA 30%, #58AEF2 55%, #4DB898 75%, #C055B2);
	background-size: 220% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	animation: wh-ai-leiste-schimmer 9s ease-in-out infinite alternate;
}
@keyframes wh-ai-leiste-schimmer { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

/* ---- Marke „W&H AI“ ---------------------------------------------------- */
.wh-ai-leiste__marke {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--wh-ai-gyn);
}
.wh-ai-leiste .wh-ai-bm, .wh-ai-kugel .wh-ai-bm { width: 34px; height: 34px; fill: currentColor; stroke: none; }
.wh-ai-leiste__marke b {
	font-family: "chalet-london-sixty", sans-serif;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: .1em;
	background: linear-gradient(120deg, #C055B2, #8F7BDA 55%, #58AEF2);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* ---- Eingabe ------------------------------------------------------------ */
.wh-ai-leiste__form {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 7px 7px 12px;
	border: 1px solid rgba(255, 255, 255, .9);
	border-radius: 30px;
	background: rgba(255, 255, 255, .88);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	box-shadow: 0 10px 34px rgba(120, 80, 120, .12), 0 1px 0 rgba(255, 255, 255, .8) inset;
	transition: box-shadow .25s, border-color .25s;
}
.wh-ai-leiste__form:focus-within { border-color: rgba(174, 99, 164, .45); box-shadow: 0 10px 38px rgba(174, 99, 164, .22); }
.wh-ai-leiste__form .wh-ai-leiste__marke { padding-right: 12px; border-right: 1px solid var(--wh-ai-line); }
.wh-ai-leiste__feld {
	flex: 1;
	min-width: 0;
	min-height: 44px;
	max-height: 160px;
	padding: 11px 0;
	resize: none;
	border: 0;
	outline: 0;
	background: transparent;
	font: inherit;
	color: inherit;
	line-height: 1.4;
}
.wh-ai-leiste__feld::placeholder { color: #9d9389; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-ai-leiste__senden {
	flex: none;
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(135deg, #C055B2, #8F7BDA);
	color: #fff !important;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(174, 99, 164, .35);
	transition: transform .2s, box-shadow .2s;
}
.wh-ai-leiste__senden:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(174, 99, 164, .45); }
.wh-ai-leiste__senden:focus-visible, .wh-ai-kugel:focus-visible { outline: 2px solid var(--wh-ai-gold); outline-offset: 3px; }

.wh-ai-leiste__legal { margin: 8px 0 2px; font-size: 12.5px; line-height: 1.5; color: #81776c; }

/* ---- Gesprächsmodus ------------------------------------------------------ */
.wh-ai-leiste__chatkopf, .wh-ai-leiste__log { display: none; }
.wh-ai-leiste.is-chat .wh-ai-leiste__claim { display: none; }
.wh-ai-leiste.is-chat .wh-ai-leiste__chatkopf {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 18px;
	border-radius: 22px 22px 0 0;
	background: rgba(255, 255, 255, .78);
	border-bottom: 1px solid var(--wh-ai-line);
}
.wh-ai-leiste__marke--klein .wh-ai-bm { width: 26px; height: 26px; }
.wh-ai-leiste__marke--klein b { font-size: 14px; }
.wh-ai-leiste__neu {
	display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
	border: 1px solid var(--wh-ai-line); border-radius: 999px; background: #fff;
	font-size: 13.5px; color: var(--wh-ai-muted); cursor: pointer;
}
.wh-ai-leiste__neu svg { width: 16px; height: 16px; }
.wh-ai-leiste.is-chat .wh-ai-leiste__log {
	display: block;
	position: relative;
	/* Eingabe muss mit Header und dem „Termin buchen“-Button der Seite ins Fenster passen */
	max-height: clamp(240px, calc(100vh - 420px), 560px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 4px 20px 16px;
	border-radius: 0 0 22px 22px;
	background: rgba(255, 255, 255, .78);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	text-align: left;
}
.wh-ai-leiste.is-chat .wh-ai-leiste__form { margin-top: 12px; }
.wh-ai-leiste .wh-ai__msg { scroll-margin-top: 12px; }
.wh-ai-leiste[data-state="thinking"] .wh-ai-leiste__form .wh-ai-bm { animation: wh-ai-leiste-puls 1.4s ease-in-out infinite; }
@keyframes wh-ai-leiste-puls { 50% { opacity: .45; transform: scale(.92); } }

/* ---- Schwebende Kugel ------------------------------------------------------ */
.wh-ai-kugel {
	position: fixed;
	right: 26px;
	bottom: 26px;
	z-index: 1150;              /* über der Seiten-Navigation (aside 1100), unter dem Header (1200) */
	width: 74px;
	height: 74px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	opacity: 0;
	transform: translateY(18px) scale(.6);
	pointer-events: none;
	transition: opacity .35s ease, transform .5s cubic-bezier(.2, .9, .25, 1.15);
	-webkit-tap-highlight-color: transparent;
}
.wh-ai-kugel.is-sichtbar { opacity: 1; transform: none; pointer-events: auto; }
.wh-ai-kugel.is-sichtbar:hover { transform: scale(1.07); }
.wh-ai-kugel::before {          /* weicher farbiger Schatten unter der Kugel */
	content: "";
	position: absolute;
	inset: 12% 10% -6%;
	border-radius: 50%;
	background: radial-gradient(closest-side, rgba(143, 123, 218, .45), transparent);
	filter: blur(8px);
	z-index: -1;
}
.wh-ai-kugel canvas { position: absolute; inset: -30%; width: 160%; height: 160%; pointer-events: none; filter: saturate(1.8) contrast(1.06); }
.wh-ai-kugel__label {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1px;
	color: #fff;
	filter: drop-shadow(0 1px 4px rgba(70, 40, 80, .45));
}
.wh-ai-kugel__label .wh-ai-bm { width: 30px; height: 30px; }
.wh-ai-kugel__label b {
	font-family: "chalet-london-sixty", sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .16em;
	line-height: 1;
	margin-left: .16em;
}

@media (max-width: 767px) {
	.wh-ai-leiste { font-size: 16px; min-height: 110px; }
	.wh-ai-leiste__inner { padding: 24px 16px; }
	.wh-ai-leiste__form { padding-left: 10px; gap: 8px; }
	.wh-ai-leiste__form .wh-ai-leiste__marke { padding-right: 8px; }
	.wh-ai-leiste__form .wh-ai-bm { width: 28px; height: 28px; }
	.wh-ai-leiste.is-chat .wh-ai-leiste__log { padding: 2px 14px 14px; max-height: clamp(220px, calc(100vh - 330px), 520px); }
	.wh-ai-kugel { right: 16px; bottom: 84px; width: 64px; height: 64px; }   /* über der Service-Leiste unten */
	.wh-ai-kugel__label .wh-ai-bm { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
	.wh-ai-leiste::before, .wh-ai-leiste::after, .wh-ai-leiste__claim em { animation: none; }
	.wh-ai-leiste__zusatz { transition: none; }
	.wh-ai-kugel { transition: opacity .2s; transform: none; }
}
