/* ==========================================================================
   SureCookie Shared Styles - Consolidated CSS for both Frontend and Admin Areas
========================================================================== */

/* Global Font CSS */
@font-face {
	font-family: Figtree;
	font-style: normal;
	font-weight: 100;
	font-display: fallback;
	src: url( "../font/Figtree/Figtree-Light.ttf" ) format( "truetype" );
}

@font-face {
	font-family: Figtree;
	font-style: normal;
	font-weight: 200;
	font-display: fallback;
	src: url( "../font/Figtree/Figtree-Light.ttf" ) format( "truetype" );
}

@font-face {
	font-family: Figtree;
	font-style: normal;
	font-weight: 300;
	font-display: fallback;
	src: url( "../font/Figtree/Figtree-Light.ttf" ) format( "truetype" );
}

@font-face {
	font-family: Figtree;
	font-style: normal;
	font-weight: 400;
	font-display: fallback;
	src: url( "../font/Figtree/Figtree-Regular.ttf" ) format( "truetype" );
}

@font-face {
	font-family: Figtree;
	font-style: normal;
	font-weight: 500;
	font-display: fallback;
	src: url( "../font/Figtree/Figtree-Medium.ttf" ) format( "truetype" );
}

@font-face {
	font-family: Figtree;
	font-style: normal;
	font-weight: 600;
	font-display: fallback;
	src: url( "../font/Figtree/Figtree-SemiBold.ttf" ) format( "truetype" );
}

@font-face {
	font-family: Figtree;
	font-style: normal;
	font-weight: 700;
	font-display: fallback;
	src: url( "../font/Figtree/Figtree-Bold.ttf" ) format( "truetype" );
}

@font-face {
	font-family: Figtree;
	font-style: normal;
	font-weight: 800;
	font-display: fallback;
	src: url( "../font/Figtree/Figtree-ExtraBold.ttf" ) format( "truetype" );
}

@font-face {
	font-family: Figtree;
	font-style: normal;
	font-weight: 900;
	font-display: fallback;
	src: url( "../font/Figtree/Figtree-Black.ttf" ) format( "truetype" );
}

/* Ensure all cookie elements use proper font */
.surecookie-styles,
.surecookie-styles *,
#surecookie-admin-root,
#surecookie-admin-root *,
#surecookie-public-root,
#surecookie-public-root * {
	font-family: Figtree, sans-serif;
	box-sizing: border-box;
}

/* Keyframe Animations */
@keyframes surecookie-slide-up-preview {
	from {
		transform: translateY( 100px );
		opacity: 0;
	}
	to {
		transform: translateY( 0 );
		opacity: 1;
	}
}

@keyframes surecookie-slide-up {
	from {
		transform: translateY( 20px );
		opacity: 0;
	}
	to {
		transform: translateY( 0 );
		opacity: 1;
	}
}

/* Keyframe Animations */
@keyframes surecookieFadeIn {
	from {
		opacity: 0;
		backdrop-filter: blur( 0 );
	}
	to {
		opacity: 1;
		backdrop-filter: blur( 2px );
	}
}

@keyframes surecookieSlideIn {
	from {
		transform: translateY( 30px ) scale( 0.95 );
		opacity: 0;
	}
	to {
		transform: translateY( 0 ) scale( 1 );
		opacity: 1;
	}
}

/* ==========================================================================
   Cookie Banner Styles
========================================================================== */
#surecookie-public-root {
	all: initial;
	display: block;
	position: relative;
	pointer-events: none;
}

/* Banner Position Styles */
#surecookie-public-root .surecookie-banner-position-top,
#surecookie-public-root .surecookie-banner-position-bottom {
	position: fixed;
	left: 0;
	right: 0;
	margin: 0;
	pointer-events: auto;
}
#surecookie-public-root .surecookie-banner-position-top {
	top: 0;
}
#surecookie-public-root .surecookie-banner-position-bottom {
	bottom: 0;
}

