/* PlayMP3 by SadiTechnology — frontend styles */

.playmp3-grid {
	--playmp3-columns: 3;
	--playmp3-gap: 24px;
	display: grid;
	grid-template-columns: repeat(var(--playmp3-columns), 1fr);
	gap: var(--playmp3-gap);
}

.playmp3-empty {
	opacity: 0.7;
	font-style: italic;
}

/* ---------- shared play button ---------- */
.playmp3-play-btn {
	appearance: none;
	border: none;
	cursor: pointer;
	background-color: #4fa8f5;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, opacity 0.2s ease;
	flex-shrink: 0;
}
.playmp3-play-btn:hover {
	transform: scale(1.06);
}
.playmp3-play-btn svg {
	width: 42%;
	height: 42%;
	fill: #fff;
}
.playmp3-play-btn .icon-pause {
	margin-left: 0;
}
.playmp3-play-btn .icon-play {
	margin-left: 3px;
}

/* ---------- waveform (shared) ---------- */
.playmp3-waveform {
	display: flex;
	align-items: center;
	gap: 3px;
	height: 28px;
	width: 100%;
	overflow: hidden;
}
.playmp3-bar {
	flex: 1 1 0;
	max-width: 4px;
	min-width: 2px;
	height: var(--bar-height, 40%);
	background-color: rgba(0, 0, 0, 0.15);
	border-radius: 2px;
	transform-origin: center;
	animation: playmp3-wave 900ms ease-in-out infinite;
	animation-delay: var(--bar-delay, 0s);
	animation-play-state: paused;
}
.is-playing .playmp3-bar {
	animation-play-state: running;
}
.playmp3-bar.is-active {
	background-color: #f0b429;
}

@keyframes playmp3-wave {
	0%, 100% { transform: scaleY(0.4); }
	50% { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
	.playmp3-bar { animation: none !important; }
}

/* =========================================================
   CARD LAYOUT
   ========================================================= */
.playmp3-card {
	position: relative;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
	background: #fff;
	display: flex;
	flex-direction: column;
}

.playmp3-card__media {
	position: relative;
	height: 220px;
	background-size: cover;
	background-position: center;
	background-color: #2a2a2a;
	display: flex;
	align-items: center;
	justify-content: center;
}

.playmp3-card__overlay {
	position: absolute;
	inset: 0;
	background: rgba(20, 10, 30, 0.35);
	pointer-events: none;
}

.playmp3-card__tags {
	position: absolute;
	top: 14px;
	left: 14px;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	z-index: 2;
}

.playmp3-tag {
	background: rgba(255, 255, 255, 0.9);
	color: #1a1a1a;
	font-size: 12px;
	font-weight: 600;
	padding: 5px 12px;
	border-radius: 999px;
	white-space: nowrap;
}
.playmp3-tag-1 {
	background: rgba(70, 60, 160, 0.85);
	color: #fff;
}

.playmp3-card .playmp3-play-btn {
	position: relative;
	z-index: 3;
	width: 56px;
	height: 56px;
	opacity: 0;
	transform: scale(0.85);
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: auto;
}

/* Reveal on hover. Both the native :hover (no-JS fallback) and the
   JS-applied .is-hovered class (reliable even if a theme interferes
   with :hover bubbling) are supported. !important guards against
   theme stylesheets that set a competing opacity on buttons/svgs. */
.playmp3-card__media:hover .playmp3-play-btn,
.playmp3-card.is-hovered .playmp3-play-btn,
.playmp3-card.is-playing .playmp3-play-btn,
.playmp3-card.playmp3-btn-always .playmp3-play-btn {
	opacity: 1 !important;
	transform: scale(1) !important;
}

.playmp3-play-btn i {
	font-size: 20px;
	line-height: 1;
}

.playmp3-card__duration {
	position: absolute;
	bottom: 12px;
	right: 12px;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 4px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 4px 9px;
	border-radius: 999px;
}

.playmp3-card__time {
	position: absolute;
	bottom: 12px;
	left: 12px;
	z-index: 2;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 4px 9px;
	border-radius: 999px;
}
.playmp3-card__time[hidden] {
	display: none;
}

.playmp3-card__body {
	padding: 20px 22px 24px;
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.playmp3-card__title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	color: #7a2222;
}

.playmp3-card__desc {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: #666;
}

.playmp3-card .playmp3-waveform {
	margin-top: 6px;
}

/* =========================================================
   COMPACT LAYOUT
   ========================================================= */
.playmp3-compact {
	display: flex;
	align-items: center;
	gap: 14px;
	background: #1c1c24;
	border-radius: 14px;
	padding: 12px 16px;
	color: #fff;
}

.playmp3-compact .playmp3-play-btn {
	width: 44px;
	height: 44px;
}

.playmp3-compact__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.playmp3-compact__label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: #5aa9ff;
}

.playmp3-compact__title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.playmp3-compact__time {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.65);
	flex-shrink: 0;
	white-space: nowrap;
}

/* =========================================================
   RESPONSIVE FALLBACKS (in case Elementor responsive control
   selectors are overridden by a theme)
   ========================================================= */
@media (max-width: 1024px) {
	.playmp3-grid:not([style*="--playmp3-columns"]) {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 600px) {
	.playmp3-grid:not([style*="--playmp3-columns"]) {
		grid-template-columns: repeat(1, 1fr);
	}
}
