/**
 * Plastik Track Pill
 * Bottom-anchored mini player. Sits under the mobile nav dropdown (z-index 200)
 * and above the fixed header (z-index 100).
 */

.ptp {
	--ptp-bg: rgba(19, 19, 24, 0.86);
	--ptp-border: rgba(255, 255, 255, 0.12);
	--ptp-accent: #ff0086;
	--ptp-text: #ffffff;
	--ptp-muted: rgba(255, 255, 255, 0.58);
	--ptp-track: rgba(255, 255, 255, 0.16);

	position: fixed;
	z-index: 150;
	left: 50%;
	bottom: calc(18px + env(safe-area-inset-bottom, 0px));
	transform: translate(-50%, 140%);

	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 12px;

	width: max-content;
	max-width: calc(100vw - 32px);
	padding: 10px 12px;

	font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--ptp-text);

	background: var(--ptp-bg);
	border: 1px solid var(--ptp-border);
	border-radius: 999px;
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4);

	opacity: 0;
	visibility: hidden;
	transition: transform 520ms cubic-bezier(0.16, 1, 0.3, 1), opacity 320ms ease, visibility 0s linear 520ms;
}

@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
	.ptp {
		background: rgba(19, 19, 24, 0.72);
		-webkit-backdrop-filter: blur(22px) saturate(1.5);
		backdrop-filter: blur(22px) saturate(1.5);
	}
}

.ptp[data-state="visible"] {
	transform: translate(-50%, 0);
	opacity: 1;
	visibility: visible;
	transition-delay: 0s;
}

/*
 * `display: flex` above beats the UA rule for the [hidden] attribute, so the
 * attribute has to be re-asserted or the pill paints before JS reveals it.
 */
.ptp[hidden] {
	display: none !important;
}

.ptp *,
.ptp *::before,
.ptp *::after {
	box-sizing: border-box;
}

/* Buttons: hello-elementor styles every un-classed button, so reset explicitly. */
.ptp button {
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.ptp button:hover {
	background: rgba(255, 255, 255, 0.1);
}

.ptp :focus-visible {
	outline: 2px solid var(--ptp-accent);
	outline-offset: 3px;
}

.ptp__icon,
.ptp__close svg {
	width: 20px;
	height: 20px;
	display: block;
	fill: currentColor;
	pointer-events: none;
}

/* ---------- play / pause ---------- */

/*
 * Qualified with `button` deliberately. The reset above is `.ptp button`
 * (0-1-1), which outranks a bare `.ptp__play` (0-1-0) and would strip the
 * accent fill back to transparent.
 */
.ptp button.ptp__play {
	position: relative;
	width: 44px;
	height: 44px;
	color: #ffffff;
	background: var(--ptp-accent);
	box-shadow: 0 4px 12px rgba(255, 0, 134, 0.32);
}

.ptp button.ptp__play:hover {
	background: #ff2496;
	transform: scale(1.04);
}

.ptp__play .ptp__icon--play {
	margin-left: 2px;
}

.ptp__play .ptp__icon--pause,
.ptp[data-playing="true"] .ptp__play .ptp__icon--play {
	display: none;
}

.ptp[data-playing="true"] .ptp__play .ptp__icon--pause {
	display: block;
}

.ptp__spinner {
	display: none;
	position: absolute;
	width: 20px;
	height: 20px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: ptp-spin 700ms linear infinite;
}

.ptp[data-loading="true"] .ptp__play .ptp__icon {
	visibility: hidden;
}

.ptp[data-loading="true"] .ptp__spinner {
	display: block;
}

@keyframes ptp-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------- meta + scrubber ---------- */

.ptp__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	width: 210px;
}

.ptp__meta {
	display: flex;
	align-items: baseline;
	gap: 7px;
	min-width: 0;
	line-height: 1.2;
}

.ptp__title {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--ptp-text);
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex: 0 1 auto;
}

a.ptp__title:hover,
a.ptp__title:focus-visible {
	color: var(--ptp-accent);
	text-decoration: none;
}

.ptp__artist {
	font-size: 11px;
	font-weight: 400;
	color: var(--ptp-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex: 1 1 auto;
	min-width: 0;
}

.ptp__scrub {
	position: relative;
	padding: 5px 0;
	cursor: pointer;
	touch-action: none;
}

.ptp__track {
	height: 4px;
	border-radius: 999px;
	background: var(--ptp-track);
	overflow: hidden;
}

.ptp__fill {
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: var(--ptp-accent);
	transform-origin: left center;
}

.ptp__scrub::after {
	content: "";
	position: absolute;
	top: 50%;
	left: var(--ptp-progress, 0%);
	width: 11px;
	height: 11px;
	margin-left: -5.5px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
	transform: translateY(-50%) scale(0);
	transition: transform 160ms ease;
	pointer-events: none;
}

.ptp__scrub:hover::after,
.ptp__scrub:focus-visible::after,
.ptp__scrub[data-dragging="true"]::after {
	transform: translateY(-50%) scale(1);
}

/* ---------- time, mute, close ---------- */

.ptp__time {
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1;
	color: var(--ptp-muted);
	flex: 0 0 auto;
	min-width: 66px;
	text-align: right;
	white-space: nowrap;
}

.ptp__mute,
.ptp__close {
	width: 32px;
	height: 32px;
	color: var(--ptp-muted);
}

.ptp__mute:hover,
.ptp__close:hover {
	color: var(--ptp-text);
}

.ptp__mute .ptp__icon--vol path.ptp__wave,
.ptp__mute .ptp__icon--muted path:not(:first-child) {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
}

.ptp__mute .ptp__icon--muted,
.ptp[data-muted="true"] .ptp__mute .ptp__icon--vol {
	display: none;
}

.ptp[data-muted="true"] .ptp__mute .ptp__icon--muted {
	display: block;
}

.ptp__close svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
}

/* ---------- responsive ---------- */

@media (max-width: 600px) {
	.ptp {
		left: 12px;
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		width: auto;
		max-width: none;
		transform: translateY(140%);
		gap: 10px;
		padding: 9px 10px;
	}

	.ptp[data-state="visible"] {
		transform: translateY(0);
	}

	.ptp__body {
		width: auto;
		flex: 1 1 auto;
	}

	.ptp button.ptp__play {
		width: 40px;
		height: 40px;
	}

	/* Reclaim the width for the track title. */
	.ptp__time-total {
		display: none;
	}

	.ptp__time {
		min-width: 32px;
	}
}

@media (max-width: 400px) {
	.ptp__time {
		display: none;
	}

	.ptp__mute {
		display: none;
	}
}

/* ---------- preferences ---------- */

@media (prefers-reduced-motion: reduce) {
	.ptp {
		transition: opacity 200ms ease, visibility 0s linear 200ms;
		transform: translate(-50%, 0);
	}

	.ptp[data-state="visible"] {
		transform: translate(-50%, 0);
	}

	.ptp__play:hover {
		transform: none;
	}

	.ptp__spinner {
		animation-duration: 2s;
	}

	@media (max-width: 600px) {
		.ptp,
		.ptp[data-state="visible"] {
			transform: none;
		}
	}
}

@media print {
	.ptp {
		display: none !important;
	}
}
