/*
 * 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/>.
 */

.cursorPointer {
	cursor: pointer;
}

.watchStreamOverlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--voice-overlay-strong);
	z-index: 10;
	pointer-events: none;
	border-radius: var(--radius-lg);
}

.watchStreamButtons {
	display: flex;
	gap: 8px;
	align-items: center;
}

.watchStreamButton {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	border-radius: 0.375rem;
	background-color: var(--status-danger);
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--button-danger-text);
	box-shadow: var(--shadow-sm);
	cursor: pointer;
	pointer-events: auto;
}

.watchStreamButton:hover {
	background-color: var(--status-danger);
}

.liveBadgeContainer {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	z-index: 11;
}

.streamEndedOverlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--voice-overlay-strong);
	z-index: 10;
	border-radius: var(--radius-lg);
}

.streamEndedContent {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	text-align: center;
	padding: 1rem;
}

.streamEndedTitle {
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-primary);
}

.streamEndedButton {
	min-width: 9rem;
}

.avatarRing {
	border-radius: 9999px;
}

.avatarRingSpeaking {
	border-radius: 9999px;
	box-shadow: 0 0 0 3px var(--status-online);
}

.focusOverlay {
	position: absolute;
	inset: 0;
	border-radius: var(--radius-lg);
	background-color: var(--voice-overlay-soft);
	z-index: 9;
	pointer-events: none;
}

.focusOverlayIcon {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	height: 1.5rem;
	width: 1.5rem;
	color: var(--voice-text-strong);
	filter: drop-shadow(0 1px 2px var(--voice-shadow-strong));
}

.videoDisabledOverlay {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--voice-overlay-strong);
}

.videoDisabledIcon {
	height: 1.5rem;
	width: 1.5rem;
	color: var(--status-danger);
}

.participantIcon {
	height: 1rem;
	width: 1rem;
	flex-shrink: 0;
}

.participantIconMuted {
	height: 1rem;
	width: 1rem;
	flex-shrink: 0;
	color: var(--text-primary-muted);
}

.participantIconRed {
	height: 1rem;
	width: 1rem;
	flex-shrink: 0;
	color: var(--status-danger);
}

.participantIconWhite {
	height: 1rem;
	width: 1rem;
	flex-shrink: 0;
	color: var(--voice-text-strong);
}

.participantNameText {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 500;
	font-size: 0.875rem;
	line-height: 1.25rem;
	color: var(--voice-text-strong);
}

.participantConnectionText {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--voice-text-muted);
	font-size: 0.75rem;
	line-height: 1rem;
}

.controlGroup {
	gap: 0.25rem;
	padding: 0;
}

.controlGroup:last-child {
	aspect-ratio: auto;
}

.menuButton,
.streamAudioButton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.375rem;
	border-radius: var(--radius-md);
	cursor: pointer;
	transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
	color: var(--voice-text-strong);
}

.menuButton:hover,
.streamAudioButton:hover {
	background-color: var(--voice-surface-4);
}

.streamAudioButtonMuted {
	color: var(--status-danger);
}

.menuButtonIcon,
.streamAudioIcon {
	height: 1rem;
	width: 1rem;
}

.avatarFlexShrink {
	flex-shrink: 0;
}

.previewPopover {
	position: absolute;
	top: 0;
	right: -10rem;
	width: 9.5rem;
	height: 6rem;
	background: var(--voice-surface-3);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-lg);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 0.25rem;
	gap: 0.5rem;
	z-index: 25;
}

.frozenFrame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background-color: var(--voice-surface-0);
	border-radius: var(--radius-lg);
}

.screensharePreviewBackground {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: var(--radius-lg);
	filter: brightness(0.4);
}

.screensharePlaceholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background-color: var(--voice-surface-2);
	border-radius: var(--radius-lg);
}

.focusedPlaceholderScreenSurface {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--voice-surface-4);
	border-radius: var(--radius-lg);
}

