/* KK Compliance – frontend banner.
   Defaults and proportions follow the Complianz banner; every value is driven
   by CSS custom properties that the plugin sets inline. */

.kkc-banner {
	position: fixed;
	z-index: 99999;
	background: var(--kkc-bg, #fff);
	color: var(--kkc-text, #222);
	border-radius: var(--kkc-radius, 12px);
	border: var(--kkc-border-width, 0px) solid var(--kkc-border-color, #f2f2f2);
	font-size: var(--kkc-fs, 12px);
	line-height: 1.5;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	text-align: left;
}
.kkc-shadow { box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15); }

.kkc-banner[hidden],
.kkc-banner .kkc-categories[hidden],
.kkc-banner [data-kkc-action="save"][hidden],
.kkc-banner [data-kkc-action="settings"][hidden],
#kkc-badge[hidden],
#kkc-overlay[hidden] {
	display: none;
}

#kkc-overlay {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(0, 0, 0, 0.45);
}

.kkc-banner-inner { padding: 20px; }

/* Logo: either its own row above the title, or beside it. "inline" keeps the
   banner compact — a square logo no longer pushes the whole box taller. */
.kkc-logo {
	display: block;
	max-height: 40px;
	max-width: 160px;
	width: auto;
}
.kkc-logo-above .kkc-logo { margin-bottom: 12px; }

.kkc-has-logo.kkc-logo-inline .kkc-banner-inner {
	display: grid;
	grid-template-columns: auto 1fr;
	column-gap: 12px;
	align-items: center;
}
.kkc-has-logo.kkc-logo-inline .kkc-logo { grid-column: 1; grid-row: 1; max-height: 44px; }
.kkc-has-logo.kkc-logo-inline .kkc-title { grid-column: 2; grid-row: 1; margin: 0; }
.kkc-has-logo.kkc-logo-inline .kkc-text,
.kkc-has-logo.kkc-logo-inline .kkc-categories,
.kkc-has-logo.kkc-logo-inline .kkc-buttons { grid-column: 1 / -1; }
.kkc-has-logo.kkc-logo-inline .kkc-text { margin-top: 10px; }

/* layouts */
.kkc-layout-box,
.kkc-layout-modal { width: min(var(--kkc-width, 526px), calc(100vw - 20px)); }
.kkc-pos-bottom-right { right: 10px; bottom: 10px; }
.kkc-pos-bottom-left { left: 10px; bottom: 10px; }
.kkc-pos-bottom-center { left: 50%; transform: translateX(-50%); bottom: 10px; }

.kkc-layout-bar {
	left: 0;
	right: 0;
	bottom: 0;
	width: auto;
	border-radius: var(--kkc-radius, 12px) var(--kkc-radius, 12px) 0 0;
}
.kkc-layout-bar .kkc-banner-inner { max-width: 1100px; margin: 0 auto; }

.kkc-layout-modal {
	left: 50%;
	top: 50%;
	right: auto;
	bottom: auto;
	transform: translate(-50%, -50%);
}

