/**
 * Advanced Consent Mode Manager Front-End Styles
 */

/* Main Banner Containers */
#baton-consent-banner {
	position: fixed;
	z-index: 999999;
	font-family: var(--bcm-font-family, system-ui, -apple-system, sans-serif);
	font-size: var(--bcm-font-size, 14px);
	background: var(--bcm-bg, #ffffff);
	color: var(--bcm-text, #1f2937);
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
	box-sizing: border-box;
	transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
	overflow: hidden;
}

#baton-consent-banner * {
	box-sizing: border-box;
}

/* Position Configurations */
/* 1. Bottom Banner */
.bcm-banner-bottom-banner {
	bottom: 0;
	left: 0;
	right: 0;
	width: 100%;
	padding: 20px 40px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* 2. Top Banner */
.bcm-banner-top-banner {
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	padding: 20px 40px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

/* 3. Bottom Right Card */
.bcm-banner-bottom-right {
	bottom: 30px;
	right: 30px;
	width: 450px;
	max-width: calc(100vw - 60px);
	padding: 25px;
	border-radius: 12px;
	border: 1px solid rgba(0, 0, 0, 0.05);
	max-height: 85vh;
	overflow-y: auto !important;
}

/* 4. Centered Modal */
.bcm-banner-modal {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 600px;
	max-width: calc(100vw - 40px);
	padding: 30px;
	border-radius: 16px;
	border: 1px solid rgba(0, 0, 0, 0.05);
	max-height: 90vh;
	overflow-y: auto !important;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
}

/* Overlays */
#bcm-banner-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999998;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(4px);
	transition: opacity 0.3s ease;
}

/* Inner layout */
.bcm-banner-inner {
	display: flex;
	flex-direction: column;
	gap: 20px;
	width: 100%;
}

#baton-consent-banner h2,
#baton-consent-banner .bcm-banner-content h2 {
	margin-top: 0;
	margin-bottom: 10px;
	font-size: var(--bcm-title-size, 1.25em);
	font-weight: var(--bcm-title-weight, 700);
	line-height: 1.3;
	color: var(--bcm-text, #1f2937);
}

#baton-consent-banner #bcm-desc,
#baton-consent-banner .bcm-banner-content #bcm-desc {
	margin: 0;
	line-height: 1.6;
	color: var(--bcm-text, #1f2937);
	opacity: 0.9;
	font-size: var(--bcm-desc-size, 1em);
	font-weight: var(--bcm-desc-weight, 400);
}

#baton-consent-banner #bcm-desc p,
#baton-consent-banner .bcm-banner-content #bcm-desc p {
	margin: 0 0 10px 0;
	line-height: 1.6;
	font-size: inherit;
	font-weight: inherit;
}

#baton-consent-banner #bcm-desc p:last-child,
#baton-consent-banner .bcm-banner-content #bcm-desc p:last-child {
	margin-bottom: 0;
}

#baton-consent-banner .bcm-policy-url-link {
	color: var(--bcm-primary-bg, #2563eb);
	font-weight: 600;
	text-decoration: underline;
}

#baton-consent-banner .bcm-policy-url-link:hover {
	opacity: 0.8;
}

#baton-consent-banner .bcm-embedded-policy-text {
	max-height: 120px;
	overflow-y: auto;
	font-size: 11px;
	margin-top: 15px;
	background: rgba(0, 0, 0, 0.03);
	padding: 12px;
	border-radius: 6px;
	line-height: 1.5;
	border: 1px solid rgba(0,0,0,0.05);
}

/* Accordion Settings List */
#baton-consent-banner #bcm-granular-settings {
	margin-top: 5px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	padding-top: 15px;
	max-height: 350px;
	overflow-y: auto;
}

#baton-consent-banner .bcm-settings-list {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

#baton-consent-banner .bcm-setting-item {
	background: rgba(0, 0, 0, 0.02);
	padding: 15px;
	border-radius: 8px;
	border: 1px solid rgba(0,0,0,0.03);
}

#baton-consent-banner .bcm-setting-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 6px;
}

#baton-consent-banner .bcm-setting-title {
	font-weight: 600;
	color: var(--bcm-text, #1f2937);
}

#baton-consent-banner .bcm-setting-desc {
	margin: 0 0 10px 0;
	font-size: 0.85em;
	opacity: 0.75;
	line-height: 1.5;
}

/* Cookie Table Details styles */
#baton-consent-banner .bcm-details-expander-wrapper {
	margin-top: 10px;
	font-size: 11px;
}

