/*
 * Copyright (C) 2026 Fluxer Contributors
 *
 * This file is part of Fluxer.
 *
 * Fluxer is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Fluxer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
 */

.container {
	position: relative;
	width: 100%;
	height: 20px;
	display: flex;
	cursor: pointer;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}

.track {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 4px;
	background-color: rgba(255, 255, 255, 0.2);
	border-radius: var(--radius-full);
	overflow: hidden;
}

.buffered {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	background-color: rgba(255, 255, 255, 0.3);
	border-radius: var(--radius-full);
	transition: width 150ms ease;
}

.fill {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	background-color: var(--brand-primary-light, #5865f2);
	border-radius: var(--radius-full);
}

.thumb {
	position: absolute;
	top: -4px;
	width: 12px;
	height: 12px;
	background-color: #fff;
	border-radius: 50%;
	transform: translateX(-50%);
	opacity: 0;
	transition:
		opacity 150ms ease,
		transform 150ms ease;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
	pointer-events: none;
}

.container:hover .thumb,
.container:focus-within .thumb,
.isDragging .thumb {
	opacity: 1;
}

.container:hover .thumb:hover,
.isDragging .thumb {
	transform: translateX(-50%);
}

.tooltip {
	position: fixed;
	padding: 4px 8px;
	background-color: var(--background-primary);
	color: var(--text-primary, #fff);
	border-radius: var(--radius-sm, 4px);
	font-size: 12px;
	font-family: var(--font-mono);
	white-space: nowrap;
	z-index: var(--z-index-tooltip);
	pointer-events: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tooltipArrow {
	position: absolute;
	bottom: -4px;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 5px solid var(--background-primary);
}

.compact {
	height: 8px;
}

.compact .track {
	height: 3px;
	top: 0;
	transform: none;
}

.compact .thumb {
	width: 10px;
	height: 10px;
	top: -4px;
	transform: translateX(-50%);
}