.kkc-title {
	margin: 0 0 6px;
	font-size: var(--kkc-title-fs, 15px);
	font-weight: 600;
	line-height: 1.3;
}
.kkc-text { margin-bottom: 14px; }
.kkc-text p { margin: 0 0 8px; }
.kkc-text a { color: var(--kkc-link, #1e73be); text-decoration: underline; }

/* categories – Complianz-style rows with a slider toggle */
.kkc-categories { margin: 0 0 14px; border-top: 1px solid var(--kkc-border-color, #f2f2f2); }
.kkc-cat {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 10px 0;
	border-bottom: 1px solid var(--kkc-border-color, #f2f2f2);
	cursor: pointer;
	margin: 0;
}
.kkc-cat input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	flex: none;
	width: 36px;
	height: 20px;
	margin: 2px 0 0;
	border: 0;
	border-radius: 10px;
	background: #d5d5d5;
	cursor: pointer;
	transition: background 0.15s ease;
}
.kkc-cat input[type="checkbox"]::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	transition: left 0.15s ease;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.kkc-cat input[type="checkbox"]:checked { background: var(--kkc-accent, #1e73be); }
.kkc-cat input[type="checkbox"]:checked::after { left: 18px; }
.kkc-cat input[type="checkbox"]:disabled { opacity: 0.6; cursor: default; }
.kkc-cat-name { display: block; font-weight: 600; font-size: calc(var(--kkc-fs, 12px) + 2px); }
.kkc-cat-desc { display: block; opacity: 0.8; }

/* buttons */
.kkc-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.kkc-btn {
	border: 1px solid transparent;
	cursor: pointer;
	font: inherit;
	font-size: var(--kkc-btn-fs, 15px);
	line-height: 1.2;
	padding: 10px 18px;
	border-radius: var(--kkc-btn-radius, 6px);
	transition: filter 0.15s ease;
	flex: 1 1 auto;
	text-align: center;
}
.kkc-btn:hover { filter: brightness(0.95); }
.kkc-btn-primary { background: var(--kkc-accent, #1e73be); color: var(--kkc-accent-text, #fff); border-color: var(--kkc-accent, #1e73be); }
.kkc-btn-secondary { background: var(--kkc-deny-bg, #f9f9f9); color: var(--kkc-deny-text, #222); border-color: var(--kkc-border-color, #f2f2f2); }
.kkc-btn-ghost { background: var(--kkc-settings-bg, #f9f9f9); color: var(--kkc-settings-text, #333); border-color: var(--kkc-border-color, #f2f2f2); }

/* floating badge */
#kkc-badge {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 99997;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: var(--kkc-accent, #1e73be);
	color: var(--kkc-accent-text, #fff);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* blocked-content placeholder */
.kkc-placeholder {
	background: #f6f6f6;
	border: 1px solid #ececec;
	border-radius: var(--kkc-radius, 12px);
	padding: 32px 20px;
	text-align: center;
	color: #444;
	margin: 8px 0;
}
.kkc-placeholder p { margin: 0 0 12px; }
.kkc-placeholder .kkc-btn { flex: 0 0 auto; }

/* cookie table in documents */
.kkc-table-wrap { overflow-x: auto; margin: 1em 0; }
.kkc-cookie-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.kkc-cookie-table th,
.kkc-cookie-table td {
	border: 1px solid rgba(0, 0, 0, 0.12);
	padding: 8px 10px;
	text-align: left;
	vertical-align: top;
}
.kkc-cookie-table th { background: rgba(0, 0, 0, 0.04); }

@media (max-width: 600px) {
	.kkc-layout-box,
	.kkc-layout-modal { width: calc(100vw - 20px); }
	/* Only the box layout sits in a corner, so only it may be stretched to
	   both edges here. The modal is centred with left/top 50% plus a
	   translate, and the bar already spans the full width — pulling their
	   offsets to 10px would leave the translate in place and drag the modal
	   half off the screen. */
	.kkc-layout-box.kkc-pos-bottom-right,
	.kkc-layout-box.kkc-pos-bottom-left { right: 10px; left: 10px; bottom: 10px; }
}

/* entrance animations (setting: slide | fade | none) */
@media (prefers-reduced-motion: no-preference) {
	.kkc-anim-fade:not([hidden]) { animation: kkc-fade 0.3s ease; }
	@keyframes kkc-fade { from { opacity: 0; } }

	.kkc-anim-slide:not([hidden]) { animation: kkc-slide 0.3s ease; }
	@keyframes kkc-slide { from { opacity: 0; transform: translateY(16px); } }

	.kkc-anim-slide.kkc-pos-bottom-center:not([hidden]) { animation: kkc-slide-center 0.3s ease; }
	@keyframes kkc-slide-center { from { opacity: 0; transform: translate(-50%, 16px); } }

	.kkc-anim-slide.kkc-layout-modal:not([hidden]) { animation: kkc-slide-modal 0.3s ease; }
	@keyframes kkc-slide-modal { from { opacity: 0; transform: translate(-50%, calc(-50% + 16px)); } }
}

/* a placeholder that was moved into a reserved container should fill it */
.kkc-placeholder[data-kkc-ph-target] {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100%;
	height: 100%;
	box-sizing: border-box;
	margin: 0;
}
