/**
 * Pixoraa Chatbot - dark glassmorphism widget.
 * Accent, surface and font come from CSS variables set inline from the
 * Elementor kit; the values here are the fallbacks.
 */

.pixoraa-cb {
	--pixoraa-cb-accent: #C50000;
	--pixoraa-cb-dark: #0E0E0E;
	--pixoraa-cb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

	--pixoraa-cb-glass: rgba(20, 20, 22, 0.72);
	--pixoraa-cb-glass-strong: rgba(12, 12, 14, 0.86);
	--pixoraa-cb-border: rgba(255, 255, 255, 0.14);
	--pixoraa-cb-text: #F4F4F5;
	--pixoraa-cb-muted: rgba(244, 244, 245, 0.62);
	--pixoraa-cb-bubble: rgba(255, 255, 255, 0.08);

	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99999;
	font-family: var(--pixoraa-cb-font);
	font-size: 15px;
	line-height: 1.5;
	direction: ltr;
}

.pixoraa-cb *,
.pixoraa-cb *::before,
.pixoraa-cb *::after {
	box-sizing: border-box;
}

/* --------------------------------------------------------------- launcher */

.pixoraa-cb__launcher {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 62px;
	height: 62px;
	margin-left: auto;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 50%;
	/* Solid accent is the fallback; the glass version is layered on in the
	   @supports block below, so old browsers still get a visible red button. */
	background: var(--pixoraa-cb-accent);
	color: #fff;
	cursor: pointer;
	box-shadow:
		0 10px 30px rgba(197, 0, 0, 0.45),
		0 2px 8px rgba(0, 0, 0, 0.4),
		inset 0 1px 0 rgba(255, 255, 255, 0.25);
	transition:
		transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 0.3s ease,
		background 0.3s ease,
		border-color 0.3s ease;
	-webkit-tap-highlight-color: transparent;
}

/* Specular highlight across the top-left, the way light catches real glass. */
.pixoraa-cb__launcher::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: linear-gradient(
		140deg,
		rgba(255, 255, 255, 0.5) 0%,
		rgba(255, 255, 255, 0.1) 38%,
		rgba(255, 255, 255, 0) 62%
	);
	opacity: 0.5;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

/* Keep the icons above the sheen: ::before is positioned, so without this it
   would paint over the non-positioned icon. */
.pixoraa-cb__launcher-icon,
.pixoraa-cb__launcher-close {
	position: relative;
	z-index: 1;
}

.pixoraa-cb__launcher:hover {
	transform: translateY(-3px) scale(1.07);
	border-color: rgba(255, 255, 255, 0.42);
	box-shadow:
		0 18px 44px rgba(197, 0, 0, 0.6),
		0 4px 12px rgba(0, 0, 0, 0.5),
		inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.pixoraa-cb__launcher:hover::before {
	opacity: 0.95;
}

.pixoraa-cb__launcher:active {
	transform: translateY(-1px) scale(1.02);
}

/* Frosted glass, only where the browser can actually blur and mix colours.
   color-mix keeps the tint tied to the Elementor accent instead of a
   hardcoded rgba(). */
@supports (
	((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)))
	and (background: color-mix(in srgb, red 50%, transparent))
) {
	.pixoraa-cb__launcher {
		background: linear-gradient(
			135deg,
			color-mix(in srgb, var(--pixoraa-cb-accent) 68%, transparent),
			color-mix(in srgb, var(--pixoraa-cb-accent) 34%, transparent)
		);
		-webkit-backdrop-filter: blur(16px) saturate(180%);
		backdrop-filter: blur(16px) saturate(180%);
	}

	.pixoraa-cb__launcher:hover {
		background: linear-gradient(
			135deg,
			color-mix(in srgb, var(--pixoraa-cb-accent) 92%, transparent),
			color-mix(in srgb, var(--pixoraa-cb-accent) 58%, transparent)
		);
	}
}

.pixoraa-cb__launcher:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

/* Pulse ring to draw the eye, once the page settles. */
.pixoraa-cb__launcher::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid var(--pixoraa-cb-accent);
	animation: pixoraa-cb-pulse 2.6s ease-out infinite;
}

.pixoraa-cb.is-open .pixoraa-cb__launcher::after {
	display: none;
}

