/**
 * Global Persistent Video Player Styles
 * MyBeautyQueens (IPS 4.7)
 */

/* ─── PJAX Navigation Progress Bar ─── */
#mbq-pjax-progress {
	position: fixed;
	top: 0;
	left: 0;
	height: 3px;
	background: linear-gradient(90deg, #e02424 0%, #f43f5e 50%, #facc15 100%);
	z-index: 99999;
	box-shadow: 0 0 12px rgba(224, 36, 36, 0.85);
	transition: width 0.22s ease-out, opacity 0.3s ease;
	pointer-events: none;
}

/* ─── Global Video Player Overlay ─── */
#global-video-player {
	width: 100%;
	height: 0;
	overflow: hidden;
	transition: height 0.45s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.3s ease, transform 0.3s ease;
	background: #0b0c10;
	position: relative;
	z-index: 5000;
	box-sizing: border-box;
	border-bottom: 2px solid transparent;
}

#global-video-player.active {
	height: 450px;
	border-bottom: 2px solid #e02424;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
}

/* ─── Player Header & Control Bar ─── */
.mbq-player-header-bar {
	height: 42px;
	background: linear-gradient(180deg, #181a24 0%, #0e1017 100%);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 16px;
	color: #f3f4f6;
	user-select: none;
}

.mbq-player-title-box {
	display: flex;
	align-items: center;
	gap: 10px;
	overflow: hidden;
	white-space: nowrap;
}

.mbq-player-live-badge {
	background: #e02424;
	color: #ffffff;
	font-size: 9px;
	font-weight: 800;
	padding: 3px 7px;
	border-radius: 4px;
	letter-spacing: 0.5px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.mbq-player-live-badge i {
	font-size: 7px;
	animation: mbqPulseDot 1.5s infinite;
}

@keyframes mbqPulseDot {
	0% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.3; transform: scale(0.85); }
	100% { opacity: 1; transform: scale(1); }
}

.mbq-player-title {
	font-weight: 600;
	font-size: 13px;
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.mbq-player-status {
	font-size: 11px;
	color: #9ca3af;
	border-left: 1px solid rgba(255, 255, 255, 0.15);
	padding-left: 10px;
	max-width: 250px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mbq-player-controls-box {
	display: flex;
	align-items: center;
	gap: 8px;
}

.mbq-ctrl-btn {
	background: transparent;
	border: none;
	color: #9ca3af;
	font-size: 14px;
	width: 30px;
	height: 30px;
	border-radius: 6px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
}

.mbq-ctrl-btn:hover {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.1);
}

#close-player {
	font-size: 22px;
	line-height: 1;
}

/* ─── Video Viewport Wrapper ─── */
.player-wrapper {
	height: calc(100% - 42px);
	width: 100%;
	background: #000;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

#yt-player-container {
	width: 100%;
	height: 100%;
	position: relative;
}

#yt-player {
	width: 100%;
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
	border: 0;
}

/* ─── Floating Picture-in-Picture (PiP) Mode ─── */
#global-video-player.pip-mode {
	position: fixed !important;
	bottom: 85px !important;
	right: 24px !important;
	width: 380px !important;
	height: 250px !important;
	border-radius: 12px !important;
	box-shadow: 0 16px 45px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.15) !important;
	z-index: 5002 !important;
	overflow: hidden !important;
	border-bottom: none !important;
}

#global-video-player.pip-mode .mbq-player-status {
	display: none;
}

/* ─── Circular Play Button next to Customizer ─── */
.mbq-player-nav-item {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	vertical-align: middle !important;
	padding: 0 4px !important;
}

#elUserNav .mbq-player-nav-item {
	height: var(--user-nav--height, 40px);
}

