/* ═══════════════════════════════════════════════════════════════
   PAM Video Modal Player
   ═══════════════════════════════════════════════════════════════ */

body.pam-no-scroll {
	overflow: hidden;
}

/* ── Modal shell ─────────────────────────────────────────────── */
#pam-video-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.28s ease, visibility 0.28s ease;
	box-sizing: border-box;
}

#pam-video-modal[hidden] {
	display: none !important;
}

#pam-video-modal.pam-modal--open {
	opacity: 1;
	visibility: visible;
}

/* ── Overlay ─────────────────────────────────────────────────── */
.pam-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
	cursor: pointer;
}

/* backdrop-filter for browsers that support it */
@supports (backdrop-filter: blur(6px)) {
	.pam-modal-overlay {
		background: rgba(0, 0, 0, 0.82);
		backdrop-filter: blur(6px);
		-webkit-backdrop-filter: blur(6px);
	}
}

/* ── Dialog ──────────────────────────────────────────────────── */
.pam-modal-dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 980px;
	transform: scale(0.93) translateY(16px);
	transition: transform 0.3s cubic-bezier(0.34, 1.18, 0.64, 1);
}

#pam-video-modal.pam-modal--open .pam-modal-dialog {
	transform: scale(1) translateY(0);
}

/* ── Close button ────────────────────────────────────────────── */
.pam-modal-close {
	position: absolute;
	top: -52px;
	right: 0;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	border: 1.5px solid rgba(255, 255, 255, 0.22);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, border-color 0.2s;
	padding: 0;
}

.pam-modal-close:hover {
	background: rgba(255, 255, 255, 0.28);
	border-color: rgba(255, 255, 255, 0.4);
}

.pam-modal-close:focus {
	outline: 2px solid #c9a960;
	outline-offset: 3px;
}

/* ── Player frame ────────────────────────────────────────────── */
.pam-modal-player {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 12px;
	overflow: hidden;
	box-shadow:
		0 24px 80px rgba(0, 0, 0, 0.85),
		0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Loading shimmer before iframe loads */
.pam-modal-player::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, #111 25%, #1a1a1a 50%, #111 75%);
	background-size: 200% 100%;
	animation: pam-shimmer 1.4s ease infinite;
	z-index: 0;
}

.pam-modal-player iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
	display: block;
	z-index: 1;
}

@keyframes pam-shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* ── Info bar ────────────────────────────────────────────────── */
.pam-modal-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 2px 0;
}

.pam-modal-title {
	color: rgba(255, 255, 255, 0.9);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pam-modal-yt-link {
	flex-shrink: 0;
	color: rgba(255, 255, 255, 0.38);
	font-size: 12px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.2s;
}

.pam-modal-yt-link:hover {
	color: rgba(255, 255, 255, 0.72);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
	#pam-video-modal {
		padding: 12px;
		align-items: flex-end;
	}

	.pam-modal-dialog {
		max-width: 100%;
	}

	.pam-modal-close {
		top: -46px;
		width: 36px;
		height: 36px;
		font-size: 17px;
	}

	.pam-modal-player {
		border-radius: 8px;
	}

	.pam-modal-title {
		font-size: 13px;
	}
}