@keyframes pixoraa-cb-pulse {
	0%   { transform: scale(1); opacity: 0.7; }
	70%  { transform: scale(1.5); opacity: 0; }
	100% { transform: scale(1.5); opacity: 0; }
}

.pixoraa-cb__launcher svg {
	width: 28px;
	height: 28px;
	display: block;
}

.pixoraa-cb__launcher-icon,
.pixoraa-cb__launcher-close {
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.3s ease, opacity 0.2s ease;
}

.pixoraa-cb__launcher-close {
	position: absolute;
	opacity: 0;
	transform: rotate(-90deg) scale(0.6);
}

.pixoraa-cb.is-open .pixoraa-cb__launcher-icon {
	opacity: 0;
	transform: rotate(90deg) scale(0.6);
}

.pixoraa-cb.is-open .pixoraa-cb__launcher-close {
	opacity: 1;
	transform: rotate(0) scale(1);
}

/* ------------------------------------------------------------------ panel */

.pixoraa-cb__panel {
	position: absolute;
	right: 0;
	bottom: 78px;
	display: flex;
	flex-direction: column;
	width: 370px;
	max-width: calc(100vw - 32px);
	height: 540px;
	max-height: calc(100vh - 130px);
	overflow: hidden;
	border: 1px solid var(--pixoraa-cb-border);
	border-radius: 20px;
	background: var(--pixoraa-cb-glass);
	-webkit-backdrop-filter: blur(22px) saturate(160%);
	backdrop-filter: blur(22px) saturate(160%);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
	color: var(--pixoraa-cb-text);
	opacity: 0;
	transform: translateY(14px) scale(0.97);
	transform-origin: bottom right;
	transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
	pointer-events: none;
}

/* Browsers without backdrop-filter get a solid dark panel instead of a
   washed-out translucent one. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.pixoraa-cb__panel {
		background: var(--pixoraa-cb-glass-strong);
	}
}

.pixoraa-cb__panel[hidden] {
	display: none;
}

.pixoraa-cb.is-open .pixoraa-cb__panel {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* Red glow bleeding in from the top, tinting the glass. */
.pixoraa-cb__panel::before {
	content: "";
	position: absolute;
	top: -60px;
	right: -40px;
	width: 220px;
	height: 180px;
	border-radius: 50%;
	background: var(--pixoraa-cb-accent);
	opacity: 0.28;
	filter: blur(60px);
	pointer-events: none;
}

/* ----------------------------------------------------------------- header */

.pixoraa-cb__header {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
	padding: 16px 16px 14px;
	border-bottom: 1px solid var(--pixoraa-cb-border);
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
}

.pixoraa-cb__avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: var(--pixoraa-cb-accent);
	color: #fff;
	box-shadow: 0 4px 14px rgba(197, 0, 0, 0.4);
}

.pixoraa-cb__avatar svg {
	width: 22px;
	height: 22px;
}

.pixoraa-cb__heading {
	display: flex;
	flex-direction: column;
	min-width: 0;
	gap: 2px;
}

.pixoraa-cb__title {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.2px;
	color: var(--pixoraa-cb-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pixoraa-cb__subtitle {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--pixoraa-cb-muted);
}

.pixoraa-cb__status-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #22C55E;
	box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
	animation: pixoraa-cb-blink 2s infinite;
}

@keyframes pixoraa-cb-blink {
	0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
	70%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
	100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.pixoraa-cb__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin-left: auto;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--pixoraa-cb-muted);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.pixoraa-cb__close:hover {
	background: rgba(255, 255, 255, 0.1);
	color: var(--pixoraa-cb-text);
}

.pixoraa-cb__close:focus-visible {
	outline: 2px solid var(--pixoraa-cb-accent);
	outline-offset: 2px;
}

.pixoraa-cb__close svg {
	width: 16px;
	height: 16px;
}

/* --------------------------------------------------------------- messages */

.pixoraa-cb__messages {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 18px 16px 8px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.pixoraa-cb__messages::-webkit-scrollbar {
	width: 6px;
}

.pixoraa-cb__messages::-webkit-scrollbar-thumb {
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.18);
}

