/**
 * PlgnPlay Popups Public/Frontend Styles
 *
 * @package PlgnPlay Popups
 * @since   1.0.0
 */

/* Overlay */
.plgnplay-popups-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	z-index: 999998;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.plgnplay-popups-overlay.plgnplay-popups-visible {
	opacity: 1;
}

/* Base popup styles */
.plgnplay-popups-popup {
	position: fixed;
	z-index: 999999;
	background: #fff;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18);
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	max-height: 90vh;
	overflow-y: auto;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.plgnplay-popups-popup.plgnplay-popups-visible {
	opacity: 1;
}

/* Close button */
.plgnplay-popups-close {
	position: absolute;
	top: 10px;
	right: 12px;
	background: rgba(0, 0, 0, 0.06);
	border: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #555;
	padding: 4px 10px;
	z-index: 10;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.plgnplay-popups-close:hover {
	background: rgba(0, 0, 0, 0.12);
	color: #111;
	transform: scale(1.1);
}

.plgnplay-popups-close:focus {
	background: rgba(0, 0, 0, 0.12);
	color: #111;
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* Center Modal */
.plgnplay-popups-popup--center {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.9);
	border-radius: 8px;
	width: 90%;
	max-width: 600px;
	padding: 30px;
}

.plgnplay-popups-popup--center.plgnplay-popups-visible {
	transform: translate(-50%, -50%) scale(1);
}

/* Bottom Right Slide-in */
.plgnplay-popups-popup--bottom-right {
	bottom: 20px;
	right: 20px;
	transform: translateY(20px);
	border-radius: 8px;
	width: 380px;
	max-width: calc(100vw - 40px);
	padding: 24px;
}

.plgnplay-popups-popup--bottom-right.plgnplay-popups-visible {
	transform: translateY(0);
}

/* Top Bar */
.plgnplay-popups-popup--top-bar {
	top: 0;
	left: 0;
	width: 100%;
	transform: translateY(-100%);
	border-radius: 0;
	padding: 14px 50px 14px 20px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.plgnplay-popups-popup--top-bar.plgnplay-popups-visible {
	transform: translateY(0);
}

.plgnplay-popups-popup--top-bar .plgnplay-popups-popup__inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 16px;
}

.plgnplay-popups-popup--top-bar .plgnplay-popups-popup__image {
	flex-shrink: 0;
}

.plgnplay-popups-popup--top-bar .plgnplay-popups-popup__image img {
	max-height: 40px;
	width: auto;
}

.plgnplay-popups-popup--top-bar .plgnplay-popups-popup__content {
	flex: 1;
}

.plgnplay-popups-popup--top-bar .plgnplay-popups-popup__content p {
	margin: 0;
}

/* Inner content layout */
.plgnplay-popups-popup__inner {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.plgnplay-popups-popup--center .plgnplay-popups-popup__inner,
.plgnplay-popups-popup--bottom-right .plgnplay-popups-popup__inner {
	flex-direction: column;
}

/* Image */
.plgnplay-popups-popup__image img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: 6px;
}

/* Content */
.plgnplay-popups-popup__content {
	font-size: 15px;
	line-height: 1.7;
	color: #333;
}

.plgnplay-popups-popup__content p:first-child {
	margin-top: 0;
}

.plgnplay-popups-popup__content p:last-child {
	margin-bottom: 0;
}

.plgnplay-popups-popup__content h1,
.plgnplay-popups-popup__content h2,
.plgnplay-popups-popup__content h3 {
	margin-top: 0;
	color: #111;
}

.plgnplay-popups-popup__content a {
	color: #6C3CE1;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.plgnplay-popups-popup__content a:hover {
	color: #4F22B5;
}

/* Responsive */
@media screen and (max-width: 480px) {
	.plgnplay-popups-popup--center {
		width: 95%;
		padding: 20px;
	}

	.plgnplay-popups-popup--bottom-right {
		bottom: 10px;
		right: 10px;
		left: 10px;
		width: auto;
	}

	.plgnplay-popups-popup--top-bar {
		padding: 12px 40px 12px 16px;
	}

	.plgnplay-popups-popup--top-bar .plgnplay-popups-popup__inner {
		flex-direction: column;
		gap: 8px;
	}

	.plgnplay-popups-close {
		top: 4px;
		right: 8px;
	}
}

/* Accessibility: focus ring */
.plgnplay-popups-popup:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
	.plgnplay-popups-overlay,
	.plgnplay-popups-popup {
		transition: none;
	}
}