#baton-consent-banner .bcm-link-details-toggle {
	color: var(--bcm-primary-bg, #2563eb);
	text-decoration: none;
	font-weight: 600;
}

#baton-consent-banner .bcm-link-details-toggle:hover {
	text-decoration: underline;
}

#baton-consent-banner .bcm-details-list-content {
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 6px;
	padding: 10px 12px;
	max-height: 200px;
	overflow-y: auto;
}

#baton-consent-banner .bcm-details-table th,
#baton-consent-banner .bcm-details-table td {
	border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

#baton-consent-banner .bcm-details-table tr:last-child td {
	border-bottom: none;
}

/* Switches (iOS Style) */
.bcm-switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
}

.bcm-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.bcm-slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: #cbd5e1;
	transition: .3s;
	border-radius: 24px;
}

.bcm-slider:before {
	position: absolute;
	content: "";
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: white;
	transition: .3s;
	border-radius: 50%;
}

.bcm-switch input:checked + .bcm-slider {
	background-color: var(--bcm-primary-bg, #2563eb);
}

.bcm-switch input:focus + .bcm-slider {
	box-shadow: 0 0 1px var(--bcm-primary-bg, #2563eb);
}

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

.bcm-switch input:disabled + .bcm-slider {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Buttons actions */
#baton-consent-banner .bcm-banner-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

/* Ensure the layout of bottom/top banners doesn't wrap actions too ugly */
#baton-consent-banner.bcm-banner-bottom-banner .bcm-banner-inner,
#baton-consent-banner.bcm-banner-top-banner .bcm-banner-inner {
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	gap: 30px;
}

#baton-consent-banner.bcm-banner-bottom-banner .bcm-banner-content,
#baton-consent-banner.bcm-banner-top-banner .bcm-banner-content {
	flex: 1;
}

#baton-consent-banner .bcm-btn {
	padding: 10px 20px;
	font-weight: 600;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.95em;
	transition: all 0.2s ease;
	outline: none;
}

#baton-consent-banner .bcm-btn:hover {
	transform: translateY(-1px);
	filter: brightness(1.05);
}

#baton-consent-banner .bcm-btn:active {
	transform: translateY(0);
}

#baton-consent-banner .bcm-btn-primary {
	background: var(--bcm-primary-bg, #2563eb);
	color: var(--bcm-primary-text, #ffffff);
}

#baton-consent-banner .bcm-btn-secondary {
	background: var(--bcm-secondary-bg, #f3f4f6);
	color: var(--bcm-secondary-text, #1f2937);
	border: 1px solid rgba(0, 0, 0, 0.05);
}

#baton-consent-banner .bcm-btn-settings {
	background: var(--bcm-settings-bg, #4b5563);
	color: var(--bcm-settings-text, #ffffff);
}

/* Widget Styles */
#bcm-cookie-widget {
	position: fixed;
	z-index: 999997;
	width: var(--bcm-widget-size, 50px);
	height: var(--bcm-widget-size, 50px);
	border-radius: 50%;
	background: var(--bcm-primary-bg, #2563eb);
	color: var(--bcm-primary-text, #ffffff);
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#bcm-cookie-widget:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.bcm-widget-pos-bottom-left {
	bottom: 25px;
	left: 25px;
}

.bcm-widget-pos-bottom-right {
	bottom: 25px;
	right: 25px;
}

#bcm-cookie-widget svg {
	width: 50%;
	height: 50%;
	stroke-width: 2.2px;
}

.bcm-widget-img-icon {
	width: 55%;
	height: 55%;
	object-fit: contain;
}

/* Mobile Responsive */
@media (max-width: 768px) {
	.bcm-banner-bottom-banner .bcm-banner-inner,
	.bcm-banner-top-banner .bcm-banner-inner {
		flex-direction: column;
		align-items: flex-start;
		gap: 15px;
	}

	.bcm-banner-bottom-banner,
	.bcm-banner-top-banner {
		padding: 20px;
	}

	.bcm-banner-actions {
		width: 100%;
	}

	.bcm-btn {
		flex: 1 1 calc(50% - 10px);
		text-align: center;
		padding: 12px;
	}

	#bcm-btn-configure, #bcm-btn-save-preferences {
		flex-basis: 100%;
	}

	.bcm-banner-bottom-right {
		bottom: 0;
		right: 0;
		width: 100%;
		max-width: 100%;
		border-radius: 0;
	}

	.bcm-banner-modal {
		width: 100%;
		max-width: 100%;
		height: 100%;
		max-height: 100%;
		top: 0;
		left: 0;
		transform: none;
		border-radius: 0;
		padding: 20px;
	}
}
