/**
 * Flavors Audio Player - base structural styles.
 *
 * Layout for the two skins (minimal / card), the play/pause icon swap, the
 * progress bar mechanics, the animated EQ, and the playlist. Every themeable
 * value (player background, colors, typography, sizes, radius) is injected by
 * Elementor through the widget's control `selectors`, so this file carries NO
 * per-instance styling - only sensible structural defaults.
 */

.flavor-audio {
	box-sizing: border-box;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	color: #fff;
	background: #1d2327;
	padding: 18px;
	border-radius: 16px;
}

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

/* The real <audio> element is fully custom-skinned, so hide the native UI. */
.flavor-audio-el {
	display: none;
}

/* The main row (cover + title/progress) is a flex row in both skins; the
   card skin turns it into a column below. Without it the minimal skin
   stacked the cover on top of the text. */
.flavor-audio-main {
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 1 1 280px;
	min-width: 0;
}

.flavor-audio [hidden] {
	display: none !important;
}

/* ------------------------------------------------------------------ cover */

.flavor-audio-cover {
	flex: 0 0 auto;
	width: 72px;
	height: 72px;
	overflow: hidden;
	border-radius: 12px;
	background: rgba( 255, 255, 255, 0.08 );
	display: flex;
	align-items: center;
	justify-content: center;
}

.flavor-audio-cover-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.flavor-audio-cover-ph svg {
	width: 40%;
	height: 40%;
	fill: rgba( 255, 255, 255, 0.4 );
}

/* ------------------------------------------------------------------- body */

