/**
 * Frontend Core Stylesheet for Popup Creator for Elementor
 * High performance, zero bloat, CSS variables based.
 */

:root {
	--oep-z-index: 99999;
	--oep-transition-speed: 0.35s;
	--oep-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
}

/* Modal Root Overlay Container */
.oep-popup {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	display: none;
	align-items: center;
	justify-content: center;
	z-index: var(--oep-z-index);
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--oep-transition-speed) ease, visibility var(--oep-transition-speed) ease;
	box-sizing: border-box;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.oep-popup *, .oep-popup *::before, .oep-popup *::after {
	box-sizing: border-box;
}

/* Visible State */
.oep-popup.oep-is-open {
	display: flex;
	opacity: 1;
	visibility: visible;
}

/* Background Overlay */
.oep-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	background-color: rgba(0, 0, 0, 0.65);
	z-index: 1;
	cursor: pointer;
	transition: background-color var(--oep-transition-speed) ease, opacity var(--oep-transition-speed) ease;
}

/* Modal Inner Container */
.oep-popup-container {
	position: relative;
	z-index: 2;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	pointer-events: none;
}

/* Dialog Box */
.oep-popup-dialog {
	position: relative;
	pointer-events: auto;
	background-color: #ffffff;
	border-radius: 12px;
	box-shadow: 0px 20px 40px rgba(0, 0, 0, 0.25);
	outline: none;
	width: 600px;
	max-width: 100%;
	max-height: 90vh;
	max-height: 90dvh;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	transform-origin: center center;
}

/* Close Button */
.oep-popup-close {
	position: absolute;
	top: 15px;
	right: 15px;
	z-index: 10;
	background: transparent;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	padding: 8px;
	color: #666666;
	font-size: 20px;
	border-radius: 50%;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
	outline: none;
}

.oep-popup-close:hover,
.oep-popup-close:focus {
	color: #000000;
	background-color: rgba(0, 0, 0, 0.06);
	transform: scale(1.08);
}

.oep-popup-close:focus-visible {
	outline: 2px solid #9b51e0;
	outline-offset: 2px;
}

.oep-close-icon {
	display: inline-block;
	font-family: inherit;
	font-weight: 300;
	line-height: 1;
}

/* Content Container */
.oep-popup-content {
	width: 100%;
	position: relative;
}

/* Position Classes */
.oep-position-center .oep-popup-container {
	align-items: center;
	justify-content: center;
}

.oep-position-top-center .oep-popup-container {
	align-items: flex-start;
	justify-content: center;
}

.oep-position-bottom-center .oep-popup-container {
	align-items: flex-end;
	justify-content: center;
}

.oep-position-center-left .oep-popup-container {
	align-items: center;
	justify-content: flex-start;
}

.oep-position-center-right .oep-popup-container {
	align-items: center;
	justify-content: flex-end;
}

.oep-position-top-left .oep-popup-container {
	align-items: flex-start;
	justify-content: flex-start;
}

.oep-position-top-right .oep-popup-container {
	align-items: flex-start;
	justify-content: flex-end;
}

.oep-position-bottom-left .oep-popup-container {
	align-items: flex-end;
	justify-content: flex-start;
}

.oep-position-bottom-right .oep-popup-container {
	align-items: flex-end;
	justify-content: flex-end;
}

/* Body Scroll Lock */
body.oep-scroll-locked {
	overflow: hidden !important;
	touch-action: none;
}

/* Triggers & Buttons */
.oep-trigger,
.oep-trigger-btn,
.oep-trigger-text,
.oep-trigger-icon-wrap,
.oep-trigger-image-wrap,
[data-oep-popup] {
	cursor: pointer;
	user-select: none;
}

.oep-btn-default {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 24px;
	font-size: 15px;
	font-weight: 600;
	color: #ffffff;
	background-color: #9b51e0;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.oep-btn-default:hover,
.oep-btn-default:focus {
	background-color: #8339c7;
	color: #ffffff;
}

/* AJAX Spinner */
.oep-spinner {
	width: 40px;
	height: 40px;
	margin: 40px auto;
	border: 3px solid rgba(155, 81, 224, 0.2);
	border-top-color: #9b51e0;
	border-radius: 50%;
	animation: oep-spin 0.8s linear infinite;
}

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

/* RTL Support */
body.rtl .oep-popup-close {
	right: auto;
	left: 15px;
}
body.rtl .oep-position-top-left .oep-popup-container,
body.rtl .oep-position-bottom-left .oep-popup-container {
	justify-content: flex-end;
}
body.rtl .oep-position-top-right .oep-popup-container,
body.rtl .oep-position-bottom-right .oep-popup-container {
	justify-content: flex-start;
}
