/* WP Static Page Uploader - Popup Helper Styles */

.wpspu-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.wpspu-popup-overlay.active {
	opacity: 1;
	pointer-events: auto;
}

.wpspu-popup-container {
	position: relative;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
	width: 92%;
	max-width: 550px;
	height: auto;
	max-height: 90vh;
	overflow: hidden;
	transform: scale(0.92) translateY(30px);
	transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
	display: flex;
	flex-direction: column;
}

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

.wpspu-popup-close {
	position: absolute;
	top: 15px;
	right: 15px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.35);
	color: #ffffff;
	font-size: 24px;
	font-weight: 300;
	cursor: pointer;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s, transform 0.2s;
	padding: 0;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	line-height: 1;
}

.wpspu-popup-close:hover {
	background-color: rgba(0, 0, 0, 0.65);
	transform: scale(1.08);
}

.wpspu-popup-close:active {
	transform: scale(0.95);
}

.wpspu-iframe-container {
	width: 100%;
	min-height: 250px;
	position: relative;
	background: #ffffff;
	padding: 25px 15px 15px; /* Generous borders around the iframe for premium spacing */
	box-sizing: border-box;
}

.wpspu-iframe {
	width: 100%;
	height: 250px; /* Initial height, will auto-adapt smoothly via JS ResizeObserver */
	border: none;
	background: transparent;
	display: block;
	opacity: 0;
	transition: opacity 0.3s ease, height 0.2s ease;
}

.wpspu-iframe.loaded {
	opacity: 1;
}

/* Premium Loading Spinner */
.wpspu-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 44px;
	height: 44px;
	border: 3px solid rgba(0, 0, 0, 0.08);
	border-radius: 50%;
	border-top-color: #2271b1; /* WordPress style primary */
	animation: wpspu-spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
	z-index: 2;
	margin-top: -22px;
	margin-left: -22px;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

@keyframes wpspu-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Mobile Adjustments */
@media (max-width: 480px) {
	.wpspu-popup-container {
		width: 95%;
		max-height: 92vh;
		border-radius: 12px;
	}
	
	.wpspu-popup-close {
		top: 10px;
		right: 10px;
		width: 32px;
		height: 32px;
		font-size: 22px;
	}
}
