/* =============================================
   Bravo Popup Builder — Frontend Styles
   Version: 1.0.0
   ============================================= */

/* ----- Reset / Base ----- */
.bravo-popup-overlay *,
.bravo-popup-overlay *::before,
.bravo-popup-overlay *::after {
	box-sizing: border-box;
}

/* ----- Overlay ----- */
.bravo-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, 0.65);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease;
	will-change: opacity;
}

.bravo-popup-overlay.bravo-popup-active {
	opacity: 1;
	visibility: visible;
}

/* ----- Popup Box ----- */
.bravo-popup-box {
	position: relative;
	width: 100%;
	max-width: 560px;
	background: #fff;
	border-radius: 16px;
	padding: 40px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
	transform: translateY(0) scale(1);
	transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
	            opacity 0.35s ease;
	max-height: 90vh;
	overflow-y: auto;
	scrollbar-width: thin;
}

/* ----- × Close Icon ----- */
.bravo-popup-x-close {
	position: absolute;
	top: 14px;
	right: 18px;
	background: none;
	border: 2px solid var(--bravo-accent, #FDB515);
	cursor: pointer;
	font-size: 20px;
	color: var(--bravo-accent, #FDB515);
	line-height: 1;
	padding: 4px 6px;
	border-radius: 50%;
	transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
	z-index: 10;
}

.bravo-popup-x-close:hover {
	color: #1a1a1a;
	background: var(--bravo-accent, #FDB515);
	transform: rotate(90deg);
}

.bravo-popup-x-close:focus-visible {
	outline: 2px solid var(--bravo-accent, #FDB515);
	outline-offset: 2px;
}

/* ----- Title ----- */
.bravo-popup-title {
	margin: 0 0 16px;
	font-size: 1.6rem;
	font-weight: 700;
	color: #1a1a2e;
	line-height: 1.25;
}

/* ----- Content ----- */
.bravo-popup-content {
	margin: 0 0 28px;
	font-size: 1rem;
	color: #4a4a6a;
	line-height: 1.7;
}

.bravo-popup-content p:last-child {
	margin-bottom: 0;
}

/* ----- Actions Row ----- */
.bravo-popup-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

/* ----- CTA Button ----- */
.bravo-popup-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 14px 32px;
	background: #6c63ff;
	color: #fff;
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none;
	border-radius: 8px;
	border: none;
	cursor: pointer;
	transition: background 0.22s ease, transform 0.18s ease, box-shadow 0.22s ease;
	box-shadow: 0 4px 18px rgba(108, 99, 255, 0.35);
	letter-spacing: 0.02em;
}

.bravo-popup-btn:hover {
	background: #5a52d5;
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(108, 99, 255, 0.45);
	color: #fff;
	text-decoration: none;
}

.bravo-popup-btn:active {
	transform: translateY(0);
}

.bravo-popup-btn:focus-visible {
	outline: 2px solid #6c63ff;
	outline-offset: 3px;
}

/* ----- Close Text Link ----- */
.bravo-popup-close-text {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 0.875rem;
	color: #9e9e9e;
	padding: 4px 0;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.2s ease;
}

.bravo-popup-close-text:hover {
	color: #333;
}

.bravo-popup-close-text:focus-visible {
	outline: 2px solid #6c63ff;
	outline-offset: 2px;
}

/* =============================================
   ANIMATION STATES
   ============================================= */

/* --- Fade In --- */
.bravo-popup-overlay[data-animation="fade"] .bravo-popup-box {
	opacity: 0;
}
.bravo-popup-overlay[data-animation="fade"].bravo-popup-active .bravo-popup-box {
	opacity: 1;
}

/* --- Slide Down --- */
.bravo-popup-overlay[data-animation="slide-down"] .bravo-popup-box {
	transform: translateY(-60px);
	opacity: 0;
}
.bravo-popup-overlay[data-animation="slide-down"].bravo-popup-active .bravo-popup-box {
	transform: translateY(0);
	opacity: 1;
}

/* --- Slide from Left --- */
.bravo-popup-overlay[data-animation="slide-left"] .bravo-popup-box {
	transform: translateX(-80px);
	opacity: 0;
}
.bravo-popup-overlay[data-animation="slide-left"].bravo-popup-active .bravo-popup-box {
	transform: translateX(0);
	opacity: 1;
}

/* --- Slide from Right --- */
.bravo-popup-overlay[data-animation="slide-right"] .bravo-popup-box {
	transform: translateX(80px);
	opacity: 0;
}
.bravo-popup-overlay[data-animation="slide-right"].bravo-popup-active .bravo-popup-box {
	transform: translateX(0);
	opacity: 1;
}

/* --- Zoom In --- */
.bravo-popup-overlay[data-animation="zoom"] .bravo-popup-box {
	transform: scale(0.75);
	opacity: 0;
}
.bravo-popup-overlay[data-animation="zoom"].bravo-popup-active .bravo-popup-box {
	transform: scale(1);
	opacity: 1;
}

/* Closing animation (reverse) */
.bravo-popup-overlay.bravo-popup-closing {
	opacity: 0;
	visibility: hidden;
}

.bravo-popup-overlay.bravo-popup-closing .bravo-popup-box {
	opacity: 0;
	transform: scale(0.9);
}

/* =============================================
   ELEMENTOR EDITOR STYLES
   ============================================= */

.bravo-popup-editor-badge {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	background: linear-gradient(135deg, #6c63ff 0%, #a855f7 100%);
	color: #fff;
	font-size: 13px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	padding: 10px 16px;
	border-radius: 10px;
	margin-bottom: 12px;
}

.bravo-popup-editor-preview-btn {
	background: var(--bravo-accent, #FDB515);
	border: 1px solid var(--bravo-accent, #FDB515);
	color: #1a1a1a;
	font-size: 12px;
	font-weight: 700;
	padding: 5px 12px;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.15s ease;
	white-space: nowrap;
}

.bravo-popup-editor-preview-btn:hover {
	background: color-mix(in srgb, var(--bravo-accent, #FDB515) 80%, #000);
	border-color: color-mix(in srgb, var(--bravo-accent, #FDB515) 80%, #000);
}

/* Editor inline preview */
.bravo-popup-editor-visible {
	position: relative !important;
	z-index: 1 !important;
	background: rgba(0, 0, 0, 0.1) !important;
	border-radius: 12px;
	padding: 20px !important;
}

.bravo-popup-editor-visible .bravo-popup-box {
	transform: none !important;
	opacity: 1 !important;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 600px) {
	.bravo-popup-box {
		padding: 28px 22px;
		border-radius: 14px;
	}

	.bravo-popup-title {
		font-size: 1.3rem;
	}

	.bravo-popup-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.bravo-popup-btn {
		width: 100%;
		justify-content: center;
	}

	.bravo-popup-close-text {
		text-align: center;
	}
}

/* =============================================
   ACCESSIBILITY — Reduced Motion
   ============================================= */

@media (prefers-reduced-motion: reduce) {
	.bravo-popup-overlay,
	.bravo-popup-box,
	.bravo-popup-btn,
	.bravo-popup-x-close {
		transition: none !important;
	}
}
