/**
 * Cookie Consent Frontend Banner Stylesheet
 *
 * Clean, modern dark-theme banner featuring smooth CSS transitions,
 * fully responsive flex layouts, and accent-color integration.
 */

:root {
	--bst-cc-bg: #1e293b;
	--bst-cc-bg-alt: #0f172a;
	--bst-cc-text: #f8fafc;
	--bst-cc-text-muted: #cbd5e1;
	--bst-cc-border: #334155;
	--bst-cc-accent: #2271b1; /* Fallback accent color; overridden dynamically by JS */
}

/* Banner Wrap Container */
#bst-cc-banner {
	position: fixed;
	left: 0;
	width: 100%;
	z-index: 999999;
	background-color: var(--bst-cc-bg);
	color: var(--bst-cc-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
	border-top: 1px solid var(--bst-cc-border);
	box-sizing: border-box;
	padding: 20px;
	transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
	opacity: 0;
}

/* Hide State */
#bst-cc-banner.bst-cc--hidden {
	opacity: 0;
	pointer-events: none;
}

/* Position Bottom configuration */
#bst-cc-banner.bst-cc--position-bottom {
	bottom: 0;
	transform: translateY(100%);
}

#bst-cc-banner.bst-cc--position-bottom.bst-cc--visible {
	opacity: 1;
	transform: translateY(0);
}

/* Position Top configuration */
#bst-cc-banner.bst-cc--position-top {
	top: 0;
	transform: translateY(-100%);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	border-top: none;
	border-bottom: 1px solid var(--bst-cc-border);
}

#bst-cc-banner.bst-cc--position-top.bst-cc--visible {
	opacity: 1;
	transform: translateY(0);
}

/* --- Layout Variants --- */

/* Bar Style (Full width) */
#bst-cc-banner.bst-cc--bar {
	/* Standard full-width settings */
	border-radius: 0;
}

/* Box Style (Floating bottom-right or top-right) */
#bst-cc-banner.bst-cc--box {
	left: auto;
	right: 20px;
	width: calc(100% - 40px);
	max-width: 420px;
	border-radius: 8px;
	border: 1px solid var(--bst-cc-border);
}

#bst-cc-banner.bst-cc--box.bst-cc--position-bottom {
	bottom: 20px;
	transform: translateY(calc(100% + 20px));
}

#bst-cc-banner.bst-cc--box.bst-cc--position-bottom.bst-cc--visible {
	transform: translateY(0);
}

#bst-cc-banner.bst-cc--box.bst-cc--position-top {
	top: 20px;
	bottom: auto;
	transform: translateY(calc(-100% - 20px));
}

#bst-cc-banner.bst-cc--box.bst-cc--position-top.bst-cc--visible {
	transform: translateY(0);
}

#bst-cc-banner.bst-cc--top {
	top: 0;
	bottom: auto;
}

#bst-cc-banner.bst-cc--bottom {
	bottom: 0;
	top: auto;
}

/* Inside container */
.bst-cc-inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Overview Bar (Message and main buttons) */
.bst-cc-overview {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 30px;
}

.bst-cc-message {
	flex-grow: 1;
}

.bst-cc-message h2 {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 6px 0;
	color: var(--bst-cc-text);
}

.bst-cc-message p {
	font-size: 13px;
	line-height: 1.5;
	margin: 0;
	color: var(--bst-cc-text-muted);
}

.bst-cc-message a {
	color: var(--bst-cc-accent);
	text-decoration: underline;
}

.bst-cc-message a:hover {
	color: #fff;
}

/* Button Group */
.bst-cc-buttons {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.bst-cc-btn {
	font-size: 13px;
	font-weight: 600;
	padding: 10px 18px;
	border-radius: 4px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, color 0.15s ease-in-out;
	text-align: center;
	white-space: nowrap;
}

.bst-cc-btn-accept {
	background-color: var(--bst-cc-accent);
	color: #fff;
}

.bst-cc-btn-accept:hover {
	filter: brightness(1.1);
}

.bst-cc-btn-necessary {
	background-color: #334155;
	color: var(--bst-cc-text);
	border-color: #475569;
}

.bst-cc-btn-necessary:hover {
	background-color: #475569;
}

.bst-cc-btn-preferences {
	background-color: transparent;
	color: var(--bst-cc-text-muted);
	padding-left: 10px;
	padding-right: 10px;
}

.bst-cc-btn-preferences:hover {
	color: #fff;
}

/* Preferences Details Panel (Inline, starts closed) */
.bst-cc-preferences {
	display: none;
	border-top: 1px solid var(--bst-cc-border);
	padding-top: 20px;
	margin-top: 5px;
	background-color: var(--bst-cc-bg-alt);
	border-radius: 6px;
	padding: 20px;
}

.bst-cc-preferences.bst-cc--open {
	display: block;
}

.bst-cc-categories {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 20px;
}

.bst-cc-category-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--bst-cc-border);
}

