/* =========================================
	BYTE POPUP — PUBLIC CSS
	GrintByte Plugin
	========================================= */

/* -------------------------
	OVERLAY (background layer)
	------------------------- */

.bytepopup-overlay {
	position: fixed !important;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 30px; /* memberi jarak dari tepi layar */
	z-index: 999999;
	pointer-events: auto !important;
}


/* overlay aktif */
.bytepopup-overlay.active {
	opacity: 1;
	pointer-events: auto;
}

.bytepopup-overlay {
	background: var(--bp-overlay-bg, rgba(0,0,0,0.55));
	backdrop-filter: var(--bp-overlay-blur, none);
}

.bytepopup-overlay.overlay-transparent {
	background: transparent !important;
}

/* -------------------------
	WRAPPER (flex container)
	------------------------- */
.bytepopup-modal-wrapper {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column; /* penting untuk posisi vertikal */
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.bytepopup-modal-wrapper,
.bytepopup-modal {
	pointer-events: auto !important;
	position: relative;
	z-index: 9999999999 !important;
}

/* -------------------------
	MODAL BOX
	------------------------- */
.bytepopup-modal {
	background: var(--bp-bg-color, #ffffff);
	background-image: var(--bp-bg-image, none);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;

	border-radius: 12px;
	box-shadow: 0 12px 36px rgba(0,0,0,0.25);

	width: var(--bp-width, 600px);
	max-width: min(var(--bp-max-width, 90vw), 100%);
	max-height: 90vh;

	padding: 24px;
	overflow: hidden;

	position: relative;
	transform-origin: center center;
	transition: transform .28s ease, opacity .28s ease;
}

/* close button */
.bytepopup-close {
	position: absolute;
	z-index: 99999999999 !important;
	pointer-events: auto !important;
	top: 8px;
	right: 10px;
	border: none;
	background: transparent;
	font-size: 22px;
	cursor: pointer;
	line-height: 1;
}

/* -------------------------
	POSITIONS + SAFE SPACING
	------------------------- */

/* center */
.position-center-center .bytepopup-modal-wrapper {
	justify-content: center;
	align-items: center;
}

/* top-left */
.position-top-left .bytepopup-modal-wrapper {
	justify-content: flex-start;
	align-items: flex-start;

	padding-top: 40px;
	padding-left: 40px;
}

/* top-right */
.position-top-right .bytepopup-modal-wrapper {
	justify-content: flex-start;
	align-items: flex-end;

	padding-top: 40px;
	padding-right: 40px;
}

/* bottom-left */
.position-bottom-left .bytepopup-modal-wrapper {
	justify-content: flex-end;
	align-items: flex-start;

	padding-bottom: 40px;
	padding-left: 40px;
}

/* bottom-right */
.position-bottom-right .bytepopup-modal-wrapper {
	justify-content: flex-end;
	align-items: flex-end;

	padding-bottom: 40px;
	padding-right: 40px;
}

/* -------------------------
	ANIMATIONS
	------------------------- */

/* fade */
.bytepopup-modal.anim-fade {
	opacity: 0;
	transform: translateY(6px) scale(1);
}
.bytepopup-overlay.active .bytepopup-modal.anim-fade {
	opacity: 1;
	transform: translateY(0) scale(1);
}

/* slide up */
.bytepopup-modal.anim-slide {
	opacity: 0;
	transform: translateY(20px);
}
.bytepopup-overlay.active .bytepopup-modal.anim-slide {
	opacity: 1;
	transform: translateY(0);
}

/* zoom */
.bytepopup-modal.anim-zoom {
	opacity: 0;
	transform: scale(.92);
}
.bytepopup-overlay.active .bytepopup-modal.anim-zoom {
	opacity: 1;
	transform: scale(1);
}

/* closing animation */
.bytepopup-modal.anim-closing {
	opacity: 0 !important;
	transform: scale(.98) !important;
}

/* -------------------------
	RESPONSIVE
	------------------------- */
@media (max-width: 480px) {
	.bytepopup-modal {
		width: 100% !important;
		max-width: 100% !important;
		border-radius: 10px;
		padding: 16px;
	}
}

/* ==============================
	CONTENT FIT TO MODAL
	============================== */

.bytepopup-content {
	max-height: calc(90vh - 80px);
	overflow-y: auto;
	overflow-x: hidden;
}

.bytepopup-content img,
.bytepopup-content iframe,
.bytepopup-content video {
	max-width: 100%;
	height: auto;
	display: block;
	border-radius: 8px;
}

/* Scrollbar minimal */
.bytepopup-content::-webkit-scrollbar {
	width: 6px;
}
.bytepopup-content::-webkit-scrollbar-thumb {
	background: rgba(0,0,0,0.25);
	border-radius: 6px;
}

/* ==============================
	SLIM & ELEGANT CLOSE BUTTON
	============================== */

.bytepopup-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	font-size: 22px;
	line-height: 1;
	padding: 0;
	border: none;
	background: rgba(255,255,255,0.9);
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;

	color: #333;
	font-weight: 400;

	transition: background 0.25s ease, transform 0.25s ease;
}

/* Hover state */
.bytepopup-close:hover {
	background: rgba(0,0,0,0.08);
	transform: scale(1.07);
}

/* Focus accessible */
.bytepopup-close:focus {
	outline: 2px solid #007cba;
	outline-offset: 3px;
}

/* ==============================
	ANIMATIONS
	============================== */

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

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