#surecookie-public-root .surecookie-banner-position-box-base {
	position: fixed;
	max-width: 90vw;
	pointer-events: auto;
}
#surecookie-public-root .surecookie-banner-position-top-left {
	top: 20px;
	left: 20px;
}
#surecookie-public-root .surecookie-banner-position-top-right {
	top: 20px;
	right: 20px;
}
#surecookie-public-root .surecookie-banner-position-bottom-left {
	bottom: 20px;
	left: 20px;
}
#surecookie-public-root .surecookie-banner-position-bottom-right {
	bottom: 20px;
	right: 20px;
}

#surecookie-public-root .surecookie-banner-position-bottom-center,
#surecookie-public-root .surecookie-banner-position-middle,
#surecookie-public-root .surecookie-banner-position-popup {
	position: fixed;
	max-width: 90vw;
	pointer-events: auto;
}
#surecookie-public-root .surecookie-banner-position-bottom-center {
	bottom: 20px;
	left: 50%;
	transform: translateX( -50% );
}
#surecookie-public-root .surecookie-banner-position-middle {
	top: 50%;
	left: 50%;
	transform: translate( -50%, -50% );
}
#surecookie-public-root .surecookie-banner-position-popup {
	top: 50%;
	left: 50%;
	transform: translate( -50%, -50% );
}

/* Banner Container Styles */
.surecookie-banner-container {
	box-shadow: 0 25px 50px -12px rgba( 0, 0, 0, 0.25 );
	backdrop-filter: blur( 10px );
	-webkit-backdrop-filter: blur( 10px );
	display: block;
	visibility: visible;
	opacity: 1;
}
.surecookie-banner-container-banner {
	padding: 24px;
	border-radius: 0;
}
.surecookie-banner-container-box-with-logo {
	padding: 20px 16px;
	border-radius: 12px;
}
.surecookie-banner-container-box {
	padding: 16px;
	border-radius: 12px;
}

/* Banner Inner Container */
.surecookie-banner-inner {
	display: flex;
	flex-direction: column;
}
.surecookie-banner-inner-banner {
	margin: 0 auto;
}
.surecookie-banner-inner-box {
	margin: 0;
}

/* Banner Logo */
.surecookie-banner-logo-wrapper {
	width: 100%;
	display: block;
	flex-shrink: 0;
}
.surecookie-banner-logo {
	height: 24px;
	width: auto;
	margin-bottom: 20px;
	display: block;
	max-width: 100%;
}

/* Banner Content */
.surecookie-banner-content {
	display: flex;
	width: 100%;
	justify-content: space-between;
}
.surecookie-banner-content-banner {
	flex-direction: row;
	align-items: center;
	gap: 16px;
}
.surecookie-banner-content-box {
	flex-direction: column;
	align-items: flex-start;
	gap: 24px;
}

/* Banner Text */
.surecookie-banner-text-wrapper {
	flex: 1;
}

/* Override base reset for banner headings */
.surecookie-banner-heading {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 6px 0;
	line-height: 1.5;
}
.surecookie-banner-heading-white {
	color: #fff;
}
.surecookie-banner-description {
	font-size: 14px;
	margin: 0;
	line-height: 1.6;
	color: var( --surecookie-banner-text-color );
}

/* Banner Buttons */
.surecookie-banner-buttons {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-items: center;
}
.surecookie-banner-buttons-banner {
	width: auto;
}
.surecookie-banner-buttons-box {
	width: 100%;
}

/* Button Base Styles */
#surecookie-public-root .surecookie-btn-base {
	padding: 8px 16px;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 500;
	font-size: 14px;
	border: none;
	min-width: fit-content;
	white-space: nowrap;
	outline: none;
	text-decoration: none;
	display: inline-block;
	text-align: center;
	vertical-align: middle;
	user-select: none;
	background-image: none;
	text-transform: none;
	letter-spacing: 0;
	line-height: 1.5;
}

#surecookie-public-root .surecookie-btn-transparent {
	background-color: transparent;
}
#surecookie-public-root .surecookie-btn-with-border {
	border: 1px solid;
}
.surecookie-btn-font-semibold {
	font-weight: 600;
}

