/**
 * Background Music Player — frontend styles.
 * Kept intentionally small and framework-free.
 */

.pmp-player {
	position: fixed;
	bottom: 20px;
	display: flex;
	align-items: center;
	gap: 8px;
	box-sizing: border-box;
	pointer-events: none; /* wrapper is not interactive; only the button is */
}

.pmp-player * {
	box-sizing: border-box;
}

.pmp-position-bottom-left {
	left: 16px;
}

.pmp-position-bottom-right {
	right: 16px;
}

.pmp-position-bottom-center {
	left: 50%;
	transform: translateX(-50%);
}

/*
 * Hidden position: the audio engine stays fully functional (never
 * display:none, which can pause/stop audio in some browsers). Only the
 * visual button is removed from layout and from screen readers/tab order.
 * The wrapper itself still needs `position: fixed` removed from the
 * flow-affecting properties so it can't accidentally reserve space or
 * intercept clicks.
 */
.pmp-hidden {
	position: static;
	width: 0;
	height: 0;
	overflow: hidden;
	pointer-events: none;
}

.pmp-hidden .pmp-toggle {
	width: 1px;
	height: 1px;
	min-width: 1px;
	min-height: 1px;
	padding: 0;
	margin: -1px;
	border: 0;
	opacity: 0;
	box-shadow: none;
	pointer-events: none;
}

.pmp-toggle {
	pointer-events: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	margin: 0;
	border: none;
	cursor: pointer;
	background: #1a1a1a;
	color: #fff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 13px;
	line-height: 1;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
	transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.pmp-toggle:hover {
	background: #000;
}

.pmp-toggle:active {
	transform: scale(0.96);
}

.pmp-toggle:focus-visible {
	outline: 3px solid #4d90fe;
	outline-offset: 2px;
}

.pmp-toggle .pmp-icon {
	display: block;
	flex-shrink: 0;
}

.pmp-toggle[hidden],
.pmp-icon[hidden] {
	display: none !important;
}

/* --- Minimal (default): small square-ish button, no border radius fuss --- */
.pmp-style-minimal .pmp-toggle {
	width: 44px;
	height: 44px;
	border-radius: 8px;
}

/* --- Circle --- */
.pmp-style-circle .pmp-toggle {
	width: 48px;
	height: 48px;
	border-radius: 50%;
}

/* --- Pill (with label) --- */
.pmp-style-pill .pmp-toggle {
	width: auto;
	height: 44px;
	padding: 0 16px 0 14px;
	border-radius: 999px;
}

.pmp-style-pill .pmp-toggle::after {
	content: "Music";
}

/* --- Square --- */
.pmp-style-square .pmp-toggle {
	width: 44px;
	height: 44px;
	border-radius: 0;
}

/* --- Floating: circular, slightly larger, more shadow --- */
.pmp-style-floating .pmp-toggle {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* --- Loading indicator bar (optional, toggled via JS) --- */
#pmp-loading-bar {
	position: fixed;
	top: 0;
	left: 0;
	height: 3px;
	width: 0%;
	background: #1a1a1a;
	z-index: 2147483000;
	transition: width 0.2s ease, opacity 0.3s ease;
	pointer-events: none;
}

#pmp-loading-bar.pmp-loading-active {
	width: 70%;
}

#pmp-loading-bar.pmp-loading-done {
	width: 100%;
	opacity: 0;
}

/* --- Mobile: keep it small, safe distance from edges, avoid overflow --- */
@media (max-width: 480px) {
	.pmp-player {
		bottom: max(14px, env(safe-area-inset-bottom));
	}

	.pmp-position-bottom-left {
		left: 12px;
	}

	.pmp-position-bottom-right {
		right: 12px;
	}

	.pmp-style-pill .pmp-toggle::after {
		content: "";
	}

	.pmp-style-pill .pmp-toggle {
		width: 44px;
		padding: 0;
		border-radius: 50%;
	}
}

/* RTL: mirror horizontal offsets so "left"/"right" stay logically correct. */
body.rtl .pmp-position-bottom-left {
	left: auto;
	right: 16px;
}

body.rtl .pmp-position-bottom-right {
	right: auto;
	left: 16px;
}

/* Admin-only inline notice shown when no track is selected yet. */
.pmp-admin-notice {
	position: fixed;
	bottom: 16px;
	right: 16px;
	max-width: 280px;
	padding: 10px 14px;
	background: #fff3cd;
	color: #664d03;
	border: 1px solid #ffe69c;
	border-radius: 6px;
	font-size: 12px;
	z-index: 999999;
}
