/* Heacon Video Analytics – Eigener Videoplayer (Glasmorphism) */

.hva-player-wrap {
	--hva-accent: #2a78d6;
	--hva-accent-text: #ffffff;

	/* Grundton der Steuerleiste (wird per Theme-Klasse überschrieben). */
	--hva-bar-bg: rgba(18, 20, 24, 0.55);
	--hva-bar-fg: #ffffff;
	--hva-bar-fg-dim: rgba(255, 255, 255, 0.7);
	--hva-track-bg: rgba(255, 255, 255, 0.28);
	--hva-buffer-bg: rgba(255, 255, 255, 0.45);
	--hva-blur: 14px;

	position: relative;
	margin: 0 auto 1em;
	max-width: 900px;
	line-height: 0;
	font-size: 0; /* Eliminiert Inline-Whitespace unter dem Video. */
	overflow: hidden;
	border-radius: 10px;
	background: transparent;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	outline: none;
}

/* Heller Grundton */
.hva-player-wrap.hva-theme-light {
	--hva-bar-bg: rgba(250, 250, 250, 0.62);
	--hva-bar-fg: #16181d;
	--hva-bar-fg-dim: rgba(20, 22, 28, 0.65);
	--hva-track-bg: rgba(0, 0, 0, 0.18);
	--hva-buffer-bg: rgba(0, 0, 0, 0.28);
}

.hva-player-wrap .hva-player {
	width: 100%;
	height: auto;
	display: block;
	vertical-align: middle; /* Kein Baseline-Gap. */
	background: #000;
	cursor: pointer;
}

/* Poster (Thumbnail) formatgerecht anzeigen. */
.hva-player-wrap .hva-player[poster] {
	object-fit: cover;
}

/* ---------- Großer, zentraler Play-Button ---------- */
.hva-bigplay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 76px;
	height: 76px;
	border: none;
	border-radius: 50%;
	background: var(--hva-accent);
	color: var(--hva-accent-text);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 3;
}

.hva-bigplay svg {
	width: 34px;
	height: 34px;
	margin-left: 3px; /* Play-Dreieck optisch zentrieren. */
}

.hva-bigplay:hover {
	transform: translate(-50%, -50%) scale(1.06);
}

/* Nach Start ausblenden. */
.hva-player-wrap.hva-playing .hva-bigplay,
.hva-player-wrap.hva-fullscreen-active .hva-bigplay {
	opacity: 0;
	pointer-events: none;
}

/* ---------- Buffer-Spinner ---------- */
.hva-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 44px;
	height: 44px;
	margin: -22px 0 0 -22px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-top-color: var(--hva-accent);
	border-radius: 50%;
	opacity: 0;
	pointer-events: none;
	z-index: 3;
	animation: hva-spin 0.8s linear infinite;
}

.hva-player-wrap.hva-buffering.hva-playing .hva-spinner {
	opacity: 1;
}

@keyframes hva-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------- Steuerleiste ---------- */
.hva-controls {
	position: absolute;
	left: 8px;
	right: 8px;
	bottom: 8px;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	border-radius: 10px;
	background: var(--hva-bar-bg);
	color: var(--hva-bar-fg);
	line-height: 1;
	z-index: 4;
	transition: opacity 0.25s ease, transform 0.25s ease;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* Glasmorphism nur, wenn aktiviert und vom Browser unterstützt. */
.hva-player-wrap.hva-glass .hva-controls {
	-webkit-backdrop-filter: blur(var(--hva-blur)) saturate(150%);
	backdrop-filter: blur(var(--hva-blur)) saturate(150%);
	border: 1px solid rgba(255, 255, 255, 0.14);
}

.hva-player-wrap.hva-theme-light.hva-glass .hva-controls {
	border-color: rgba(0, 0, 0, 0.08);
}

/* Auto-Hide */
.hva-player-wrap.hva-hide-controls .hva-controls {
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
}

.hva-player-wrap.hva-hide-controls .hva-player {
	cursor: none;
}

/* ---------- Buttons ---------- */
.hva-ctrl {
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--hva-bar-fg);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border-radius: 7px;
	transition: background 0.15s ease, color 0.15s ease;
}

.hva-ctrl:hover {
	background: rgba(127, 127, 127, 0.22);
}

.hva-ctrl svg {
	width: 18px;
	height: 18px;
	display: block;
}

/* Icon-Umschaltung Play/Pause, Volume, Fullscreen */
.hva-icon-pause,
.hva-icon-muted,
.hva-icon-exit-fs {
	display: none;
}

.hva-player-wrap.hva-playing .hva-play .hva-icon-play {
	display: none;
}
.hva-player-wrap.hva-playing .hva-play .hva-icon-pause {
	display: block;
}

.hva-player-wrap.hva-muted .hva-mute .hva-icon-volume {
	display: none;
}
.hva-player-wrap.hva-muted .hva-mute .hva-icon-muted {
	display: block;
}

.hva-player-wrap.hva-fullscreen-active .hva-fullscreen .hva-icon-enter-fs {
	display: none;
}
.hva-player-wrap.hva-fullscreen-active .hva-fullscreen .hva-icon-exit-fs {
	display: block;
}

/* ---------- Fortschrittsbalken ---------- */
.hva-progress {
	flex: 1 1 auto;
	position: relative;
	height: 28px;
	display: flex;
	align-items: center;
	cursor: pointer;
	touch-action: none;
	outline: none;
}

.hva-progress-track {
	position: relative;
	width: 100%;
	height: 5px;
	border-radius: 3px;
	background: var(--hva-track-bg);
	overflow: visible;
}

.hva-progress-buffer {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0;
	border-radius: 3px;
	background: var(--hva-buffer-bg);
}

.hva-progress-fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0;
	border-radius: 3px;
	background: var(--hva-accent);
}

.hva-progress-knob {
	position: absolute;
	right: -6px;
	top: 50%;
	width: 12px;
	height: 12px;
	transform: translateY(-50%) scale(0);
	border-radius: 50%;
	background: var(--hva-accent);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
	transition: transform 0.12s ease;
}

.hva-progress:hover .hva-progress-knob,
.hva-progress:focus .hva-progress-knob {
	transform: translateY(-50%) scale(1);
}

.hva-progress:focus-visible {
	box-shadow: 0 0 0 2px var(--hva-accent);
	border-radius: 4px;
}

/* ---------- Zeitanzeige ---------- */
.hva-time {
	flex: 0 0 auto;
	font-size: 12.5px;
	font-variant-numeric: tabular-nums;
	color: var(--hva-bar-fg-dim);
	white-space: nowrap;
	line-height: 1;
}

/* ---------- Lautstärke ---------- */
.hva-volume {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 2px;
}

.hva-volume-slider {
	width: 0;
	opacity: 0;
	height: 4px;
	transition: width 0.2s ease, opacity 0.2s ease;
	accent-color: var(--hva-accent);
	cursor: pointer;
}

.hva-volume:hover .hva-volume-slider,
.hva-volume:focus-within .hva-volume-slider {
	width: 68px;
	opacity: 1;
}

/* ---------- Responsive: sehr schmale Player ---------- */
@media (max-width: 420px) {
	.hva-time {
		display: none;
	}
	.hva-controls {
		gap: 6px;
		padding: 6px 8px;
	}
}

/* Reduzierte Bewegung respektieren. */
@media (prefers-reduced-motion: reduce) {
	.hva-controls,
	.hva-bigplay,
	.hva-progress-knob,
	.hva-volume-slider {
		transition: none;
	}
	.hva-spinner {
		animation-duration: 1.6s;
	}
}
