/*
 * The Boss Voice Section Player: small voice button.
 *
 * Every visual value comes from CSS custom properties (--tbvsp-*) that the
 * Design Customizer writes (see TBVSP_Design::vars). The fallbacks below are the
 * default Minimal Circle design, so the button looks right even without them.
 * All selectors start with .tbvsp: nothing outside the component is touched.
 */
.tbvsp {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: var(--tbvsp-mt, 0px) 0 var(--tbvsp-mb, 0px);
	padding: 0;
	font-family: inherit;
	-webkit-tap-highlight-color: transparent;
}
.tbvsp *,
.tbvsp *::before,
.tbvsp *::after { box-sizing: border-box; }

.tbvsp--left { align-items: flex-start; }
.tbvsp--right { align-items: flex-end; }
.tbvsp--inline {
	display: inline-flex;
	width: auto;
	max-width: none;
	vertical-align: middle;
}

/* optional small text above the button (only if the eyebrow attribute is used) */
.tbvsp__eyebrow {
	display: block;
	margin: 0 0 8px;
	color: rgba(255, 255, 255, 0.65);
	font-size: 11px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}
.tbvsp--center .tbvsp__eyebrow { text-align: center; }
.tbvsp--right .tbvsp__eyebrow { text-align: right; }

/* ---------- the button ---------- */
.tbvsp button.tbvsp__orb {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: var(--tbvsp-w, 54px);
	height: var(--tbvsp-h, 54px);
	max-width: 100%;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	line-height: 1;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	background-image: none;
	border-style: var(--tbvsp-bs, solid);
	border-width: var(--tbvsp-bw, 1px);
	border-color: var(--tbvsp-bc, #303030);
	border-radius: var(--tbvsp-r, 50%);
	background: var(--tbvsp-bg, #050505);
	color: var(--tbvsp-ic, #ffffff);
	box-shadow: none;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	touch-action: manipulation;
	transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease, transform 0.15s ease;
}
.tbvsp button.tbvsp__orb:focus { outline: none; }
.tbvsp button.tbvsp__orb:focus-visible {
	outline: 2px solid var(--tbvsp-fc, #12bfe3);
	outline-offset: 3px;
}
.tbvsp button.tbvsp__orb:active { transform: scale(0.96); }

/* the glyph (any preset) rests at 70% */
.tbvsp button.tbvsp__orb > * {
	opacity: 0.7;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

/* ---------- bars-based glyphs ---------- */
.tbvsp__bars {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: calc(var(--tbvsp-iw, 24px) / 10);
	width: var(--tbvsp-iw, 24px);
	height: calc(var(--tbvsp-iw, 24px) * 0.6);
	pointer-events: none;
}
.tbvsp__bars i {
	display: block;
	flex: 1 1 0;
	min-width: 1px;
	height: 100%;
	border-radius: 999px;
	background: currentColor;
	transform: scaleY(calc(var(--m, 5) / 7 * 0.45));
	transform-origin: 50% 50%;
}
.tbvsp[data-preset="wave-bars"] .tbvsp__bars,
.tbvsp[data-preset="compact-waveform"] .tbvsp__bars { height: var(--tbvsp-iw, 24px); }
.tbvsp[data-preset="wave-bars"] .tbvsp__bars i,
.tbvsp[data-preset="compact-waveform"] .tbvsp__bars i { transform: scaleY(calc(var(--m, 5) / 7 * 0.75)); }
.tbvsp[data-preset="compact-waveform"] .tbvsp__bars { gap: calc(var(--tbvsp-iw, 24px) / 20); }

/* Minimal Circle / Minimal Line: one flat line at rest */
.tbvsp[data-line="1"] .tbvsp__bars::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: var(--tbvsp-sw, 2px);
	margin-top: calc(var(--tbvsp-sw, 2px) / -2);
	border-radius: 999px;
	background: currentColor;
	transition: opacity 0.2s ease;
}
.tbvsp[data-line="1"] .tbvsp__bars i { opacity: 0; transition: opacity 0.2s ease; }

/* Dots Line */
.tbvsp[data-preset="dots-line"] .tbvsp__bars { justify-content: space-between; gap: 0; }
.tbvsp[data-preset="dots-line"] .tbvsp__bars i {
	flex: 0 0 auto;
	width: calc(var(--tbvsp-sw, 2px) + 1px);
	height: calc(var(--tbvsp-sw, 2px) + 1px);
	transform: none;
}

/* Pulse Circle: one dot */
.tbvsp[data-preset="pulse-circle"] .tbvsp__bars { height: var(--tbvsp-iw, 24px); }
.tbvsp[data-preset="pulse-circle"] .tbvsp__bars i {
	flex: 0 0 auto;
	width: calc(var(--tbvsp-iw, 24px) * 0.45);
	height: calc(var(--tbvsp-iw, 24px) * 0.45);
	transform: none;
}

/* ---------- SVG glyphs (microphone, play) ---------- */
.tbvsp__svg {
	display: block;
	width: var(--tbvsp-iw, 24px);
	height: var(--tbvsp-iw, 24px);
	stroke-width: var(--tbvsp-sw, 2px);
	overflow: visible;
	pointer-events: none;
}
.tbvsp__pause { display: none; }
.tbvsp[data-state="playing"] .tbvsp__play { display: none; }
.tbvsp[data-state="playing"] .tbvsp__pause { display: inline; }

/* ---------- hover (real hover devices) and the forced preview state ---------- */
@media (hover: hover) and (pointer: fine) {
	.tbvsp:not([data-state="disabled"]) button.tbvsp__orb:hover {
		color: var(--tbvsp-ich, #12bfe3);
		border-color: var(--tbvsp-bch, #4a4a4a);
		background: var(--tbvsp-bgh, #141414);
		transform: scale(var(--tbvsp-hs, 1));
	}
	.tbvsp:not([data-state="disabled"]) button.tbvsp__orb:hover > * { opacity: 1; }
}
.tbvsp[data-preview="hover"] button.tbvsp__orb {
	color: var(--tbvsp-ich, #12bfe3);
	border-color: var(--tbvsp-bch, #4a4a4a);
	background: var(--tbvsp-bgh, #141414);
	transform: scale(var(--tbvsp-hs, 1));
}
.tbvsp[data-preview="hover"] button.tbvsp__orb > * { opacity: 1; }

/* ---------- states ---------- */
.tbvsp[data-state="loading"] button.tbvsp__orb > * { opacity: 0.4; }

.tbvsp[data-state="playing"] button.tbvsp__orb,
.tbvsp[data-state="playing"] button.tbvsp__orb:hover {
	color: var(--tbvsp-ica, #12bfe3);
	border-color: var(--tbvsp-bca, #12bfe3);
	background: var(--tbvsp-bga, #141414);
}
.tbvsp[data-state="playing"] button.tbvsp__orb > * { opacity: 1; }

/* paused / stopped: the original resting look (nothing extra to style) */

.tbvsp[data-state="disabled"] button.tbvsp__orb,
.tbvsp button.tbvsp__orb:disabled {
	color: var(--tbvsp-dis, #555555);
	border-color: var(--tbvsp-dis, #555555);
	background: var(--tbvsp-bg, #050505);
	transform: none;
	cursor: not-allowed;
}
.tbvsp[data-state="disabled"] button.tbvsp__orb > *,
.tbvsp button.tbvsp__orb:disabled > * { opacity: 1; }

/* ---------- animation (only while playing) ---------- */
.tbvsp[data-anim="bars"][data-state="playing"] .tbvsp__bars i {
	animation: tbvsp-bars var(--tbvsp-dur, 1.2s) ease-in-out infinite alternate;
	animation-delay: calc(var(--i, 0) * -0.17s);
}
.tbvsp[data-anim="bars"][data-line="1"][data-state="playing"] .tbvsp__bars::before { opacity: 0; }
.tbvsp[data-anim="bars"][data-line="1"][data-state="playing"] .tbvsp__bars i { opacity: 1; }

.tbvsp[data-anim="bounce"][data-state="playing"] .tbvsp__bars i {
	animation: tbvsp-bounce calc(var(--tbvsp-dur, 1.2s) * 0.6) ease-in-out infinite alternate;
	animation-delay: calc(var(--i, 0) * -0.12s);
}
.tbvsp[data-anim="stretch"][data-state="playing"] .tbvsp__bars::before {
	animation: tbvsp-stretch var(--tbvsp-dur, 1.2s) ease-in-out infinite alternate;
}
.tbvsp[data-anim="pulse"][data-state="playing"] button.tbvsp__orb > * {
	animation: tbvsp-pulse var(--tbvsp-dur, 1.2s) ease-in-out infinite alternate;
}
.tbvsp[data-anim="breathe"][data-state="playing"] button.tbvsp__orb > * {
	animation: tbvsp-breathe var(--tbvsp-dur, 1.2s) ease-in-out infinite alternate;
}

@keyframes tbvsp-bars {
	from { transform: scaleY(calc(var(--m, 5) / 7 * 0.3)); }
	to { transform: scaleY(calc(var(--m, 5) / 7 * (0.3 + 0.7 * var(--tbvsp-int, 0.5)))); }
}
@keyframes tbvsp-bounce {
	from { transform: translateY(0); }
	to { transform: translateY(calc(var(--tbvsp-int, 0.5) * -6px)); }
}
@keyframes tbvsp-stretch {
	from { transform: scaleX(calc(1 - 0.6 * var(--tbvsp-int, 0.5))); }
	to { transform: scaleX(1); }
}
@keyframes tbvsp-pulse {
	from { transform: scale(1); }
	to { transform: scale(calc(1 + 0.4 * var(--tbvsp-int, 0.5))); }
}
@keyframes tbvsp-breathe {
	from { opacity: calc(1 - 0.6 * var(--tbvsp-int, 0.5)); }
	to { opacity: 1; }
}

/* ---------- accessibility helpers ---------- */
.tbvsp__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* editor-only notice when a section has no audio yet */
.tbvsp-missing {
	padding: 8px 12px;
	border: 1px dashed rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	background: #141414;
	color: rgba(255, 255, 255, 0.65);
	font-size: 12px;
}
