/**
 * CookieZee — frontend styles
 */

.cookiezee {
	--cz-bg: #0f0f0f;
	--cz-surface: #141414;
	--cz-border: rgba(255, 255, 255, 0.12);
	--cz-text: #ffffff;
	--cz-text-muted: rgba(255, 255, 255, 0.72);

	--cz-purple: #ff9800;
	--cz-glow: rgba(255, 152, 0, 0.5);
	--cz-glow-soft: rgba(255, 152, 0, 0.28);

	--cz-btn-bg: #ff9800;
	--cz-btn-text: #ffffff;
	--cz-btn-radius: 9999px;
	--cz-btn-hover-bg: #ffa726;
	--cz-btn-hover-text: #ffffff;

	--cz-link: #ff9800;
	--cz-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--cz-z: 999999;
}

html.cookiezee-open {
	overflow: hidden;
}

.cookiezee[hidden] {
	display: none !important;
}

.cookiezee:not([hidden]) {
	display: block;
}

.cookiezee__overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: var(--cz-z);
}

.cookiezee__dialog {
	position: fixed;
	z-index: calc(var(--cz-z) + 1);
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	max-height: calc(100vh - 32px);
	overflow: auto;
	background: var(--cz-bg);
	border: 1px solid var(--cz-border);
	border-radius: 20px;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.06),
		0 20px 56px rgba(0, 0, 0, 0.55),
		6px 0 48px var(--cz-glow),
		-4px 0 32px var(--cz-glow-soft);
	color: var(--cz-text);
	font-family: var(--cz-font);
	padding: 28px 32px 20px;
}

.cookiezee__dialog[hidden] {
	display: none !important;
}

.cookiezee__dialog--banner {
	width: min(480px, calc(100vw - 32px));
	text-align: center;
	padding-top: 36px;
}

.cookiezee__dialog--settings {
	width: min(560px, calc(100vw - 32px));
	height: min(640px, calc(100vh - 32px));
	max-height: min(640px, calc(100vh - 32px));
	padding: 24px 22px 18px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.cookiezee__dialog--settings .cookiezee__title {
	flex-shrink: 0;
	margin-bottom: 12px;
}

.cookiezee__settings-scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	margin-bottom: 8px;
	padding-right: 6px;
	scrollbar-width: thin;
	scrollbar-color: var(--cz-btn-bg) transparent;
}

/* Niestandardowy scrollbar — WebKit (Chrome, Safari, Edge) */
.cookiezee__settings-scroll::-webkit-scrollbar,
.cookiezee__dialog--banner::-webkit-scrollbar {
	width: 6px;
	height: 6px;
}

.cookiezee__settings-scroll::-webkit-scrollbar-track,
.cookiezee__dialog--banner::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.04);
	border-radius: 999px;
	margin: 6px 0;
}

.cookiezee__settings-scroll::-webkit-scrollbar-thumb,
.cookiezee__dialog--banner::-webkit-scrollbar-thumb {
	background: linear-gradient(
		180deg,
		color-mix(in srgb, var(--cz-btn-bg) 85%, #fff 15%),
		var(--cz-btn-bg)
	);
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	box-shadow: 0 0 8px var(--cz-glow-soft);
}

.cookiezee__settings-scroll::-webkit-scrollbar-thumb:hover,
.cookiezee__dialog--banner::-webkit-scrollbar-thumb:hover {
	background: var(--cz-btn-hover-bg, var(--cz-btn-bg));
	box-shadow: 0 0 12px var(--cz-glow);
}

.cookiezee__settings-scroll::-webkit-scrollbar-thumb:active,
.cookiezee__dialog--banner::-webkit-scrollbar-thumb:active {
	background: var(--cz-btn-bg);
}

.cookiezee__settings-scroll::-webkit-scrollbar-corner,
.cookiezee__dialog--banner::-webkit-scrollbar-corner {
	background: transparent;
}

@supports not (color: color-mix(in srgb, white, black)) {
	.cookiezee__settings-scroll::-webkit-scrollbar-thumb,
	.cookiezee__dialog--banner::-webkit-scrollbar-thumb {
		background: var(--cz-btn-bg);
	}
}

.cookiezee__dialog--banner {
	scrollbar-width: thin;
	scrollbar-color: var(--cz-btn-bg) rgba(255, 255, 255, 0.04);
}

.cookiezee__dialog--settings .cookiezee__actions--stack,
.cookiezee__dialog--settings .cookiezee__footer {
	flex-shrink: 0;
}

.cookiezee__banner-icon {
	display: flex;
	justify-content: center;
	margin-bottom: 16px;
}

.cookiezee__icon-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--cz-btn-bg) 35%, #1a1028);
	color: var(--cz-btn-text);
	box-shadow: 0 0 24px var(--cz-glow);
}

