/**
 * Diagnose to Cure Health Assistant V2 — front-end styles.
 *
 * All selectors are prefixed `dtc-hav2-` to avoid colliding with WooCommerce,
 * Elementor, the active theme, or the v1 plugin (which uses `dtc-ha-`). Colours
 * default to white surfaces with a subtle pink accent; the accent is overridable
 * via the `--dtc-hav2-accent` variable set from the plugin settings.
 */

.dtc-hav2-widget,
.dtc-hav2-panel {
	--dtc-hav2-accent: #e8558a;
	--dtc-hav2-accent-soft: #fdeef4;
	--dtc-hav2-text: #23212b;
	--dtc-hav2-muted: #6b6577;
	--dtc-hav2-border: #ece7ef;
	--dtc-hav2-surface: #ffffff;
	--dtc-hav2-error: #b3261e;
	--dtc-hav2-error-bg: #fdecea;
	box-sizing: border-box;
}

.dtc-hav2-widget *,
.dtc-hav2-panel * {
	box-sizing: border-box;
}

/* ------------------------------------------------------------------ */
/* Floating button                                                     */
/* ------------------------------------------------------------------ */

.dtc-hav2-fab {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 2147482000;
	width: 56px;
	height: 56px;
	border: none;
	border-radius: 50%;
	background: var(--dtc-hav2-accent);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(232, 85, 138, 0.35);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dtc-hav2-fab:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 26px rgba(232, 85, 138, 0.45);
}

.dtc-hav2-fab:focus-visible {
	outline: 3px solid var(--dtc-hav2-accent-soft);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Panel (shared by floating and inline)                               */
/* ------------------------------------------------------------------ */

.dtc-hav2-panel {
	background: var(--dtc-hav2-surface);
	color: var(--dtc-hav2-text);
	border: 1px solid var(--dtc-hav2-border);
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(35, 33, 43, 0.16);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.5;
}

.dtc-hav2-panel--float {
	position: fixed;
	right: 20px;
	bottom: 88px;
	z-index: 2147482000;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 120px);
}

.dtc-hav2-panel--inline {
	max-width: 820px;
	margin: 0 auto;
	height: 600px;
	max-height: 80vh;
}

.dtc-hav2-panel__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 14px;
	border-bottom: 1px solid var(--dtc-hav2-border);
	background: var(--dtc-hav2-surface);
}

.dtc-hav2-panel__title {
	font-weight: 600;
	font-size: 15px;
}

.dtc-hav2-panel__close {
	border: none;
	background: transparent;
	color: var(--dtc-hav2-muted);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

.dtc-hav2-panel__close:hover {
	color: var(--dtc-hav2-accent);
}

/* ------------------------------------------------------------------ */
/* Conversation                                                        */
/* ------------------------------------------------------------------ */

.dtc-hav2-log {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--dtc-hav2-surface);
}

.dtc-hav2-msg {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 9px 12px;
	border-radius: 12px;
	max-width: 88%;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	white-space: pre-wrap;
}

.dtc-hav2-msg--assistant {
	align-self: flex-start;
	background: var(--dtc-hav2-accent-soft);
	border: 1px solid var(--dtc-hav2-border);
}

.dtc-hav2-msg--user {
	align-self: flex-end;
	background: #f4f2f6;
	border: 1px solid var(--dtc-hav2-border);
}

.dtc-hav2-msg__role {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--dtc-hav2-muted);
}

.dtc-hav2-msg__body {
	font-size: 14px;
}

.dtc-hav2-loading {
	color: var(--dtc-hav2-muted);
	font-style: italic;
}

.dtc-hav2-error {
	background: var(--dtc-hav2-error-bg);
	border: 1px solid #f3c4c0;
	color: var(--dtc-hav2-error);
	padding: 9px 12px;
	border-radius: 10px;
	font-size: 13.5px;
}

/* ------------------------------------------------------------------ */
/* Form                                                                */
/* ------------------------------------------------------------------ */

.dtc-hav2-form {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid var(--dtc-hav2-border);
	background: var(--dtc-hav2-surface);
	align-items: flex-end;
}

.dtc-hav2-input {
	flex: 1;
	resize: none;
	min-height: 42px;
	max-height: 120px;
	padding: 9px 10px;
	border: 1px solid var(--dtc-hav2-border);
	border-radius: 10px;
	font: inherit;
	color: var(--dtc-hav2-text);
	background: #fff;
}

.dtc-hav2-input:focus {
	outline: none;
	border-color: var(--dtc-hav2-accent);
	box-shadow: 0 0 0 3px var(--dtc-hav2-accent-soft);
}

.dtc-hav2-send {
	border: none;
	border-radius: 10px;
	background: var(--dtc-hav2-accent);
	color: #fff;
	padding: 10px 16px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.dtc-hav2-send:hover:not(:disabled) {
	filter: brightness(0.95);
}

.dtc-hav2-send:disabled,
.dtc-hav2-input:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

/* ------------------------------------------------------------------ */
/* Notices                                                             */
/* ------------------------------------------------------------------ */

.dtc-hav2-notice,
.dtc-hav2-disclaimer {
	margin: 0;
	padding: 8px 14px;
	font-size: 12px;
	color: var(--dtc-hav2-muted);
	background: var(--dtc-hav2-surface);
	border-top: 1px solid var(--dtc-hav2-border);
}

.dtc-hav2-notice {
	color: var(--dtc-hav2-accent);
	font-weight: 600;
}

.dtc-hav2-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

/* ------------------------------------------------------------------ */
/* Mobile                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 480px) {
	.dtc-hav2-fab {
		right: 14px;
		bottom: 74px;
	}

	.dtc-hav2-panel--float {
		right: 0;
		left: 0;
		bottom: 0;
		width: 100%;
		max-width: 100%;
		height: 78vh;
		max-height: 78vh;
		border-radius: 16px 16px 0 0;
	}

	.dtc-hav2-panel--inline {
		height: 70vh;
		max-height: 70vh;
		border-radius: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dtc-hav2-fab {
		transition: none;
	}
}
