/**
 * Popup Manager — Frontend Styles
 *
 * @package LaunchpadPro
 */

/* ------------------------------------------------------------------ *
 * Dialog reset & overlay
 * ------------------------------------------------------------------ */

.lp-popup {
	border: none;
	padding: 0;
	background: transparent;
	max-width: none;
	max-height: none;
	overflow: visible;
	color: inherit;
}

.lp-popup::backdrop {
	background-color: var(--lp-popup-overlay-color, #000);
	opacity: var(--lp-popup-overlay-opacity, 0.8);
}

/* ------------------------------------------------------------------ *
 * Inner container
 * ------------------------------------------------------------------ */

.lp-popup__inner {
	position: relative;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	max-height: 90vh;
	overflow-y: auto;
}

.lp-popup__content {
	padding: 2rem;
}

/* ------------------------------------------------------------------ *
 * Size variants
 * ------------------------------------------------------------------ */

.lp-popup--small .lp-popup__inner {
	width: 400px;
	max-width: 95vw;
}

.lp-popup--medium .lp-popup__inner {
	width: 600px;
	max-width: 95vw;
}

.lp-popup--large .lp-popup__inner {
	width: 800px;
	max-width: 95vw;
}

.lp-popup--fullscreen {
	width: 100vw;
	height: 100vh;
	margin: 0;
	padding: 0;
}

.lp-popup--fullscreen .lp-popup__inner {
	width: 100%;
	height: 100%;
	border-radius: 0;
	max-height: 100vh;
}

/* ------------------------------------------------------------------ *
 * Position variants
 * ------------------------------------------------------------------ */

.lp-popup--center {
	margin: auto;
}

.lp-popup--top {
	margin: 2rem auto auto;
}

.lp-popup--bottom {
	margin: auto auto 2rem;
}

.lp-popup--slide-right {
	margin: auto 0 auto auto;
	height: 100vh;
}

.lp-popup--slide-right .lp-popup__inner {
	border-radius: 8px 0 0 8px;
	height: 100%;
	max-height: 100vh;
}

.lp-popup--slide-left {
	margin: auto auto auto 0;
	height: 100vh;
}

.lp-popup--slide-left .lp-popup__inner {
	border-radius: 0 8px 8px 0;
	height: 100%;
	max-height: 100vh;
}

/* ------------------------------------------------------------------ *
 * Close button
 * ------------------------------------------------------------------ */

.lp-popup__close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.08);
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	color: #333;
	transition: background 0.2s ease;
}

.lp-popup__close:hover,
.lp-popup__close:focus-visible {
	background: rgba(0, 0, 0, 0.15);
}

/* ------------------------------------------------------------------ *
 * Animations — Open
 * ------------------------------------------------------------------ */

.lp-popup--anim-fade.lp-popup--open {
	animation: lpPopupFadeIn 0.3s ease forwards;
}

.lp-popup--anim-scale.lp-popup--open {
	animation: lpPopupScaleIn 0.3s ease forwards;
}

.lp-popup--anim-slide.lp-popup--open {
	animation: lpPopupSlideIn 0.3s ease forwards;
}

/* Animations — Close */

.lp-popup--anim-fade.lp-popup--closing {
	animation: lpPopupFadeOut 0.2s ease forwards;
}

.lp-popup--anim-scale.lp-popup--closing {
	animation: lpPopupScaleOut 0.2s ease forwards;
}

.lp-popup--anim-slide.lp-popup--closing {
	animation: lpPopupSlideOut 0.2s ease forwards;
}

/* Keyframes */

@keyframes lpPopupFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes lpPopupFadeOut {
	from { opacity: 1; }
	to   { opacity: 0; }
}

@keyframes lpPopupScaleIn {
	from { opacity: 0; transform: scale(0.9); }
	to   { opacity: 1; transform: scale(1); }
}

@keyframes lpPopupScaleOut {
	from { opacity: 1; transform: scale(1); }
	to   { opacity: 0; transform: scale(0.9); }
}

@keyframes lpPopupSlideIn {
	from { opacity: 0; transform: translateY(20px); }
	to   { opacity: 1; transform: translateY(0); }
}

@keyframes lpPopupSlideOut {
	from { opacity: 1; transform: translateY(0); }
	to   { opacity: 0; transform: translateY(20px); }
}

/* ------------------------------------------------------------------ *
 * Focus styles (accessibility)
 * ------------------------------------------------------------------ */

.lp-popup :focus-visible {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ *
 * Reduced motion
 * ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.lp-popup--anim-fade.lp-popup--open,
	.lp-popup--anim-scale.lp-popup--open,
	.lp-popup--anim-slide.lp-popup--open,
	.lp-popup--anim-fade.lp-popup--closing,
	.lp-popup--anim-scale.lp-popup--closing,
	.lp-popup--anim-slide.lp-popup--closing {
		animation: none;
	}
}

/* ------------------------------------------------------------------ *
 * Mobile responsive
 * ------------------------------------------------------------------ */

@media (max-width: 600px) {
	.lp-popup--small .lp-popup__inner,
	.lp-popup--medium .lp-popup__inner,
	.lp-popup--large .lp-popup__inner {
		width: 100vw;
		max-width: 100vw;
		border-radius: 8px 8px 0 0;
		max-height: 90vh;
	}

	.lp-popup--small,
	.lp-popup--medium,
	.lp-popup--large {
		margin: auto 0 0 0;
		width: 100vw;
	}

	.lp-popup--slide-right .lp-popup__inner,
	.lp-popup--slide-left .lp-popup__inner {
		width: 100vw;
		border-radius: 0;
	}
}