@supports not (color: color-mix(in srgb, white, black)) {
	.cookiezee__icon-badge {
		background: #2d1b4e;
	}
}

.cookiezee__icon-svg {
	display: block;
	flex-shrink: 0;
}

.cookiezee__title {
	margin: 0 0 16px;
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--cz-text);
}

.cookiezee__title--center {
	font-size: 1.5rem;
	margin-bottom: 14px;
}

.cookiezee__text {
	margin: 0 0 24px;
	font-size: 0.95rem;
	line-height: 1.55;
	color: var(--cz-text-muted);
	max-width: 720px;
	margin-left: auto;
	margin-right: auto;
}

.cookiezee__text--center {
	text-align: center;
}

.cookiezee__link {
	color: var(--cz-link);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cookiezee__link:hover {
	opacity: 0.9;
}

.cookiezee__link--muted {
	text-decoration: none;
	cursor: default;
	opacity: 0.7;
}

.cookiezee__actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	margin-bottom: 20px;
}

.cookiezee__actions--row {
	flex-direction: row;
}

.cookiezee__actions--stack {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
	margin-bottom: 16px;
}

.cookiezee__btn {
	appearance: none;
	border: 1px solid rgba(255, 255, 255, 0.85);
	border-radius: var(--cz-btn-radius);
	background: var(--cz-btn-bg);
	color: var(--cz-btn-text);
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 600;
	line-height: 1.2;
	padding: 11px 18px;
	cursor: pointer;
	transition:
		background-color 0.2s ease,
		color 0.2s ease,
		border-color 0.2s ease,
		transform 0.15s ease;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
	white-space: nowrap;
}

.cookiezee__btn:hover,
.cookiezee__btn:focus-visible {
	background: var(--cz-btn-hover-bg);
	color: var(--cz-btn-hover-text);
	outline: none;
}

.cookiezee__btn:active {
	transform: scale(0.98);
}

.cookiezee__btn--wide {
	flex: 1 1 auto;
	min-width: 200px;
	max-width: 100%;
	white-space: normal;
	text-align: center;
	padding-left: 14px;
	padding-right: 14px;
}

.cookiezee__btn--block {
	flex: 1 1 0;
	min-width: 0;
	padding: 11px 18px;
	font-size: 0.82rem;
	white-space: normal;
	text-align: center;
}

.cookiezee__categories {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 4px;
}

.cookiezee__category {
	background: var(--cz-surface);
	border: 1px solid var(--cz-border);
	border-radius: 12px;
	overflow: hidden;
}

.cookiezee__category-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
}

.cookiezee__category-toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
	min-width: 0;
	background: none;
	border: none;
	color: inherit;
	font: inherit;
	font-weight: 600;
	font-size: 0.92rem;
	text-align: left;
	cursor: pointer;
	padding: 0;
}

.cookiezee__chevron {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
	flex-shrink: 0;
	margin-top: -2px;
}

.cookiezee__category.is-expanded .cookiezee__chevron {
	transform: rotate(-135deg);
	margin-top: 2px;
}

.cookiezee__category-title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cookiezee__switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	flex-shrink: 0;
}

.cookiezee__switch input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}

.cookiezee__switch-slider {
	position: absolute;
	cursor: pointer;
	inset: 0;
	background: #3a3a3a;
	border-radius: 24px;
	transition: background 0.2s ease;
}

