/*! Bubento. Copyright 2026 LEARNLOGICS SRL. Licensed under the Bubento End-User Licence Agreement: https://www.bubento.com/licence */
/**
 * Bubento Tracking — cookie consent banner.
 *
 * Bottom-right card. Theme-agnostic: every visual property reads through
 * the Bubento token contract (`var(--bubento-*, <literal>)`) so the banner
 * adopts the plugin's own tokens (bubento-tracking-tokens) and degrades to a
 * clean shadcn-neutral palette otherwise. While the site asks for consent
 * (`data-mode="ask"`), Accept and Decline are the same size and equally easy
 * to reach.
 */

.bubento-tracking-cookie-banner {
	position: fixed;
	bottom: 1.25rem;
	right: 1.25rem;
	max-width: 340px;
	z-index: 9999;
	padding: 1rem 1.1rem;
	border-radius: var(--bubento-radius-lg, 8px);
	background: var(--bubento-background, #ffffff);
	color: var(--bubento-foreground, #0a0a0a);
	border: 1px solid var(--bubento-border, #e5e5e5);
	box-shadow: var(--bubento-shadow-lg, 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1));
	font-family: var(--bubento-font-sans, inherit);
	font-size: 0.875rem;
	line-height: 1.5;
	opacity: 0;
	transition: opacity var(--bubento-motion-duration, 150ms) var(--bubento-motion-ease, cubic-bezier(0.4, 0, 0.2, 1));
}

.bubento-tracking-cookie-banner.is-visible {
	opacity: 1;
}

.bubento-tracking-cookie-banner__text {
	margin: 0 0 0.75rem;
	color: inherit;
}

.bubento-tracking-cookie-banner__actions {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	flex-wrap: wrap;
}

.bubento-tracking-cookie-banner__accept,
.bubento-tracking-cookie-banner__decline {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	min-width: 6rem;
	min-height: 44px;
	margin: 0;
	padding: 0.55rem 1.1rem;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1.2;
	border-radius: var(--bubento-radius-md, 6px);
	cursor: pointer;
	transition: background-color var(--bubento-motion-duration, 150ms) var(--bubento-motion-ease, cubic-bezier(0.4, 0, 0.2, 1)), color var(--bubento-motion-duration, 150ms) var(--bubento-motion-ease, cubic-bezier(0.4, 0, 0.2, 1));
}

.bubento-tracking-cookie-banner[data-mode="ask"] .bubento-tracking-cookie-banner__accept,
.bubento-tracking-cookie-banner[data-mode="ask"] .bubento-tracking-cookie-banner__decline {
	flex: 1 1 0;
}

.bubento-tracking-cookie-banner__accept {
	color: var(--bubento-primary-foreground, #ffffff);
	background: var(--bubento-primary, #171717);
	border: 1px solid var(--bubento-primary, #171717);
}

.bubento-tracking-cookie-banner__accept:hover {
	background: color-mix(in srgb, var(--bubento-primary, #171717) 90%, var(--bubento-background, #ffffff));
}

.bubento-tracking-cookie-banner__decline {
	color: var(--bubento-foreground, #0a0a0a);
	background: var(--bubento-background, #ffffff);
	border: 1px solid var(--bubento-input, #878787);
}

.bubento-tracking-cookie-banner__decline:hover {
	color: var(--bubento-accent-foreground, #171717);
	background: var(--bubento-accent, #f5f5f5);
}

.bubento-tracking-cookie-banner__accept:focus-visible,
.bubento-tracking-cookie-banner__decline:focus-visible {
	outline: 2px solid var(--bubento-ring, #171717);
	outline-offset: 2px;
}

.bubento-tracking-cookie-banner .bubento-tracking-cookie-banner__policy {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
	white-space: nowrap;
}

.bubento-tracking-cookie-banner .bubento-tracking-cookie-banner__policy:hover {
	color: var(--bubento-primary, #171717);
}

.bubento-tracking-cookie-banner .bubento-tracking-cookie-banner__policy:focus-visible {
	outline: 2px solid var(--bubento-ring, #171717);
	outline-offset: 2px;
}

@media (max-width: 600px) {
	.bubento-tracking-cookie-banner {
		left: 1rem;
		right: 1rem;
		bottom: 1rem;
		max-width: none;
	}
}

/* Bubento AI Chat's button shares the bottom-right corner on any theme: keep the banner beside it. */
body:has(.bubento-ai-chat__launcher) .bubento-tracking-cookie-banner {
	right: calc(20px + 56px + 0.75rem + env(safe-area-inset-right, 0px));
}

@media (max-width: 600px) {
	body:has(.bubento-ai-chat__launcher) .bubento-tracking-cookie-banner {
		left: 1rem;
		right: calc(20px + 56px + 0.5rem + env(safe-area-inset-right, 0px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.bubento-tracking-cookie-banner,
	.bubento-tracking-cookie-banner *,
	.bubento-tracking-cookie-banner *::before,
	.bubento-tracking-cookie-banner *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
