/* ==========================================================================
   Audio Player Styles
   ========================================================================== */

/**
 * Container styles
 */
.product__audio {
	margin-top: var(--text-spc-500);
	border: 0.1rem solid #eee;
	padding: 1rem;
}

/**
 * Title styles
 */
.product__audio__title {
	text-transform: uppercase;
	font-size: var(--font-size-400);
	font-weight: 600;
	text-align: center;
}

/**
 * Time display styles
 */
.audio-current-time,
.audio-duration {
	font-size: var(--font-size-400);
	color: #666;
	font-weight: 500;
}

/**
 * Native audio element (hidden but accessible)
 */
audio {
	width: 100%;
}

/**
 * Custom audio player container
 */
.custom-audio {
	display: flex;
	align-items: center;
	gap: 1rem;
	width: 100%;
	padding: 0.8rem 0;
}

/**
 * Play/Pause button base styles
 */
.audio-play-pause {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: none;
	border-radius: 0.5rem;
	background: var(--buttons-bg);
	color: white;
	cursor: pointer;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

/**
 * Play/Pause button hover state
 */
.audio-play-pause:hover {
	transform: scale(1.1);
}

/**
 * Play/Pause button active state
 */
.audio-play-pause:active {
	transform: scale(0.95);
}

/**
 * Progress bar container
 */
.progress-container {
	position: relative;
	flex-grow: 1;
	height: 0.5rem;
	border-radius: 0.2rem;
	background-color: #e0e0e0;
	cursor: pointer;
}

/**
 * Progress bar fill
 */
.progress-bar {
	position: relative;
	width: 0%;
	height: 100%;
	border-radius: 0.2rem;
	background-color: #000;
	transition: width 0.1s linear;
}

/**
 * Time display
 * Uses tabular numbers for consistent width when changing
 */
.time {
	min-width: 4ch;
	color: #666;
	font-size: 1.2rem;
	text-align: right;
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum";
}

/**
 * Play/Pause button icon states
 */
.audio-play-pause {
	width: 2.4rem;
	height: 2.4rem;
	background: var(--buttons-bg)
		url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS1taXRlcmxpbWl0PSIyIj48cGF0aCBkPSJNMTIgN0wwIDE0VjBsMTIgN3oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)
		no-repeat center center;
	background-size: 1.2rem 1.4rem;
}

/**
 * Paused state icon
 */
.audio-play-pause[data-paused] {
	background: var(--buttons-bg)
		url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSIxNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLW1pdGVybGltaXQ9IjIiPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0wIDBoM3YxNEgwek01IDBoM3YxNEg1eiIvPjwvc3ZnPg==)
		no-repeat center center;
	background-size: 0.9rem 1.4rem;
}

/**
 * Loading state styles
 */
.audio-loading .audio-play-pause {
	position: relative;
	opacity: 0.6;
	cursor: not-allowed;
}

/**
 * Loading spinner animation
 */
.audio-loading .audio-play-pause::after {
	content: "";
	position: absolute;
	width: 1rem;
	height: 1rem;
	border: 2px solid transparent;
	border-top: 2px solid white;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

/**
 * Error message styles
 */
.audio-error {
	display: none;
	margin-top: 0.5rem;
	padding: 0.5rem;
	border: 1px solid #fcc;
	border-radius: 0.25rem;
	background: #fee;
	color: #c33;
	font-size: var(--font-size-400);
}

/**
 * Accessibility improvements
 */
.audio-play-pause:focus,
.progress-container:focus {
	outline: 2px solid #007acc;
	outline-offset: 2px;
}

/**
 * Progress container interaction states
 */
.progress-container:hover {
	opacity: 0.8;
}