.pixoraa-cb__row {
	display: flex;
	max-width: 100%;
	animation: pixoraa-cb-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pixoraa-cb__row--bot  { justify-content: flex-start; }
.pixoraa-cb__row--user { justify-content: flex-end; }

@keyframes pixoraa-cb-in {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

.pixoraa-cb__bubble {
	max-width: 82%;
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.55;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.pixoraa-cb__row--bot .pixoraa-cb__bubble {
	border: 1px solid var(--pixoraa-cb-border);
	border-bottom-left-radius: 5px;
	background: var(--pixoraa-cb-bubble);
	color: var(--pixoraa-cb-text);
}

.pixoraa-cb__row--user .pixoraa-cb__bubble {
	border-bottom-right-radius: 5px;
	background: var(--pixoraa-cb-accent);
	color: #fff;
	font-weight: 500;
	box-shadow: 0 4px 14px rgba(197, 0, 0, 0.35);
}

.pixoraa-cb__bubble--error {
	border-color: rgba(255, 120, 120, 0.5) !important;
	background: rgba(197, 0, 0, 0.18) !important;
	color: #FFD9D9 !important;
}

/* Typing indicator */
.pixoraa-cb__typing {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 13px 14px;
}

.pixoraa-cb__typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--pixoraa-cb-muted);
	animation: pixoraa-cb-bounce 1.3s infinite ease-in-out;
}

.pixoraa-cb__typing span:nth-child(2) { animation-delay: 0.16s; }
.pixoraa-cb__typing span:nth-child(3) { animation-delay: 0.32s; }

@keyframes pixoraa-cb-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30%           { transform: translateY(-5px); opacity: 1; }
}

/* ---------------------------------------------------------------- choices */

.pixoraa-cb__choices {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 2px 0 6px;
	animation: pixoraa-cb-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pixoraa-cb__choice {
	padding: 9px 18px;
	border: 1px solid var(--pixoraa-cb-accent);
	border-radius: 999px;
	background: rgba(197, 0, 0, 0.12);
	color: var(--pixoraa-cb-text);
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.pixoraa-cb__choice:hover {
	background: var(--pixoraa-cb-accent);
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(197, 0, 0, 0.4);
}

.pixoraa-cb__choice:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* --------------------------------------------------------------- composer */

.pixoraa-cb__composer {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	padding: 12px 14px;
	border-top: 1px solid var(--pixoraa-cb-border);
	background: rgba(255, 255, 255, 0.04);
}

.pixoraa-cb__composer[hidden] {
	display: none;
}

.pixoraa-cb__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 42px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--pixoraa-cb-border);
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.35);
	color: var(--pixoraa-cb-text);
	font-family: inherit;
	font-size: 14px;
	line-height: normal;
	box-shadow: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pixoraa-cb__input::placeholder {
	color: rgba(244, 244, 245, 0.4);
}

.pixoraa-cb__input:focus {
	border-color: var(--pixoraa-cb-accent);
	box-shadow: 0 0 0 3px rgba(197, 0, 0, 0.22);
	outline: none;
}

.pixoraa-cb__send {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--pixoraa-cb-accent);
	color: #fff;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.pixoraa-cb__send:hover {
	transform: scale(1.06);
	box-shadow: 0 6px 18px rgba(197, 0, 0, 0.45);
}

.pixoraa-cb__send:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.pixoraa-cb__send svg {
	width: 18px;
	height: 18px;
	margin-left: 2px; /* Optical centering for the right-pointing arrow. */
}

/* Honeypot: off-screen but not display:none, so bots still fill it. */
.pixoraa-cb__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.pixoraa-cb .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ----------------------------------------------------------------- mobile */

@media (max-width: 480px) {
	.pixoraa-cb {
		right: 16px;
		bottom: 16px;
	}

	.pixoraa-cb__launcher {
		width: 56px;
		height: 56px;
	}

	.pixoraa-cb__panel {
		position: fixed;
		right: 12px;
		left: 12px;
		bottom: 84px;
		width: auto;
		max-width: none;
		height: min(70vh, 520px);
		max-height: calc(100vh - 110px);
		border-radius: 18px;
	}

	/* 16px keeps iOS from zooming the page on focus. */
	.pixoraa-cb__input {
		font-size: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pixoraa-cb *,
	.pixoraa-cb *::before,
	.pixoraa-cb *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
}