/* Floating Settings Button */
#surecookie-public-root .surecookie-floating-settings {
	position: fixed;
	bottom: 20px;
	right: 20px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow:
		0 4px 12px rgba( 0, 0, 0, 0.15 ),
		0 2px 6px rgba( 0, 0, 0, 0.1 );
	z-index: 9998;
	background-color: var( --surecookie-banner-primary-color );
	transition: all 0.3s cubic-bezier( 0.4, 0, 0.2, 1 );
	animation: surecookie-slide-up-preview 0.4s ease-out;
	padding: 0;
	margin: 0;
	overflow: hidden;
	pointer-events: auto;
}
#surecookie-public-root .surecookie-floating-settings:hover {
	transform: scale( 1.1 );
	box-shadow:
		0 6px 16px rgba( 0, 0, 0, 0.2 ),
		0 3px 8px rgba( 0, 0, 0, 0.15 );
}
#surecookie-public-root .surecookie-floating-settings svg {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 25px;
	max-height: 25px;
	fill: #fff;
	margin: 0;
	padding: 0;
}

/* Public Banner Specific Styles */
.surecookie-public-banner {
	position: fixed;
	display: block;
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	box-sizing: border-box;
}
.surecookie-public-banner[data-banner="true"] {
	box-sizing: border-box;
}
#surecookie-public-root .surecookie-public-banner-wrapper {
	position: absolute;
	width: 0;
	height: 0;
	overflow: visible;
	pointer-events: auto;
}

/* Branding */
.surecookie-branding {
	display: flex;
	align-items: center;
	gap: 4px;
	color: #9ca3af;
	font-size: 12px;
	font-weight: 400;
	margin-left: auto;
}
.surecookie-branding span:last-child {
	font-weight: 600;
}

/* Branding in banner notice type needs top margin */
.surecookie-banner-content-banner .surecookie-branding-mobile {
	margin-top: 10px;
}

