/**
 * PromptPress frontend popup styles
 */

.promptpress-popup {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
	visibility: hidden;
	opacity: 0;
	transition: visibility 0.25s ease, opacity 0.25s ease;
	isolation: isolate;
}

.promptpress-popup.is-open {
	visibility: visible;
	opacity: 1;
}

/* Overlay: behind the popup box; clickable to close */
.promptpress-popup__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	cursor: pointer;
}

/* Container + box: must sit above overlay */
.promptpress-popup__container {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.promptpress-popup__container .promptpress-popup__box {
	pointer-events: auto;
}

.promptpress-popup__box {
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
	max-height: 100%;
}

.promptpress-popup__box .promptpress-popup__content {
	max-height: calc(100vh - 80px);
}

/* Fullscreen template: box fills viewport, content area scrolls */
.promptpress-popup--fullscreen .promptpress-popup__box {
	display: flex;
	flex-direction: column;
	min-height: 0;
	width: 100%;
	height: 100%;
	max-height: 100%;
}

.promptpress-popup--fullscreen .promptpress-popup__content {
	flex: 1 1 0;
	min-height: 0;
	max-height: none;
}

.promptpress-popup__close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	align-content: center;
	align-items: center;
	justify-content: center;
	width: max-content;
	gap: 0.35em;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: opacity 0.2s ease, filter 0.2s ease;
	z-index: 2;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.promptpress-popup__close:hover {
	opacity: 0.9;
	filter: brightness(1.1);
}

.promptpress-popup__close-icon {
	font-size: 22px;
	line-height: 1;
	height: 14px;
}
.promptpress-popup__close-label {
	position: relative;
	top: 1px;
}

.promptpress-popup__close--with-text .promptpress-popup__close-icon {
	font-size: 18px;
}

.promptpress-popup__close--outside {
	top: -48px;
	right: 0;
}

.promptpress-popup__content {
	position: relative;
	overflow-y: auto;
}

.promptpress-popup__title {
	margin: 0 0 0.75em;
	font-size: 1.5rem;
}

.promptpress-popup__body {
	line-height: 1.6;
}

.promptpress-popup__body p:last-child {
	margin-bottom: 0;
}

/* PromptPress Button block (link styled as button; colours/radius set by block) */
.promptpress-popup__body .promptpress-button {
	display: flex;
	justify-content: center;
	width: max-content;
	padding: 0.6em 1.4em;
	margin: 0.5em 0.5em 0.5em 0;
	text-decoration: none;
	font-weight: 600;
	font-size: 1em;
	line-height: 1.4;
	border: none;
	cursor: pointer;
	height: 36px;
	transition: opacity 0.2s ease, filter 0.2s ease;
}

.promptpress-popup__body .promptpress-button:hover {
	opacity: 0.92;
	filter: brightness(0.97);
}

/* PromptPress Button block alignment */
.promptpress-popup__body .alignleft {
	text-align: left;
}

.promptpress-popup__body .aligncenter {
	text-align: center;
}

.promptpress-popup__body .aligncenter .promptpress-button {
	margin-left: auto;
	margin-right: auto;
}

.promptpress-popup__body .alignright {
	text-align: right;
}

/* Animations */
.promptpress-popup--anim-none .promptpress-popup__box {
	transition: none;
}

.promptpress-popup--anim-fade .promptpress-popup__box {
	transition: opacity 0.25s ease;
}

.promptpress-popup.is-open.promptpress-popup--anim-slide-up .promptpress-popup__box {
	animation: promptpress-slide-up 0.3s ease;
}

.promptpress-popup.is-open.promptpress-popup--anim-slide-down .promptpress-popup__box {
	animation: promptpress-slide-down 0.3s ease;
}

.promptpress-popup.is-open.promptpress-popup--anim-slide-left .promptpress-popup__box {
	animation: promptpress-slide-left 0.3s ease;
}

.promptpress-popup.is-open.promptpress-popup--anim-slide-right .promptpress-popup__box {
	animation: promptpress-slide-right 0.3s ease;
}

.promptpress-popup.is-open.promptpress-popup--anim-zoom .promptpress-popup__box {
	animation: promptpress-zoom 0.25s ease;
}

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

@keyframes promptpress-slide-down {
	from {
		transform: translateY(-30px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

@keyframes promptpress-slide-left {
	from {
		transform: translateX(30px);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

@keyframes promptpress-slide-right {
	from {
		transform: translateX(-30px);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

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

/* Debug bar (only when PROMPTPRESS_DEBUG is true) */
.promptpress-debug-bar {
	position: fixed;
	bottom: 12px;
	left: 12px;
	z-index: 99999;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	background: #1d2327;
	color: #fff;
	font-size: 12px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.promptpress-debug-bar__label {
	font-weight: 600;
}

.promptpress-debug-bar__hint {
	opacity: 0.85;
	font-size: 11px;
}