.flavor-audio-body {
	flex: 1 1 200px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.flavor-audio-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.flavor-audio-textwrap {
	min-width: 0;
}

.flavor-audio-title {
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.flavor-audio-artist {
	font-size: 0.85em;
	line-height: 1.3;
	color: rgba( 255, 255, 255, 0.6 );
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* -------------------------------------------------------------- progress */

.flavor-audio-progress-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.flavor-audio-progress {
	position: relative;
	flex: 1 1 auto;
	height: 6px;
	border-radius: 6px;
	background: rgba( 255, 255, 255, 0.2 );
	cursor: pointer;
	touch-action: none;
}

.flavor-audio-progress:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.flavor-audio-progress-fill {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	width: 0;
	border-radius: inherit;
	background: #fff;
}

.flavor-audio-progress-handle {
	position: absolute;
	top: 50%;
	left: 0;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #fff;
	transform: translate( -50%, -50% );
	left: 0;
	opacity: 0;
	transition: opacity 0.15s ease;
	pointer-events: none;
}

.flavor-audio-progress:hover .flavor-audio-progress-handle,
.flavor-audio-progress:focus-visible .flavor-audio-progress-handle {
	opacity: 1;
	left: var( --flavor-audio-handle-left, 0 );
}

.flavor-audio-time {
	flex: 0 0 auto;
	font-size: 0.8em;
	font-variant-numeric: tabular-nums;
	color: rgba( 255, 255, 255, 0.7 );
	white-space: nowrap;
}

.flavor-audio-sep {
	margin: 0 3px;
	opacity: 0.6;
}

/* --------------------------------------------------------------- controls */

.flavor-audio-controls {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
}

.flavor-audio-play {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	cursor: pointer;
	border: 0;
	border-radius: 50%;
	background: #fff;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.flavor-audio-play:hover,
.flavor-audio-play:focus {
	transform: scale( 1.05 );
}

.flavor-audio-play:focus-visible,
.flavor-audio-nav:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.flavor-audio-play svg {
	width: 55%;
	height: 55%;
	fill: #1d2327;
	display: block;
}

/* Play/pause icon swap driven by the .flavor-audio-is-playing class. */
.flavor-audio-icon-pause {
	display: none;
}

.flavor-audio-is-playing .flavor-audio-icon-play {
	display: none;
}

.flavor-audio-is-playing .flavor-audio-icon-pause {
	display: inline-flex;
}

.flavor-audio-icon-play,
.flavor-audio-icon-pause {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.flavor-audio-nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	cursor: pointer;
	border: 0;
	border-radius: 50%;
	background: transparent;
	transition: background-color 0.2s ease;
}

.flavor-audio-nav:hover {
	background: rgba( 255, 255, 255, 0.1 );
}

.flavor-audio-nav svg {
	width: 22px;
	height: 22px;
	fill: rgba( 255, 255, 255, 0.7 );
	display: block;
}

/* ----------------------------------------------------------------- volume */

.flavor-audio-volume {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.flavor-audio-volume-icon svg {
	width: 20px;
	height: 20px;
	fill: rgba( 255, 255, 255, 0.7 );
	display: block;
}

.flavor-audio-volume-slider {
	width: 72px;
	max-width: 90px;
	height: 4px;
	cursor: pointer;
	accent-color: #fff;
}

/* --------------------------------------------------------------------- EQ */

.flavor-audio-eq {
	display: inline-flex;
	align-items: flex-end;
	gap: 3px;
	height: 22px;
	flex: 0 0 auto;
}

.flavor-audio-eq span {
	display: block;
	width: 3px;
	height: 30%;
	border-radius: 2px;
	background: #fff;
	transform-origin: bottom;
}

/* Animate the bars only when the player is actively playing. */
.flavor-audio-eq-on .flavor-audio-eq span {
	animation: flavor-audio-eq 0.9s ease-in-out infinite;
}

.flavor-audio-eq-on .flavor-audio-eq span:nth-child( 1 ) {
	animation-delay: -0.2s;
	animation-duration: 0.8s;
}

.flavor-audio-eq-on .flavor-audio-eq span:nth-child( 2 ) {
	animation-delay: -0.5s;
	animation-duration: 1.1s;
}

.flavor-audio-eq-on .flavor-audio-eq span:nth-child( 3 ) {
	animation-delay: -0.1s;
	animation-duration: 0.7s;
}

.flavor-audio-eq-on .flavor-audio-eq span:nth-child( 4 ) {
	animation-delay: -0.7s;
	animation-duration: 1s;
}

.flavor-audio-eq-on .flavor-audio-eq span:nth-child( 5 ) {
	animation-delay: -0.3s;
	animation-duration: 0.85s;
}

@keyframes flavor-audio-eq {
	0%,
	100% {
		height: 25%;
	}
	50% {
		height: 100%;
	}
}

/* --------------------------------------------------------------- playlist */

.flavor-audio-playlist {
	list-style: none;
	margin: 4px 0 0;
	padding: 0;
	width: 100%;
	flex: 1 1 100%;
	max-height: 240px;
	overflow-y: auto;
}

.flavor-audio-pl-row {
	margin: 0;
	padding: 0;
}

.flavor-audio-pl-item {
	position: relative;
	display: flex;
	align-items: baseline;
	gap: 8px;
	width: 100%;
	margin: 0;
	font: inherit;
	text-align: left;
	background: transparent;
	border: 0;
	padding: 8px 12px 8px 24px;
	cursor: pointer;
	border-radius: 8px;
	color: rgba( 255, 255, 255, 0.7 );
	transition: background-color 0.18s ease, color 0.18s ease;
}

.flavor-audio-pl-item::before {
	content: "";
	position: absolute;
	left: 10px;
	top: 50%;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.3 );
	transform: translateY( -50% );
}

.flavor-audio-pl-item:hover {
	background: rgba( 255, 255, 255, 0.08 );
}

.flavor-audio-pl-item[aria-current="true"] {
	color: #fff;
}

.flavor-audio-pl-item[aria-current="true"]::before {
	background: #fff;
}

.flavor-audio-pl-item:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -2px;
}

.flavor-audio-pl-title {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.flavor-audio-pl-artist {
	font-size: 0.82em;
	opacity: 0.7;
	white-space: nowrap;
}

/* ------------------------------------------------------------ skin: card */

.flavor-audio-skin-card .flavor-audio {
	flex-direction: column;
	align-items: stretch;
	text-align: center;
}

.flavor-audio-skin-card .flavor-audio-main {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	width: 100%;
}

.flavor-audio-skin-card .flavor-audio-cover {
	width: 160px;
	height: 160px;
}

.flavor-audio-skin-card .flavor-audio-body {
	width: 100%;
	align-items: stretch;
}

.flavor-audio-skin-card .flavor-audio-meta {
	justify-content: center;
	flex-direction: column;
}

.flavor-audio-skin-card .flavor-audio-controls {
	justify-content: center;
	width: 100%;
}

/* ---------------------------------------------------------- skin: minimal */

/* The minimal skin keeps everything on one row but lets the playlist wrap. */
.flavor-audio-skin-minimal .flavor-audio {
	flex-wrap: wrap;
}

.flavor-audio-skin-minimal .flavor-audio-cover {
	width: 48px;
	height: 48px;
}

.flavor-audio-skin-minimal .flavor-audio-playlist {
	order: 5;
}

/* ----------------------------------------------------------- editor notice */

.flavor-audio-empty {
	padding: 24px;
	text-align: center;
	color: #646970;
	background: #f6f7f7;
	border: 1px dashed #c3c4c7;
	border-radius: 8px;
}

/* ------------------------------------------------------- reduced motion */

@media ( prefers-reduced-motion: reduce ) {
	.flavor-audio-eq span,
	.flavor-audio-play,
	.flavor-audio-nav,
	.flavor-audio-progress-handle {
		animation: none !important;
		transition: none !important;
	}
}

/* ----------------------------------------------------------------- mobile */

@media ( max-width: 575px ) {
	.flavor-audio-volume-slider {
		width: 52px;
	}

	.flavor-audio-skin-minimal .flavor-audio-volume {
		display: none;
	}
}