/* ==========================================================================
   Preferences Modal Styles
========================================================================== */
#surecookie-public-root .surecookie-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba( 0, 0, 0, 0.6 );
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 5px;
	animation: surecookieFadeIn 0.2s ease-out;
	pointer-events: auto;
}
.surecookie-preferences-modal {
	width: 90vw;
	max-width: 640px;
	height: auto;
	max-height: 90vh;
	border-radius: 16px;
	box-shadow: 0 25px 50px -12px #00000040;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	animation: surecookieSlideIn 0.3s ease-out;
}
.surecookie-preferences-modal .surecookie-modal-header {
	padding: 24px 24px 20px 24px;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
}
.surecookie-preferences-modal .surecookie-modal-header-text {
	flex: 1;
}
.surecookie-preferences-modal .surecookie-modal-title {
	margin: 0 0 8px 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	color: var( --surecookie-banner-text-color );
}
.surecookie-preferences-modal .surecookie-modal-description {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	opacity: 0.85;
	color: var( --surecookie-banner-text-color );
}
.surecookie-preferences-modal .surecookie-modal-close-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.6;
	transition: opacity 0.2s;
	flex-shrink: 0;
	color: var( --surecookie-banner-text-color );
}
.surecookie-preferences-modal .surecookie-modal-close-btn:hover {
	opacity: 1;
}
.surecookie-preferences-modal .surecookie-categories-wrapper {
	position: relative;
	margin: 0 24px;
	overflow: hidden;
}
.surecookie-preferences-modal .surecookie-categories-wrapper::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 60px;
	background: linear-gradient( to top, var( --surecookie-banner-background-color, #111827 ) 15%, transparent 100% );
	pointer-events: none;
	z-index: 10;
	opacity: 0.9;
	transition: opacity 0.3s ease;
	display: var( --shadow-display, block );
}
.surecookie-preferences-modal .surecookie-categories-scroll {
	-ms-overflow-style: none;
	scrollbar-width: none;
	overflow-y: auto;
	max-height: 280px;
	padding: 0;
}
.surecookie-preferences-modal .surecookie-categories-scroll::-webkit-scrollbar {
	display: none;
}
.surecookie-preferences-modal .surecookie-categories-list {
	padding: 0;
	display: flex;
	flex-direction: column;
}
.surecookie-preferences-modal .surecookie-category-item {
	padding: 16px 0;
	border-bottom: 1px solid #37415126;
}
.surecookie-preferences-modal .surecookie-category-item:last-child {
	border-bottom: none;
}
.surecookie-preferences-modal .surecookie-category-header,
.surecookie-preferences-modal .surecookie-category-trigger,
.surecookie-preferences-modal .surecookie-expand-icon {
	display: flex;
	align-items: center;
}
.surecookie-preferences-modal .surecookie-category-header {
	justify-content: space-between;
	gap: 12px;
}
.surecookie-preferences-modal .surecookie-category-trigger {
	flex: 1;
	cursor: pointer;
	gap: 12px;
}
.surecookie-preferences-modal .surecookie-expand-icon {
	justify-content: center;
	transition: transform 0.2s;
	opacity: 0.5;
	color: var( --surecookie-banner-text-color );
	width: 20px;
}
.surecookie-preferences-modal .surecookie-expand-icon.expanded {
	transform: rotate( 90deg );
}
.surecookie-preferences-modal .surecookie-category-name {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: var( --surecookie-banner-text-color );
}
.surecookie-preferences-modal .surecookie-category-controls {
	display: flex;
	align-items: center;
	gap: 12px;
}
.surecookie-preferences-modal .surecookie-always-active {
	font-size: 12px;
	color: #6b7280;
	font-weight: 500;
}
.surecookie-preferences-modal .surecookie-toggle-btn {
	width: 40px;
	height: 20px;
	border-radius: 10px;
	border: none;
	cursor: pointer;
	position: relative;
	transition: background-color 0.3s ease;
	flex-shrink: 0;
	padding: 0;
}
.surecookie-preferences-modal .surecookie-toggle-btn:disabled {
	cursor: not-allowed;
}
.surecookie-preferences-modal .surecookie-toggle-knob {
	position: absolute;
	top: 4px;
	left: 4px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background-color: #fff;
	transition: left 0.3s ease;
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.2 );
}
.surecookie-preferences-modal .surecookie-toggle-knob.checked {
	left: 24px;
}
.surecookie-preferences-modal .surecookie-category-details {
	margin-top: 12px;
	padding-left: 32px;
}
.surecookie-preferences-modal .surecookie-category-desc {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: var( --surecookie-banner-text-color );
}
.surecookie-preferences-modal .surecookie-cookie-table-wrapper {
	overflow-x: auto;
	margin-bottom: 10px;
}
.surecookie-preferences-modal .surecookie-cookie-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
	text-align: left;
	border: none;
	color: var( --surecookie-banner-text-color );
}
.surecookie-preferences-modal .surecookie-cookie-table td,
.surecookie-preferences-modal .surecookie-cookie-table th {
	padding: 8px 4px;
	border: none;
	background: none;
}
#surecookie-public-root .surecookie-cookie-table th,
.surecookie-modal-footer-branding span:last-child {
	font-weight: 600;
}
.surecookie-preferences-modal .surecookie-cookie-table tr {
	border: none;
	border-bottom: 1px solid rgba( 156, 163, 175, 0.15 );
}
.surecookie-preferences-modal .surecookie-modal-footer {
	padding: 20px 24px;
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: flex-start;
}
.surecookie-preferences-modal .surecookie-footer-actions {
	display: flex;
	gap: 12px;
	flex: 1;
}
.surecookie-preferences-modal .surecookie-btn-outline {
	min-width: 82px;
	height: 40px;
	padding: 0 12px;
	font-size: 14px;
	font-weight: 500;
	border-radius: 8px;
	background-color: transparent;
	cursor: pointer;
	white-space: nowrap;
	border: 1px solid var( --surecookie-banner-primary-color );
	color: var( --surecookie-banner-primary-color );
	text-transform: none;
	letter-spacing: 0;
}
.surecookie-preferences-modal .surecookie-btn-primary {
	min-width: 136px;
	height: 40px;
	padding: 0 12px;
	font-size: 14px;
	font-weight: 500;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s;
	white-space: nowrap;
	background-color: var( --surecookie-banner-primary-color );
	color: #fff;
	text-transform: none;
	letter-spacing: 0;
}
.surecookie-preferences-modal .surecookie-btn-primary:hover {
	background-color: var( --surecookie-banner-primary-hover-color );
}
.surecookie-preferences-modal .surecookie-btn-sm {
	height: 32px;
	padding: 0 12px;
	font-size: 13px;
}
.surecookie-modal-footer-branding {
	border-top: 0.4px solid #1f2937;
	display: flex;
	align-items: center;
	gap: 4px;
	justify-content: flex-end;
	padding: 12px 20px;
	color: #9ca3af;
	font-size: 12px;
	font-weight: 400;
}