.focusedPlaceholderCameraOverlay {
	position: absolute;
	inset: 0;
	background-color: var(--voice-overlay);
	border-radius: var(--radius-lg);
	pointer-events: none;
	z-index: 2;
}

.focusedPlaceholderIconLayer {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	z-index: 3;
}

.focusedPlaceholderIcon {
	width: 2.1rem;
	height: 2.1rem;
	color: var(--voice-text-strong);
	filter: drop-shadow(0 2px 8px var(--voice-shadow-strong));
}

.focusedPlaceholderLiveBadge {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	z-index: 4;
	pointer-events: none;
}

.focusedPlaceholderAvatarDimmed {
	opacity: 0.58;
	filter: saturate(0.52);
}

.selfStreamOverlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 5;
	pointer-events: none;
	border-radius: var(--radius-lg);
}

.selfStreamOverlay.paused {
	background-color: var(--voice-overlay-strong);
}

.selfStreamPreviewActive {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
}

.selfStreamPreviewPaused {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	text-align: center;
	padding: 1.5rem;
}

.pausedIcon {
	height: 3.5rem;
	width: 3.5rem;
	color: var(--text-primary);
}

.pausedText {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--text-primary);
	line-height: 1.4;
}

.pausedSubtext {
	font-size: 0.875rem;
	color: var(--text-secondary);
	line-height: 1.4;
}

.streamingIndicatorOverlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 8;
	border-radius: var(--radius-lg);
	overflow: hidden;
}

.streamingBadge {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	z-index: 10;
}

.spectatorBadge {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	display: flex;
	align-items: center;
	gap: 3px;
	padding: 0.25rem 0.5rem;
	background-color: var(--voice-surface-4);
	border-radius: var(--radius-md);
	color: var(--voice-text-muted);
	font-size: 0.75rem;
	font-weight: 500;
	z-index: 10;
	opacity: var(--voice-hud-opacity, 1);
	pointer-events: var(--voice-hud-pointer-events, auto);
	transition: opacity var(--voice-hud-transition-duration, 180ms)
		var(--voice-hud-transition-easing, cubic-bezier(0.2, 0, 0, 1));
}

.spectatorIcon {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.streamingIndicatorContent {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	z-index: 1;
}

.streamingIndicatorButton {
	pointer-events: auto;
	font-size: 0.875rem;
	font-weight: 600;
	padding: 0.5rem 1rem;
}

.streamingPreviewBackground {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: var(--radius-lg);
	filter: blur(4px) brightness(0.4);
}

.streamingPlaceholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background-color: var(--voice-surface-2);
	border-radius: var(--radius-lg);
}

.viewersContainer {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.375rem 0.5rem;
	background-color: var(--voice-surface-4);
	border-radius: var(--radius-md);
	z-index: 10;
}

.viewersIcon {
	height: 1rem;
	width: 1rem;
	color: var(--text-secondary);
	flex-shrink: 0;
}

.viewersAvatars {
	display: flex;
	align-items: center;
	gap: -0.25rem;
}

.viewerAvatarWrapper {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-left: -0.25rem;
	border-radius: 9999px;
	border: 2px solid var(--voice-surface-4);
	cursor: pointer;
}

.viewerAvatarWrapper:first-child {
	margin-left: 0;
}

.viewerCountBadge {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 24px;
	min-width: 24px;
	padding: 0 0.375rem;
	margin-left: -0.25rem;
	background-color: var(--voice-surface-4);
	color: var(--text-secondary);
	font-size: 0.75rem;
	font-weight: 600;
	border-radius: 9999px;
	border: 2px solid var(--voice-surface-4);
	cursor: pointer;
}

@container (max-width: 320px) {
	.participantConnectionText {
		display: none;
	}
}

@container (max-width: 240px) {
	.participantNameText {
		font-size: 0.75rem;
	}
}

@container (max-width: 210px) {
	.controlGroup {
		display: none;
	}
}

@container (max-width: 170px) {
	.participantNameText {
		display: none;
	}
}
