/**
 * Nimini Cookie Consent — front-end styles.
 * All classes are namespaced with `ncc-` to avoid theme collisions.
 * Colours come from CSS variables injected by the plugin (--ncc-*).
 */

.ncc-root {
	--ncc-radius: 12px;
	--ncc-shadow: 0 10px 40px rgba( 0, 0, 0, 0.18 );
	--ncc-gap: 12px;
	font-family: inherit;
	line-height: 1.5;
}

.ncc-root *,
.ncc-root *::before,
.ncc-root *::after {
	box-sizing: border-box;
}

/* ---------- Banner ---------- */

.ncc-banner {
	position: fixed;
	z-index: 999999;
	background: var( --ncc-bg, #fff );
	color: var( --ncc-text, #1a1a1a );
	box-shadow: var( --ncc-shadow );
	border-radius: var( --ncc-radius );
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: var( --ncc-gap );
}

.ncc-banner__title {
	margin: 0 0 4px;
	font-size: 1.1rem;
	font-weight: 700;
	color: inherit;
}

.ncc-banner__message {
	margin: 0;
	font-size: 0.92rem;
	color: inherit;
}

.ncc-banner__message a,
.ncc-policy-link {
	color: var( --ncc-accent, #2563eb );
	text-decoration: underline;
}

.ncc-policy-links {
	display: inline-block;
	margin-top: 4px;
}

.ncc-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* Positions */
.ncc-pos-bottom {
	left: 20px;
	right: 20px;
	bottom: 20px;
}

.ncc-pos-top {
	left: 20px;
	right: 20px;
	top: 20px;
}

.ncc-pos-bottom-left {
	left: 20px;
	bottom: 20px;
	max-width: 420px;
}

.ncc-pos-bottom-right {
	right: 20px;
	bottom: 20px;
	max-width: 420px;
}

/* Centered floating box, vertically and horizontally in the viewport. */
.ncc-pos-center {
	left: 50%;
	top: 50%;
	transform: translate( -50%, -50% );
	width: calc( 100% - 40px );
	max-width: 480px;
}

/* Bar layout stretches full width and lays out horizontally on wide screens. */
.ncc-layout-bar.ncc-pos-bottom,
.ncc-layout-bar.ncc-pos-top {
	left: 0;
	right: 0;
	border-radius: 0;
}

@media ( min-width: 782px ) {
	.ncc-layout-bar {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.ncc-layout-bar .ncc-banner__actions {
		flex-shrink: 0;
	}

	.ncc-layout-box.ncc-pos-bottom,
	.ncc-layout-box.ncc-pos-top {
		max-width: 640px;
		margin: 0 auto;
	}
}

/* ---------- Buttons ---------- */

.ncc-btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 10px 16px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	line-height: 1.2;
	transition: opacity 0.15s ease, background 0.15s ease;
	font-family: inherit;
}

.ncc-btn:focus-visible {
	outline: 2px solid var( --ncc-accent, #2563eb );
	outline-offset: 2px;
}

.ncc-btn--primary {
	background: var( --ncc-accent, #2563eb );
	color: var( --ncc-accent-text, #fff );
}

.ncc-btn--primary:hover {
	opacity: 0.9;
}

.ncc-btn--ghost {
	background: transparent;
	color: inherit;
	border-color: currentColor;
	opacity: 0.85;
}

.ncc-btn--ghost:hover {
	opacity: 1;
}

/* ---------- Modal ---------- */

.ncc-modal {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.ncc-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.5 );
}

.ncc-modal__dialog {
	position: relative;
	background: var( --ncc-bg, #fff );
	color: var( --ncc-text, #1a1a1a );
	border-radius: var( --ncc-radius );
	box-shadow: var( --ncc-shadow );
	width: 100%;
	max-width: 520px;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.ncc-modal__header,
.ncc-modal__footer {
	padding: 16px 20px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ncc-modal__header {
	justify-content: space-between;
	border-bottom: 1px solid rgba( 128, 128, 128, 0.25 );
}

.ncc-modal__title {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 700;
}

.ncc-modal__close {
	background: none;
	border: none;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	color: inherit;
	padding: 0 4px;
}

.ncc-modal__content {
	padding: 8px 20px;
	overflow-y: auto;
}

.ncc-modal__footer {
	flex-wrap: wrap;
	justify-content: flex-end;
	border-top: 1px solid rgba( 128, 128, 128, 0.25 );
}

/* ---------- Category rows ---------- */

.ncc-cat {
	padding: 14px 0;
	border-bottom: 1px solid rgba( 128, 128, 128, 0.18 );
}

.ncc-cat:last-child {
	border-bottom: none;
}

.ncc-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.ncc-cat__label {
	font-weight: 600;
	font-size: 0.95rem;
}

.ncc-cat__desc {
	margin: 6px 0 0;
	font-size: 0.85rem;
	opacity: 0.8;
}

/* Toggle switch */
.ncc-switch {
	position: relative;
	flex-shrink: 0;
	width: 44px;
	height: 24px;
}

.ncc-switch__input {
	position: absolute;
	opacity: 0;
	width: 44px;
	height: 24px;
	margin: 0;
	cursor: pointer;
}

.ncc-switch__track {
	position: absolute;
	inset: 0;
	background: #b6b6b6;
	border-radius: 999px;
	transition: background 0.15s ease;
	pointer-events: none;
}

.ncc-switch__track::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.15s ease;
}

.ncc-switch__input:checked + .ncc-switch__track {
	background: var( --ncc-accent, #2563eb );
}

.ncc-switch__input:checked + .ncc-switch__track::after {
	transform: translateX( 20px );
}

.ncc-switch__input:disabled {
	cursor: not-allowed;
}

.ncc-switch__input:disabled + .ncc-switch__track {
	opacity: 0.6;
}

.ncc-switch__input:focus-visible + .ncc-switch__track {
	outline: 2px solid var( --ncc-accent, #2563eb );
	outline-offset: 2px;
}

/* ---------- Revisit button ---------- */

.ncc-revisit {
	position: fixed;
	bottom: 20px;
	z-index: 999998;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: none;
	padding: 0;
	background: var( --ncc-bg, #fff );
	color: var( --ncc-accent, #2563eb );
	cursor: pointer;
	box-shadow: 0 6px 20px rgba( 0, 0, 0, 0.22 );
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ncc-revisit--left {
	left: 20px;
}

.ncc-revisit--right {
	right: 20px;
}

.ncc-revisit:hover {
	transform: scale( 1.08 );
	box-shadow: 0 8px 26px rgba( 0, 0, 0, 0.28 );
}

.ncc-revisit__icon {
	width: 26px;
	height: 26px;
	display: block;
}

.ncc-revisit:focus-visible {
	outline: 2px solid var( --ncc-accent, #2563eb );
	outline-offset: 2px;
}

/* ---------- Dark theme override ---------- */

.ncc-theme-dark {
	--ncc-bg: #1f2430;
	--ncc-text: #f2f4f8;
}

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

@media ( max-width: 600px ) {
	.ncc-banner {
		padding: 16px;
	}

	.ncc-pos-bottom,
	.ncc-pos-top,
	.ncc-pos-bottom-left,
	.ncc-pos-bottom-right {
		left: 12px;
		right: 12px;
		max-width: none;
	}

	.ncc-pos-bottom,
	.ncc-pos-bottom-left,
	.ncc-pos-bottom-right {
		bottom: 12px;
	}

	.ncc-pos-top {
		top: 12px;
	}

	/* Centered box becomes a near-full-width card. */
	.ncc-pos-center {
		width: calc( 100% - 24px );
	}

	/* Stack the action buttons full width for easy tapping. */
	.ncc-banner__actions {
		flex-direction: column;
	}

	.ncc-banner__actions .ncc-btn {
		width: 100%;
	}

	/* Modal fills the screen with small gutters. */
	.ncc-modal {
		padding: 12px;
	}

	.ncc-modal__dialog {
		max-width: none;
		max-height: 92vh;
	}

	.ncc-modal__footer {
		flex-direction: column-reverse;
	}

	.ncc-modal__footer .ncc-btn {
		width: 100%;
	}

	/* Badge sits tighter to the corner on phones. */
	.ncc-revisit {
		width: 46px;
		height: 46px;
		bottom: 14px;
	}

	.ncc-revisit--left {
		left: 14px;
	}

	.ncc-revisit--right {
		right: 14px;
	}
}

/* Respect reduced motion */
@media ( prefers-reduced-motion: reduce ) {
	.ncc-btn,
	.ncc-switch__track,
	.ncc-switch__track::after {
		transition: none;
	}
}
