.atp-button-wrapper {
	display: inline-block;
}

.atp-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 16px;
	width: 56px;
	height: 56px;
	aspect-ratio: 1 / 1;
	flex-shrink: 0;
	box-sizing: border-box;
	overflow: hidden;
	border: none;
	cursor: pointer;
	background-color: #1e1e1e;
	color: #fff;
	border-radius: 50%;
	font-size: 15px;
	line-height: 1;
	transition: background-color 0.25s ease, transform 0.15s ease, border-color 0.25s ease;
	-webkit-tap-highlight-color: transparent;
}

.atp-button:hover {
	transform: translateY(-1px);
}

.atp-button:active {
	transform: translateY(0);
}

/* Toggle icon visibility based on play/pause state */
.atp-button .atp-icon-pause {
	display: none;
}

.atp-button.is-playing .atp-icon-play {
	display: none;
}

.atp-button.is-playing .atp-icon-pause {
	display: inline-flex;
}

.atp-icon-group {
	display: inline-flex;
	align-items: center;
}

.atp-icon svg,
.atp-icon i {
	width: 16px;
	height: 16px;
	font-size: 16px;
	display: block;
	color: inherit;
}

/* -------------------------------------------------- */
/* Tata letak icon vs elemen animasi (mis. bar equalizer) */
/* -------------------------------------------------- */
.atp-visual {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* "Tumpuk" — bar jadi latar di belakang, icon di atas tepat di tengah */
.atp-visual-overlay {
	min-width: 34px;
	min-height: 24px;
}

.atp-visual-overlay .atp-equalizer {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}

.atp-visual-overlay .atp-icon-group {
	position: relative;
	z-index: 2;
}

/* "Berdampingan" — icon & bar sejajar dengan jarak yang bisa diatur */
.atp-visual-side {
	gap: var(--atp-icon-gap, 10px);
}

.atp-visual-side .atp-equalizer {
	position: static;
	transform: none;
}

/* -------------------------------------------------- */
/* Animation: Pulse                                    */
/* -------------------------------------------------- */
.atp-button.atp-anim-pulse.is-playing {
	animation: atp-pulse 1.4s ease-out infinite;
}

@keyframes atp-pulse {
	0% {
		box-shadow: 0 0 0 0 var(--atp-pulse-color-start, rgba(230, 57, 70, 0.55));
	}
	70% {
		box-shadow: 0 0 0 14px var(--atp-pulse-color-end, rgba(230, 57, 70, 0));
	}
	100% {
		box-shadow: 0 0 0 0 var(--atp-pulse-color-end, rgba(230, 57, 70, 0));
	}
}

/* -------------------------------------------------- */
/* Animation: Equalizer bars                           */
/* -------------------------------------------------- */
.atp-equalizer {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 3px;
	height: 22px;
	pointer-events: none;
}

.atp-button.atp-anim-equalizer .atp-equalizer {
	display: inline-flex;
}

.atp-equalizer span {
	width: 3px;
	height: 6px;
	background-color: #fff;
	border-radius: 3px;
	transform-origin: center;
	transform: scaleY(0.4);
}

.atp-button.atp-anim-equalizer.is-playing .atp-equalizer span {
	animation: atp-eq 1.1s ease-in-out infinite;
}

.atp-button.atp-anim-equalizer.is-playing .atp-equalizer span:nth-child(1) { animation-delay: 0s; }
.atp-button.atp-anim-equalizer.is-playing .atp-equalizer span:nth-child(2) { animation-delay: 0.15s; }
.atp-button.atp-anim-equalizer.is-playing .atp-equalizer span:nth-child(3) { animation-delay: 0.3s; }
.atp-button.atp-anim-equalizer.is-playing .atp-equalizer span:nth-child(4) { animation-delay: 0.15s; }
.atp-button.atp-anim-equalizer.is-playing .atp-equalizer span:nth-child(5) { animation-delay: 0.05s; }

@keyframes atp-eq {
	0%, 100% { transform: scaleY(0.4); }
	50% { transform: scaleY(2.6); }
}

/* -------------------------------------------------- */
/* Animation: Spinning icon                             */
/* -------------------------------------------------- */
.atp-button.atp-anim-spin-icon.is-playing .atp-icon {
	animation: atp-spin 2.2s linear infinite;
}

@keyframes atp-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
	.atp-button {
		width: 48px;
		height: 48px;
		padding: 12px;
		font-size: 14px;
	}
}
