/* ==========================================================================
   Compact Audio Player v2 - modern skin
   Themeable via CSS custom properties. Defaults below; Settings/shortcode
   overrides set these same variables at higher specificity.
   ========================================================================== */

.wpap-player {
	--wpap-accent: #1DB954;
	--wpap-bg: #ffffff;
	--wpap-fg: #191414;
	--wpap-muted: #6a6a6a;
	--wpap-track: #e3e3e3;
	--wpap-radius: 12px;
	--wpap-pad: 16px 20px;
	--wpap-cover: 56px;
	--wpap-font: 14px;

	position: relative;
	box-sizing: border-box;
	max-width: 720px;
	background: var( --wpap-bg );
	color: var( --wpap-fg );
	border-radius: var( --wpap-radius );
	padding: var( --wpap-pad );
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: var( --wpap-font );
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.08 ), 0 1px 2px rgba( 0, 0, 0, 0.06 );
	line-height: 1.4;
}

.wpap-player[data-wpap-theme="dark"] {
	--wpap-bg: #181818;
	--wpap-fg: #ffffff;
	--wpap-muted: #b3b3b3;
	--wpap-track: #4d4d4d;
}

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

.wpap-player audio {
	display: none;
}

.wpap-main {
	display: flex;
	align-items: center;
	gap: 16px;
}

/* Cover art */
.wpap-cover {
	flex: 0 0 auto;
	width: var( --wpap-cover );
	height: var( --wpap-cover );
	border-radius: calc( var( --wpap-radius ) * 0.6 );
	background-size: cover;
	background-position: center;
	background-color: var( --wpap-track );
	display: flex;
	align-items: center;
	justify-content: center;
}

.wpap-cover-placeholder svg {
	width: 40%;
	height: 40%;
	fill: var( --wpap-muted );
}

/* Track info */
.wpap-info {
	flex: 0 0 auto;
	min-width: 90px;
	max-width: 180px;
	overflow: hidden;
}

.wpap-title {
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wpap-meta {
	color: var( --wpap-muted );
	font-size: 0.85em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Controls */
.wpap-controls {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.wpap-transport {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.wpap-btn {
	appearance: none;
	background: transparent;
	border: none;
	cursor: pointer;
	color: var( --wpap-fg );
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.15s ease, transform 0.1s ease, color 0.15s ease;
}

.wpap-btn:hover {
	background: rgba( 128, 128, 128, 0.15 );
}

.wpap-btn:active {
	transform: scale( 0.92 );
}

.wpap-btn svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.wpap-btn.wpap-active {
	color: var( --wpap-accent );
}

.wpap-btn-play-main {
	width: 40px;
	height: 40px;
	background: var( --wpap-fg );
	color: var( --wpap-bg );
}

.wpap-btn-play-main:hover {
	background: var( --wpap-fg );
	opacity: 0.85;
	transform: scale( 1.05 );
}

.wpap-btn-play-main svg {
	width: 18px;
	height: 18px;
}

/* Progress row */
.wpap-progress-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.wpap-time {
	font-size: 0.75em;
	color: var( --wpap-muted );
	min-width: 34px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

input[type="range"] {
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	flex: 1 1 auto;
	height: 16px;
	margin: 0;
	cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
	height: 4px;
	border-radius: 2px;
	background: var( --wpap-track );
}

input[type="range"]::-moz-range-track {
	height: 4px;
	border-radius: 2px;
	background: var( --wpap-track );
}

input[type="range"]::-webkit-slider-thumb {
	appearance: none;
	-webkit-appearance: none;
	width: 12px;
	height: 12px;
	margin-top: -4px;
	border-radius: 50%;
	background: var( --wpap-accent );
	box-shadow: 0 0 0 0 transparent;
	transition: box-shadow 0.15s ease;
}

input[type="range"]::-moz-range-thumb {
	width: 12px;
	height: 12px;
	border: none;
	border-radius: 50%;
	background: var( --wpap-accent );
}

input[type="range"]:hover::-webkit-slider-thumb {
	box-shadow: 0 0 0 6px rgba( 29, 185, 84, 0.15 );
}

.wpap-progress {
	--track-fill: 0%;
}

/* Secondary row */
.wpap-secondary {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.wpap-speed {
	width: auto;
	padding: 0 8px;
	border-radius: 12px;
	font-size: 0.75em;
	font-weight: 600;
	color: var( --wpap-muted );
}

.wpap-speed:hover {
	color: var( --wpap-fg );
}

.wpap-volume {
	display: flex;
	align-items: center;
	gap: 4px;
	width: 110px;
}

.wpap-volume-range {
	width: 70px;
}

/* Playlist panel */
.wpap-playlist {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.25s ease;
}

.wpap-playlist-open .wpap-playlist {
	max-height: 320px;
	overflow-y: auto;
	margin-top: 14px;
	border-top: 1px solid var( --wpap-track );
	padding-top: 8px;
}

.wpap-playlist-item {
	display: flex;
	flex-direction: column;
	padding: 8px 10px;
	border-radius: 8px;
	cursor: pointer;
}

.wpap-playlist-item:hover {
	background: rgba( 128, 128, 128, 0.1 );
}

.wpap-playlist-item.wpap-active {
	background: rgba( 29, 185, 84, 0.12 );
	color: var( --wpap-accent );
}

.wpap-playlist-item-title {
	font-weight: 500;
	font-size: 0.9em;
}

.wpap-playlist-item-artist {
	font-size: 0.78em;
	color: var( --wpap-muted );
}

/* Playing pulse on cover */
.wpap-is-playing .wpap-cover::after {
	content: "";
}

/* Responsive */
@media ( max-width: 480px ) {
	.wpap-main {
		flex-wrap: wrap;
	}

	.wpap-info {
		max-width: none;
		flex: 1 1 auto;
	}

	.wpap-controls {
		flex: 1 1 100%;
		order: 3;
	}

	.wpap-volume {
		display: none;
	}
}

/* noscript fallback */
.wpap-noscript-track audio {
	display: block;
	width: 100%;
	margin-top: 4px;
}
