/* Shell only — Pack CSS owns the visual player */
.wpcrm-audio-player {
	--ap-title-bg: linear-gradient(180deg, rgba(24, 34, 48, 0.95), rgba(14, 20, 28, 0.98));
	--ap-title-border: rgba(0, 229, 255, 0.28);
	--ap-title-text: #d7f7ff;
	--ap-title-glow: rgba(0, 229, 255, 0.18);
	direction: ltr;
	max-width: 640px;
	margin: 1.75rem auto;
	font-family: inherit;
	-webkit-user-select: none;
	user-select: none;
	color: #e8d4a8;
}

.wpcrm-audio-player[data-theme="light"] {
	--ap-title-bg: linear-gradient(180deg, #ffffff, #f3f6fa);
	--ap-title-border: rgba(40, 80, 120, 0.18);
	--ap-title-text: #1c2a38;
	--ap-title-glow: rgba(40, 120, 180, 0.08);
}

/* Tiffany Blue Box® look — robin-egg #81D8D0 + black/white */
.wpcrm-audio-player[data-theme="tiffany"] {
	--ap-title-bg: linear-gradient(180deg, #8fddd6, #81d8d0);
	--ap-title-border: rgba(255, 255, 255, 0.65);
	--ap-title-text: #000000;
	--ap-title-glow: rgba(0, 0, 0, 0.08);
}

.wpcrm-audio-player__title-box {
	margin: 0 0 10px;
	padding: 10px 14px;
	border-radius: 14px;
	border: 1px solid var(--ap-title-border);
	background: var(--ap-title-bg);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 0 18px var(--ap-title-glow);
	overflow: hidden;
}

.wpcrm-audio-player__title-track {
	position: relative;
	overflow: hidden;
	white-space: nowrap;
	/* Mask only while marquee runs — otherwise short titles look faded at the edges. */
	mask-image: none;
	-webkit-mask-image: none;
}

.wpcrm-audio-player__title-text {
	display: inline-block;
	font-family: inherit;
	color: var(--ap-title-text);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1.35;
	max-width: 100%;
	opacity: 1;
}

.wpcrm-audio-player__title-track.is-marquee {
	mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.wpcrm-audio-player__title-track.is-marquee .wpcrm-audio-player__title-text {
	max-width: none;
	padding-inline-end: 2em;
	animation: wpcrm-ap-marquee var(--apc-marquee-duration, 12s) linear infinite;
}

@keyframes wpcrm-ap-marquee {
	0%,
	8% {
		transform: translateX(0);
	}
	92%,
	100% {
		transform: translateX(calc(-1 * var(--apc-marquee-distance, 80px)));
	}
}

.wpcrm-audio-player__media {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.wpcrm-audio-player__mount {
	position: relative;
	width: 100%;
}

.wpcrm-audio-player__pack-missing {
	margin: 0;
	padding: 16px;
	text-align: center;
	direction: rtl;
	color: #e08070;
	background: rgba(40, 20, 10, 0.8);
	border-radius: 8px;
}

.wpcrm-audio-player__mode-toggle {
	display: flex;
	justify-content: center;
	margin-top: 12px;
}

.wpcrm-audio-player__mode-btn {
	border: 1px solid rgba(200, 160, 90, 0.4);
	background: rgba(60, 40, 20, 0.65);
	color: #e8d4a8;
	border-radius: 999px;
	padding: 6px 18px;
	font-size: 12px;
	cursor: pointer;
	font-family: inherit;
	direction: rtl;
}

.wpcrm-audio-player__mode-btn:hover {
	background: rgba(90, 60, 30, 0.75);
}

.wpcrm-audio-player__gate {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	align-items: center;
	margin-top: 14px;
	direction: rtl;
}

.wpcrm-audio-player__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 16px;
	border-radius: 8px;
	background: #5a3a18;
	color: #fff8e8 !important;
	text-decoration: none !important;
	border: none;
	cursor: pointer;
	font-size: 14px;
	font-family: inherit;
}

.wpcrm-audio-player__cta--pay {
	background: #8a4a18;
}

.wpcrm-audio-player__gate-note {
	margin: 0;
	font-size: 13px;
	color: #c4a878;
	direction: rtl;
}

.wpcrm-audio-player__hint {
	margin: 10px 0 0;
	font-size: 12px;
	color: #c4a878;
	text-align: center;
	direction: rtl;
}

.wpcrm-audio-player__hint.is-error {
	color: #e08070;
}

.wpcrm-audio-player.is-dsp-on .wpcrm-audio-player__hint:not(.is-error) {
	color: #7dba6a;
}

/* Tiny probe at the top of the player — used to detect "head scrolled away". */
.wpcrm-ap-sticky-sentinel {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 1px;
	width: 100%;
	pointer-events: none;
	visibility: hidden;
	z-index: 0;
}

/* Sticky mini dock — only while playing + player head scrolled out of view */
html.wpcrm-ap-sticky-dock-visible {
	scroll-padding-bottom: 84px;
}

html.wpcrm-ap-sticky-dock-visible body {
	padding-bottom: 84px;
}

.wpcrm-ap-sticky-dock {
	position: fixed;
	z-index: 99990;
	left: 50%;
	bottom: 14px;
	transform: translateX(-50%) translateY(120%);
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-radius: 999px;
	background: linear-gradient(180deg, rgba(28, 36, 48, 0.96), rgba(10, 14, 20, 0.98));
	border: 1px solid rgba(0, 229, 255, 0.35);
	box-shadow:
		0 12px 32px rgba(0, 0, 0, 0.55),
		0 0 24px rgba(0, 229, 255, 0.12),
		inset 0 1px 0 rgba(255, 255, 255, 0.12);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	direction: ltr;
	opacity: 0;
	pointer-events: none;
	visibility: hidden;
	transition:
		transform 0.28s ease,
		opacity 0.22s ease,
		visibility 0.22s ease;
}

.wpcrm-ap-sticky-dock.is-visible {
	transform: translateX(-50%) translateY(0);
	opacity: 1;
	pointer-events: auto;
	visibility: visible;
}

.wpcrm-ap-sticky-dock__btn {
	position: relative;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1px solid rgba(160, 230, 255, 0.35);
	cursor: pointer;
	padding: 0;
	color: #c8f7ff;
	background:
		linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 40%),
		linear-gradient(180deg, #3a5a72, #121c28);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.25) inset,
		0 6px 0 #050a10,
		0 8px 16px rgba(0, 0, 0, 0.45);
}

.wpcrm-ap-sticky-dock__btn:active {
	transform: translateY(3px);
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.1) inset,
		0 2px 0 #050a10;
}

.wpcrm-ap-sticky-dock__btn.is-active,
.wpcrm-ap-sticky-dock.is-playing [data-dock="play"] {
	border-color: rgba(120, 255, 160, 0.65);
	color: #d9ffe0;
	background:
		linear-gradient(145deg, rgba(220, 255, 230, 0.22), transparent 40%),
		linear-gradient(180deg, #3f8a55, #0b1a10);
}

.wpcrm-ap-sticky-dock__btn--close {
	border-color: rgba(255, 120, 120, 0.4);
	color: #ffc0c0;
}

.wpcrm-ap-sticky-dock__ico {
	position: absolute;
	inset: 0;
	margin: auto;
	pointer-events: none;
}

.wpcrm-ap-sticky-dock__ico--play {
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 8px 0 8px 13px;
	border-color: transparent transparent transparent currentColor;
	margin-left: 17px;
}

.wpcrm-ap-sticky-dock.is-playing .wpcrm-ap-sticky-dock__ico--play {
	width: 12px;
	height: 14px;
	border: 0;
	margin: auto;
	background:
		linear-gradient(currentColor, currentColor) 0 0 / 4px 100% no-repeat,
		linear-gradient(currentColor, currentColor) 100% 0 / 4px 100% no-repeat;
}

.wpcrm-ap-sticky-dock__ico--stop {
	width: 12px;
	height: 12px;
	border-radius: 2px;
	background: currentColor;
}

.wpcrm-ap-sticky-dock__ico--close {
	width: 14px;
	height: 14px;
}

.wpcrm-ap-sticky-dock__ico--close::before,
.wpcrm-ap-sticky-dock__ico--close::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 14px;
	height: 2px;
	border-radius: 1px;
	background: currentColor;
}

.wpcrm-ap-sticky-dock__ico--close::before {
	transform: translate(-50%, -50%) rotate(45deg);
}

.wpcrm-ap-sticky-dock__ico--close::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

@media (max-width: 480px) {
	.wpcrm-ap-sticky-dock {
		bottom: 10px;
		gap: 8px;
		padding: 8px 12px;
	}
	.wpcrm-ap-sticky-dock__btn {
		width: 42px;
		height: 42px;
	}
}

/* Admin preview: rack reorder */
.wpcrm-audio-player.is-label-editor .apc-rack-order {
	display: inline-flex;
	gap: 2px;
	margin-right: 8px;
	vertical-align: middle;
}

.wpcrm-audio-player.is-label-editor .apc-rack-order-btn {
	width: 22px;
	height: 22px;
	padding: 0;
	border: 1px solid rgba(0, 229, 255, 0.35);
	border-radius: 4px;
	background: rgba(0, 229, 255, 0.08);
	color: inherit;
	font-size: 10px;
	line-height: 1;
	cursor: pointer;
}

.wpcrm-audio-player.is-label-editor .apc-rack-order-btn:hover {
	background: rgba(0, 229, 255, 0.2);
}

/* Admin preview: rename labels by double-click */
.wpcrm-audio-player.is-label-editor .is-label-editable {
	cursor: text;
	-webkit-user-select: text;
	user-select: text;
	outline: 1px dashed rgba(0, 229, 255, 0.35);
	outline-offset: 2px;
	border-radius: 4px;
}

.wpcrm-audio-player.is-label-editor .is-label-editable.is-label-editing,
.wpcrm-audio-player.is-label-editor .is-label-editable:focus {
	outline-color: rgba(0, 229, 255, 0.85);
	background: rgba(0, 229, 255, 0.08);
}

.wpcrm-audio-player.is-label-editor .apc-btn.is-label-editable {
	outline-offset: 3px;
}
