/**
 * MT PopUp PRO - Frontend Stylesheet
 * Ultra-lightweight, responsive, zero-dependency modern CSS modal layout.
 *
 * Prodotto con il ❤️ da MT Creazioni Web di Truzzi Mattia
 */

:root {
	--mt-overlay-bg: rgba(0, 0, 0, 0.6);
	--mt-backdrop-filter: blur(5px);
	--mt-modal-bg: #ffffff;
	--mt-modal-color: #333333;
	--mt-modal-radius: 16px;
	--mt-modal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	--mt-modal-max-width: 600px;
	--mt-modal-padding: 30px;
	--mt-close-color: #333333;
	--mt-close-hover: #e74c3c;
}

/* Fullscreen Overlay */
.mt-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100vw;
	height: 100vh;
	z-index: 999999;
	background-color: var(--mt-overlay-bg);
	-webkit-backdrop-filter: var(--mt-backdrop-filter);
	backdrop-filter: var(--mt-backdrop-filter);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1);
	box-sizing: border-box;
	padding: 20px;
}

.mt-popup-overlay.mt-popup-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* Dialog Container Box */
.mt-popup-dialog {
	position: relative;
	width: 100%;
	max-width: var(--mt-modal-max-width);
	max-height: 90vh;
	background-color: var(--mt-modal-bg);
	color: var(--mt-modal-color);
	border-radius: var(--mt-modal-radius);
	box-shadow: var(--mt-modal-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	margin: auto;
	box-sizing: border-box;
	transform-origin: center center;
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Inner Body with Touch Scroll */
.mt-popup-body {
	padding: var(--mt-modal-padding);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.6;
	color: inherit;
	box-sizing: border-box;
	word-wrap: break-word;
}

.mt-popup-body h1,
.mt-popup-body h2,
.mt-popup-body h3,
.mt-popup-body h4,
.mt-popup-body h5,
.mt-popup-body h6 {
	margin-top: 0;
	color: inherit;
	line-height: 1.25;
}

.mt-popup-body img,
.mt-popup-body video,
.mt-popup-body iframe,
.mt-popup-body embed,
.mt-popup-body object {
	max-width: 100% !important;
	height: auto !important;
	border-radius: 6px;
}

.mt-popup-body p:last-child {
	margin-bottom: 0;
}

/* Custom Scrollbar for Body */
.mt-popup-body::-webkit-scrollbar {
	width: 6px;
}
.mt-popup-body::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.04);
	border-radius: 4px;
}
.mt-popup-body::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.2);
	border-radius: 4px;
}
.mt-popup-body::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 0, 0, 0.35);
}

/* ----------------------------------------------------
   CLOSE BUTTON VARIANTS ("X")
   ---------------------------------------------------- */
.mt-popup-close {
	position: absolute;
	border: none;
	background: transparent;
	color: var(--mt-close-color);
	cursor: pointer;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	line-height: 1;
	outline: none;
	transition: all 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.mt-popup-close:hover {
	color: var(--mt-close-hover);
}

.mt-popup-close svg {
	display: block;
	transition: transform 0.2s ease;
}

.mt-popup-close:hover svg {
	transform: scale(1.1);
}

/* Close Positions */
.mt-close-pos-inside .mt-popup-close {
	top: 14px;
	right: 14px;
}

.mt-close-pos-outside_floating .mt-popup-close {
	top: -46px;
	right: 0px;
	color: #ffffff;
}
.mt-close-pos-outside_floating .mt-popup-close:hover {
	color: #f3f4f6;
}

/* Style 1: Minimal */
.mt-close-style-minimal {
	width: 32px;
	height: 32px;
	border-radius: 6px;
}

/* Style 2: Bold Geometric */
.mt-close-style-bold {
	width: 36px;
	height: 36px;
	border-radius: 8px;
}

/* Style 3: Circle with Full Background */
.mt-close-style-circle {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background-color: rgba(0, 0, 0, 0.07);
}
.mt-close-style-circle:hover {
	background-color: rgba(0, 0, 0, 0.14);
}

/* Style 4: Squared Corner Badge */
.mt-close-style-badge {
	top: 0 !important;
	right: 0 !important;
	width: 40px;
	height: 40px;
	background-color: rgba(0, 0, 0, 0.08);
	border-radius: 0 0 0 10px;
}
.mt-close-style-badge:hover {
	background-color: rgba(231, 76, 60, 0.15);
}

/* ----------------------------------------------------
   ENTRANCE ANIMATIONS
   ---------------------------------------------------- */
/* 1. Zoom / Scale */
.mt-anim-zoom {
	transform: scale(0.85);
	opacity: 0;
}
.mt-popup-overlay.mt-popup-active .mt-anim-zoom {
	transform: scale(1);
	opacity: 1;
}

/* 2. Fade In */
.mt-anim-fade {
	transform: scale(1);
	opacity: 0;
}
.mt-popup-overlay.mt-popup-active .mt-anim-fade {
	opacity: 1;
}

/* 3. Slide Down */
.mt-anim-slide {
	transform: translateY(-40px);
	opacity: 0;
}
.mt-popup-overlay.mt-popup-active .mt-anim-slide {
	transform: translateY(0);
	opacity: 1;
}

/* Demo Button Style for content */
.mt-demo-btn {
	display: inline-block;
	background: #4f46e5;
	color: #ffffff !important;
	padding: 10px 22px;
	border-radius: 8px;
	text-decoration: none !important;
	font-weight: 600;
	font-size: 14px;
	transition: background 0.2s ease, transform 0.15s ease;
	box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.mt-demo-btn:hover {
	background: #4338ca;
	transform: translateY(-1px);
}

/* ----------------------------------------------------
   RESPONSIVE DESIGN (320px+)
   ---------------------------------------------------- */
@media (max-width: 640px) {
	.mt-popup-overlay {
		padding: 12px;
	}

	.mt-popup-dialog {
		max-width: 92vw !important;
		max-height: 88vh !important;
	}

	.mt-popup-body {
		padding: 20px !important;
		font-size: 0.95rem;
	}

	.mt-close-pos-outside_floating .mt-popup-close {
		top: -40px;
		right: 4px;
	}
}
