/**
 * Ontrack baseline player styles.
 *
 * Applied only when the active theme does not supply its own player CSS.
 * Provides a functional layout without strong visual opinions.
 */

.ontrack-audio-player-wrap,
.ontrack-video-player-wrap {
	margin: 1.5em 0;
	font-family: inherit;
}

/* Loading state */
.ontrack-audio-player-loading,
.ontrack-video-player-loading {
	display: flex;
	align-items: center;
	gap: 0.5em;
	padding: 1em;
	color: #555;
}

.ontrack-audio-loading-dot {
	display: inline-block;
	width: 0.6em;
	height: 0.6em;
	border-radius: 50%;
	background: currentColor;
	animation: ontrack-pulse 1.2s ease-in-out infinite;
}

@keyframes ontrack-pulse {
	0%, 100% { opacity: 0.3; }
	50%       { opacity: 1; }
}

/* Audio controls */
.ontrack-audio-header {
	display: flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.75em 1em;
	background: #1e293b;
	color: #fff;
	border-radius: 4px 4px 0 0;
}

.ontrack-audio-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1em;
	padding: 0.75em 1em;
	background: #f8fafc;
}

.ontrack-audio-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.25em;
	line-height: 0;
	color: #1e293b;
}

.ontrack-audio-play {
	width: 3em;
	height: 3em;
	border-radius: 50%;
	background: #1e293b;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ontrack-audio-progress-wrap {
	display: flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.5em 1em;
	background: #f8fafc;
	font-size: 0.85em;
}

.ontrack-audio-seek-wrap {
	flex: 1;
}

.ontrack-audio-seek {
	width: 100%;
	cursor: pointer;
}

/* Playlist */
.ontrack-audio-playlist,
.ontrack-video-playlist {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid #e2e8f0;
	max-height: 300px;
	overflow-y: auto;
}

.ontrack-audio-playlist-item,
.ontrack-video-playlist-item {
	border-bottom: 1px solid #e2e8f0;
}

.ontrack-audio-playlist-link,
.ontrack-video-playlist-link {
	display: flex;
	align-items: center;
	gap: 0.75em;
	width: 100%;
	text-align: left;
	background: none;
	border: none;
	padding: 0.6em 1em;
	cursor: pointer;
	font-size: 0.9em;
	color: inherit;
}

.ontrack-audio-playlist-item.is-active .ontrack-audio-playlist-link,
.ontrack-video-playlist-item.is-active .ontrack-video-playlist-link {
	font-weight: 600;
	background: #f1f5f9;
}

/* Video embed */
.ontrack-video-embed-wrap {
	position: relative;
	padding-bottom: 56.25%; /* 16:9 */
	height: 0;
	overflow: hidden;
}

.ontrack-video-iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.ontrack-video-playlist-thumb {
	width: 60px;
	height: 34px;
	object-fit: cover;
	border-radius: 2px;
	flex-shrink: 0;
}

.ontrack-video-now-playing {
	margin: 0.5em 0;
	font-weight: 600;
	font-size: 0.95em;
}

/* Error */
.ontrack-audio-player-error,
.ontrack-video-player-error {
	padding: 0.75em 1em;
	color: #c62828;
	background: #fff3f3;
	border: 1px solid #f5c6c6;
	border-radius: 4px;
}