.cookiezee__switch-slider::before {
	content: "";
	position: absolute;
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s ease;
}

.cookiezee__switch input:checked + .cookiezee__switch-slider {
	background: var(--cz-btn-bg);
}

.cookiezee__switch input:checked + .cookiezee__switch-slider::before {
	transform: translateX(20px);
}

.cookiezee__switch input:disabled + .cookiezee__switch-slider {
	opacity: 0.95;
	cursor: not-allowed;
}

.cookiezee__category-body {
	display: none;
	padding: 0 14px 14px 32px;
}

.cookiezee__category.is-expanded .cookiezee__category-body {
	display: block;
}

.cookiezee__category-desc {
	margin: 0 0 12px;
	font-size: 0.82rem;
	line-height: 1.5;
	color: var(--cz-text-muted);
}

.cookiezee__category-detail {
	border-top: 1px solid var(--cz-border);
	padding-top: 12px;
}

.cookiezee__cookies-placeholder {
	margin: 0;
	font-size: 0.78rem;
	color: rgba(255, 255, 255, 0.55);
	line-height: 1.45;
}

.cookiezee__cookies-empty {
	margin: 0;
	font-size: 0.78rem;
	color: rgba(255, 255, 255, 0.55);
	line-height: 1.45;
}

.cookiezee__cookie-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cookiezee__cookie-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 6px 8px;
	background: rgba(255, 255, 255, 0.04);
	border-radius: 6px;
	font-size: 0.76rem;
}

.cookiezee__cookie-name {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	color: rgba(255, 255, 255, 0.88);
	word-break: break-all;
}

.cookiezee__cookie-status {
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	flex-shrink: 0;
}

.cookiezee__cookie-status.is-active {
	color: #86efac;
}

.cookiezee__cookie-status.is-inactive {
	color: rgba(255, 255, 255, 0.4);
}

.cookiezee__cookies-note {
	margin: 8px 0 0;
	font-size: 0.68rem;
	color: rgba(255, 255, 255, 0.38);
	line-height: 1.4;
}

/* FAB — lewy dolny róg */
.cookiezee-fab {
	position: fixed;
	left: 18px;
	bottom: 18px;
	z-index: calc(var(--cz-z, 999999) + 2);
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.85);
	background: var(--cz-btn-bg, #5a00a3);
	color: var(--cz-btn-text, #fff);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.1),
		0 6px 20px rgba(0, 0, 0, 0.4),
		0 0 20px var(--cz-glow);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition:
		background-color 0.2s ease,
		transform 0.15s ease,
		box-shadow 0.2s ease;
}

.cookiezee-fab[hidden] {
	display: none !important;
}

.cookiezee-fab:hover,
.cookiezee-fab:focus-visible {
	background: var(--cz-btn-hover-bg, #6d1abf);
	color: var(--cz-btn-hover-text, #fff);
	outline: none;
	transform: scale(1.05);
}

.cookiezee-fab:active {
	transform: scale(0.96);
}

.cookiezee__footer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding-top: 16px;
	margin-top: 4px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cookiezee__footer-label {
	font-size: 0.72rem;
	color: rgba(255, 255, 255, 0.55);
	text-transform: lowercase;
}

.cookiezee__footer-logo {
	height: 18px;
	width: auto;
	display: block;
}

@media (max-width: 720px) {
	.cookiezee__dialog--banner {
		padding: 24px 18px 16px;
	}

	.cookiezee__actions--row,
	.cookiezee__actions--stack {
		flex-direction: column;
		width: 100%;
	}

	.cookiezee__btn,
	.cookiezee__btn--wide,
	.cookiezee__btn--block {
		width: 100%;
		flex: 1 1 auto;
		min-width: 0;
	}
}

@media (min-width: 721px) {
	.cookiezee__actions--row {
		flex-direction: row;
		flex-wrap: nowrap;
	}

	.cookiezee__actions--stack {
		flex-direction: row;
		flex-wrap: nowrap;
	}

	.cookiezee__actions--row .cookiezee__btn--wide {
		flex: 1.4 1 0;
	}
}