.bst-cc-category-row:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.bst-cc-category-info {
	flex-grow: 1;
}

.bst-cc-category-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--bst-cc-text);
	margin: 0 0 4px 0;
}

.bst-cc-category-desc {
	font-size: 12px;
	line-height: 1.5;
	color: var(--bst-cc-text-muted);
	margin: 0;
}

/* Slider Toggle Styles for Banner */
.bst-cc-category-row .bst-switch {
	position: relative;
	display: inline-block;
	width: 40px;
	height: 24px;
	flex-shrink: 0;
	margin-top: 2px;
}

.bst-cc-category-row .bst-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.bst-cc-category-row .bst-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #475569;
	transition: background-color 0.2s ease-in-out;
	border-radius: 24px;
}

.bst-cc-category-row .bst-slider:before {
	position: absolute;
	content: "";
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: #fff;
	transition: transform 0.2s ease-in-out;
	border-radius: 50%;
}

.bst-cc-category-row .bst-switch input:checked + .bst-slider {
	background-color: var(--bst-cc-accent);
}

.bst-cc-category-row .bst-switch input:disabled + .bst-slider {
	opacity: 0.5;
	cursor: not-allowed;
}

.bst-cc-category-row .bst-switch input:checked + .bst-slider:before {
	transform: translateX(16px);
}

/* Footer Link Trigger styling */
.bst-cc-trigger {
	cursor: pointer;
}

/* --- Persistent Reopen Button --- */
#bst-cc-reopen-wrap {
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 999998;
	transition: opacity 0.3s ease;
	opacity: 1;
}

#bst-cc-reopen-wrap.bst-cc-reopen--hidden {
	opacity: 0;
	pointer-events: none;
}

#bst-cc-reopen {
	font-size: 11px;
	font-weight: 600;
	background-color: var(--bst-cc-bg);
	color: var(--bst-cc-text-muted);
	border: 1px solid var(--bst-cc-border);
	padding: 8px 14px;
	border-radius: 4px;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

#bst-cc-reopen:hover {
	background-color: var(--bst-cc-accent);
	color: #fff;
	border-color: var(--bst-cc-accent);
}

/* --- Details & Cookies Table Styles --- */
.bst-cc-cookies-details {
	margin-top: 20px;
	border-top: 1px solid var(--bst-cc-border);
	padding-top: 15px;
}

.bst-cc-cookies-summary {
	font-size: 13px;
	font-weight: 600;
	color: var(--bst-cc-text-muted);
	cursor: pointer;
	outline: none;
	padding: 5px 0;
	transition: color 0.15s ease;
}

.bst-cc-cookies-summary:hover {
	color: #fff;
}

.bst-cc-cookies-table-wrap {
	margin-top: 10px;
	overflow-x: auto;
	max-height: 200px;
	border: 1px solid var(--bst-cc-border);
	border-radius: 4px;
}

.bst-cc-cookies-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 11px;
	text-align: left;
}

.bst-cc-cookies-table th,
.bst-cc-cookies-table td {
	padding: 10px;
	border-bottom: 1px solid var(--bst-cc-border);
}

.bst-cc-cookies-table th {
	color: var(--bst-cc-text);
	font-weight: 700;
	background-color: var(--bst-cc-bg-alt);
}

.bst-cc-cookies-table td {
	color: var(--bst-cc-text-muted);
}

.bst-cc-cookies-table code {
	background-color: var(--bst-cc-bg-alt);
	padding: 2px 4px;
	border-radius: 3px;
	color: var(--bst-cc-text);
	font-family: Consolas, Monaco, monospace;
}

.bst-cc-cookie-cat-header {
	background-color: rgba(255, 255, 255, 0.05);
}

.bst-cc-cookie-cat-header td {
	color: var(--bst-cc-text) !important;
	padding-top: 12px;
	padding-bottom: 12px;
}

/* Responsive banner */
@media (max-width: 768px) {
	.bst-cc-overview {
		flex-direction: column;
		align-items: stretch;
		gap: 20px;
	}

	.bst-cc-buttons {
		flex-direction: column;
		align-items: stretch;
	}

	.bst-cc-category-row {
		gap: 10px;
	}

	#bst-cc-banner.bst-cc--box {
		right: 10px;
		width: calc(100% - 20px);
		max-width: none;
	}
}