/* Light theme branding border */
.surecookie-preferences-modal[style*="backgroundColor: #fff"] .surecookie-modal-footer-branding,
.surecookie-preferences-modal[style*="backgroundColor: rgb(255"] .surecookie-modal-footer-branding {
	border-top-color: #37415115;
}

/* Cookie Table Toggle Styles */
#surecookie-public-root .surecookie-preferences-modal .surecookie-cookie-table-toggle {
	display: flex;
	align-items: center;
	gap: 2px;
	margin-top: 16px;
	margin-bottom: 8px;
	cursor: pointer;
	user-select: none;
	width: fit-content;
	transition: opacity 0.2s ease;
}
#surecookie-public-root .surecookie-preferences-modal .surecookie-cookie-table-toggle:hover {
	opacity: 0.7;
}
#surecookie-public-root .surecookie-preferences-modal .surecookie-cookie-table-label {
	font-size: 13px;
	font-weight: 600;
	color: var( --surecookie-banner-text-color );
	opacity: 0.9;
}
#surecookie-public-root .surecookie-preferences-modal .surecookie-table-chevron {
	display: flex;
	align-items: center;
	transition: transform 0.2s ease;
	opacity: 0.6;
	color: var( --surecookie-banner-text-color );
}
#surecookie-public-root .surecookie-preferences-modal .surecookie-table-chevron.expanded {
	transform: rotate( 90deg );
}
#surecookie-public-root .surecookie-preferences-modal .surecookie-cookie-table-wrapper {
	margin-top: 8px;
}

/* Content Blocking Placeholder Styles */
.surecookie-placeholder {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
.surecookie-placeholder-content {
	position: relative;
	text-align: center;
	padding: 24px;
	z-index: 10;
	background-color: #1f2937;
	border-radius: 8px;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}
.surecookie-placeholder-text {
	color: #e5e7eb;
	font-size: 14px;
	margin: 0 0 16px 0;
	line-height: 1.5;
}
.surecookie-placeholder-button {
	background-color: #2563eb;
	color: #fff;
	border: none;
	padding: 10px 20px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: background-color 0.2s ease;
}
.surecookie-placeholder-button:hover {
	background-color: #1d4ed8;
}
.surecookie-placeholder-button:focus {
	outline: 2px solid #60a5fa;
	outline-offset: 2px;
}
/* Hide placeholder content when iframe is loaded */
.surecookie-placeholder.surecookie-loaded .surecookie-placeholder-content {
	display: none;
}
.surecookie-placeholder.surecookie-loaded iframe {
	display: block !important;
}

/* Responsive styles */
@media (max-width: 768px) {
	.surecookie-preferences-modal {
		width: 100vw;
		border-radius: 0;
	}
	.surecookie-preferences-modal .surecookie-modal-footer {
		padding: 10px;
		justify-content: space-between;
	}
}

@media (max-width: 767px) {
	.surecookie-container-mobile {
		padding: 20px 16px;
	}
	.surecookie-content-mobile {
		flex-direction: column;
		align-items: flex-start;
		gap: 24px;
	}
	.surecookie-buttons-mobile {
		width: 100%;
		justify-content: center;
	}
	.surecookie-button-mobile {
		width: 100%;
		text-align: center;
	}
	.surecookie-branding-mobile {
		width: 100%;
		justify-content: center;
		margin-left: 0;
		margin-top: 8px;
	}
}