.mbq-play-circular-btn {
	width: 32px !important;
	height: 32px !important;
	border-radius: 50% !important;
	background: linear-gradient(135deg, #e02424 0%, #991b1b 100%) !important;
	color: #ffffff !important;
	border: 1px solid rgba(255, 255, 255, 0.4) !important;
	box-shadow: 0 2px 10px rgba(224, 36, 36, 0.5), 0 0 0 0 rgba(224, 36, 36, 0.7);
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	text-align: center !important;
	cursor: pointer;
	position: relative !important;
	text-decoration: none !important;
	outline: none;
	user-select: none;
	transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, filter 0.25s ease !important;
	animation: mbqContinuousPlayPulse 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

/* Continuous Radar Ring Effect inviting user to play */
.mbq-play-circular-btn::after {
	content: "";
	position: absolute;
	top: -3px;
	left: -3px;
	right: -3px;
	bottom: -3px;
	border-radius: 50%;
	border: 2px solid #e02424;
	pointer-events: none;
	animation: mbqContinuousPlayWave 2s infinite cubic-bezier(0.2, 0.8, 0.3, 1);
}

.mbq-play-circular-btn .fa,
.mbq-play-circular-btn .fa-play {
	font-size: 12px !important;
	color: #ffffff !important;
	margin-left: 2px !important; /* Optical centering for play triangle */
	line-height: 1 !important;
	min-width: auto !important;
	display: inline-block;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
	transition: transform 0.2s ease;
}

.mbq-play-circular-btn:hover {
	transform: scale(1.14) !important;
	filter: brightness(1.15);
	box-shadow: 0 0 16px rgba(224, 36, 36, 0.85), 0 0 0 2px rgba(255, 255, 255, 0.5) !important;
}

.mbq-play-circular-btn:active {
	transform: scale(0.95) !important;
}

/* Continuous Attention-Grabbing Pulse */
@keyframes mbqContinuousPlayPulse {
	0% {
		box-shadow: 0 0 0 0 rgba(224, 36, 36, 0.8), 0 2px 8px rgba(0, 0, 0, 0.35);
		transform: scale(1);
	}
	50% {
		box-shadow: 0 0 0 8px rgba(224, 36, 36, 0), 0 4px 14px rgba(224, 36, 36, 0.7);
		transform: scale(1.06);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(224, 36, 36, 0), 0 2px 8px rgba(0, 0, 0, 0.35);
		transform: scale(1);
	}
}

@keyframes mbqContinuousPlayWave {
	0% {
		transform: scale(0.95);
		opacity: 0.95;
	}
	60% {
		transform: scale(1.55);
		opacity: 0;
	}
	100% {
		transform: scale(1.6);
		opacity: 0;
	}
}

/* Playing state (active playback) */
.mbq-play-circular-btn.is-playing {
	background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
	animation: mbqPlayingGreenPulse 1.8s infinite ease-in-out;
}

.mbq-play-circular-btn.is-playing::after {
	border-color: #10b981;
}

.mbq-play-circular-btn.is-playing .fa-play::before {
	content: "\f04c"; /* fa-pause */
}

.mbq-play-circular-btn.is-playing .fa-play {
	margin-left: 0 !important;
}

@keyframes mbqPlayingGreenPulse {
	0%, 100% {
		box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7), 0 2px 8px rgba(0, 0, 0, 0.35);
	}
	50% {
		box-shadow: 0 0 0 6px rgba(16, 185, 129, 0), 0 4px 12px rgba(16, 185, 129, 0.5);
	}
}

/* Mobile navbar item */
.mbq-player-nav-item-mobile {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 0 3px !important;
}

.mbq-play-circular-btn--mobile {
	width: 28px !important;
	height: 28px !important;
}

.mbq-play-circular-btn--mobile .fa-play {
	font-size: 10px !important;
}

/* Hide legacy floating button if any lingering markup exists */
.music-trigger-btn {
	display: none !important;
}

/* ─── Responsive Media Queries ─── */
@media (max-width: 768px) {
	#global-video-player.active {
		height: 270px;
	}

	.mbq-player-status {
		display: none;
	}

	#global-video-player.pip-mode {
		width: calc(100% - 32px) !important;
		right: 16px !important;
		bottom: 75px !important;
		height: 220px !important;
	}

	/* mobile trigger handled by .mbq-play-circular-btn--mobile */
}
