/* ============================================
   Starter Popup Builder - Frontend Styles
   ============================================ */

/* --- Overlay & Backdrop --- */
.spb-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
	            visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.spb-popup-overlay.spb-active {
	opacity: 1;
	visibility: visible;
}

.spb-popup-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

/* --- Popup Container --- */
.spb-popup-container {
	position: relative;
	z-index: 1;
	width: 90%;
	max-width: 720px;
	max-height: 85vh;
	transform: scale(0.85) translateY(30px);
	transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spb-popup-overlay.spb-active .spb-popup-container {
	transform: scale(1) translateY(0);
}

/* --- Content Wrapper --- */
.spb-popup-content-wrapper {
	position: relative;
	background: #ffffff;
	border-radius: 20px;
	box-shadow:
		0 25px 60px -12px rgba(0, 0, 0, 0.25),
		0 0 0 1px rgba(255, 255, 255, 0.1);
	overflow: hidden;
}

/* --- Decorative top gradient bar --- */
.spb-popup-content-wrapper::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
	z-index: 2;
}

/* --- Close Button --- */
.spb-popup-close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 10;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.06);
	color: #555;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.25s ease;
	padding: 0;
	line-height: 1;
}

.spb-popup-close:hover {
	background: rgba(0, 0, 0, 0.12);
	color: #222;
	transform: rotate(90deg) scale(1.1);
}

.spb-popup-close:focus-visible {
	outline: 2px solid #667eea;
	outline-offset: 2px;
}

.spb-popup-close svg {
	width: 20px;
	height: 20px;
	display: block;
}

/* --- Body --- */
.spb-popup-body {
	padding: 36px 40px 40px;
	max-height: 80vh;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #d1d5db transparent;
}

.spb-popup-body::-webkit-scrollbar {
	width: 6px;
}

.spb-popup-body::-webkit-scrollbar-thumb {
	background: #d1d5db;
	border-radius: 3px;
}

.spb-popup-body::-webkit-scrollbar-track {
	background: transparent;
}

/* --- Content Styles --- */
.spb-popup-content {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	font-size: 15px;
	line-height: 1.7;
	color: #374151;
}

.spb-popup-content h1,
.spb-popup-content h2,
.spb-popup-content h3,
.spb-popup-content h4,
.spb-popup-content h5,
.spb-popup-content h6 {
	color: #1f2937;
	margin-top: 0;
}

.spb-popup-content p {
	margin-bottom: 1em;
}

.spb-popup-content img {
	max-width: 100%;
	height: auto;
	border-radius: 12px;
}

.spb-popup-content a {
	color: #667eea;
	text-decoration: none;
	transition: color 0.2s;
}

.spb-popup-content a:hover {
	color: #764ba2;
}

/* --- Loader / Spinner --- */
.spb-popup-loader {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 0;
}

.spb-popup-loader.spb-hidden {
	display: none;
}

.spb-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid rgba(102, 126, 234, 0.15);
	border-top-color: #667eea;
	border-radius: 50%;
	animation: spb-spin 0.7s linear infinite;
}

@keyframes spb-spin {
	to {
		transform: rotate(360deg);
	}
}

/* --- Responsive --- */
@media (max-width: 600px) {
	.spb-popup-container {
		width: 95%;
		max-height: 90vh;
	}

	.spb-popup-body {
		padding: 28px 20px 24px;
		max-height: 85vh;
	}

	.spb-popup-close {
		top: 10px;
		right: 10px;
		width: 36px;
		height: 36px;
	}

	.spb-popup-close svg {
		width: 18px;
		height: 18px;
	}

	.spb-popup-content-wrapper {
		border-radius: 16px;
	}
}

/* --- Animations for content --- */
.spb-popup-content {
	animation: spb-fade-in 0.3s ease 0.1s both;
}

@keyframes spb-fade-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* --- Body scroll lock --- */
body.spb-popup-open {
	overflow: hidden;
}
