/* Raadio MP3 mängija. Värve saab teemas muuta, nt:
   .rmp-player { --rmp-accent: #e63946; } */
.rmp-player {
	--rmp-accent: #d62828;
	--rmp-bg: #0f2347;
	--rmp-bg2: #0a1730;
	--rmp-fg: #ffffff;
	--rmp-muted: #9fb3d6;
	--rmp-track: rgba(160, 190, 240, 0.22);
	--rmp-buffer: rgba(160, 190, 240, 0.4);
	--rmp-radius: 14px;

	box-sizing: border-box;
	width: 100%;
	max-width: 720px;
	margin: 1.5em 0;
	padding: 18px 22px 16px;
	background: var(--rmp-bg);
	background: linear-gradient(135deg, var(--rmp-bg) 0%, var(--rmp-bg2) 100%);
	color: var(--rmp-fg);
	border-radius: var(--rmp-radius);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	line-height: 1.3;
	user-select: none;
	-webkit-user-select: none;
}
.rmp-player *, .rmp-player *::before, .rmp-player *::after { box-sizing: border-box; }
.rmp-player audio { display: none !important; }

.rmp-title {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 12px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Edenemisriba */
.rmp-progress-row { display: flex; align-items: center; gap: 12px; }
.rmp-time {
	flex: 0 0 auto;
	min-width: 3.4em;
	font-size: 12px;
	color: var(--rmp-muted);
	font-variant-numeric: tabular-nums;
}
.rmp-duration { text-align: right; }
.rmp-progress {
	position: relative;
	flex: 1 1 auto;
	height: 22px;
	cursor: pointer;
	touch-action: none;
	outline: none;
}
.rmp-progress::before,
.rmp-buffered,
.rmp-played {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	height: 6px;
	margin-top: -3px;
	border-radius: 3px;
}
.rmp-progress::before { right: 0; background: var(--rmp-track); }
.rmp-buffered { width: 0; background: var(--rmp-buffer); }
.rmp-played { width: 0; background: var(--rmp-accent); }
.rmp-handle {
	position: absolute;
	top: 50%;
	left: 0;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border-radius: 50%;
	background: var(--rmp-fg);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
	transform: scale(0.75);
	transition: transform 0.15s;
}
.rmp-progress:hover .rmp-handle,
.rmp-progress:focus-visible .rmp-handle,
.rmp-player.rmp-dragging .rmp-handle { transform: scale(1); }
.rmp-progress:focus-visible::before { box-shadow: 0 0 0 2px var(--rmp-accent); }
.rmp-tooltip {
	position: absolute;
	bottom: 100%;
	left: 0;
	transform: translateX(-50%);
	padding: 3px 6px;
	font-size: 11px;
	background: #050d1d;
	color: #fff;
	border-radius: 4px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.1s;
	white-space: nowrap;
}
.rmp-progress:hover .rmp-tooltip,
.rmp-player.rmp-dragging .rmp-tooltip { opacity: 1; }

/* Nupud */
.rmp-controls {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	margin-top: 10px;
}
.rmp-center { display: flex; align-items: center; gap: 14px; }
.rmp-right { display: flex; justify-content: flex-end; }
.rmp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--rmp-fg);
	cursor: pointer;
	text-decoration: none !important;
	box-shadow: none !important;
	transition: background 0.15s, transform 0.1s;
}
.rmp-btn:hover { background: rgba(160, 190, 240, 0.15); color: var(--rmp-fg); }
.rmp-btn:active { transform: scale(0.94); }
.rmp-btn:focus-visible { outline: 2px solid var(--rmp-accent); outline-offset: 2px; }
.rmp-btn svg { width: 24px; height: 24px; fill: currentColor; display: block; }
.rmp-btn text { font-size: 6.5px; font-weight: 700; font-family: inherit; fill: currentColor; }
.rmp-back svg, .rmp-fwd svg { width: 28px; height: 28px; }

.rmp-play {
	position: relative;
	width: 58px;
	height: 58px;
	background: var(--rmp-accent);
	color: #fff;
}
.rmp-play:hover { background: var(--rmp-accent); filter: brightness(1.1); }
.rmp-play svg { width: 30px; height: 30px; }
.rmp-ico-pause, .rmp-ico-muted { display: none !important; }
.rmp-player.rmp-playing .rmp-ico-play { display: none !important; }
.rmp-player.rmp-playing .rmp-ico-pause { display: block !important; }
.rmp-player.rmp-muted .rmp-ico-vol { display: none !important; }
.rmp-player.rmp-muted .rmp-ico-muted { display: block !important; }

.rmp-spinner {
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 3px solid transparent;
	border-top-color: var(--rmp-fg);
	opacity: 0;
	pointer-events: none;
}
.rmp-player.rmp-loading .rmp-spinner { opacity: 1; animation: rmp-spin 0.8s linear infinite; }
@keyframes rmp-spin { to { transform: rotate(360deg); } }

/* Helitugevus */
.rmp-volume { display: flex; align-items: center; gap: 6px; }
.rmp-volume-slider {
	-webkit-appearance: none;
	appearance: none;
	width: 90px;
	height: 4px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: linear-gradient(to right, var(--rmp-fg) var(--rmp-vol, 100%), var(--rmp-track) var(--rmp-vol, 100%));
	cursor: pointer;
	outline: none;
}
.rmp-volume-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--rmp-fg);
	border: 0;
}
.rmp-volume-slider::-moz-range-thumb {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--rmp-fg);
	border: 0;
}
.rmp-volume-slider:focus-visible { box-shadow: 0 0 0 2px var(--rmp-accent); }

.rmp-player.rmp-error .rmp-title::after {
	content: " — faili ei õnnestunud laadida";
	color: var(--rmp-accent);
	font-weight: 400;
}

@media (max-width: 480px) {
	.rmp-player { padding: 14px 14px 12px; }
	.rmp-volume-slider { width: 60px; }
	.rmp-center { gap: 6px; }
	.rmp-play { width: 52px; height: 52px; }
}
@media (max-width: 420px) {
	.rmp-volume-slider { display: none; }
}
@media (hover: none) {
	.rmp-volume-slider { display: none; }
}
