/*
 * 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 {
	display: flex;
	width: 100%;
	height: 100%;
	flex-direction: column;
}

.searchField {
	display: flex;
	width: 100%;
	min-height: 44px;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 4px 8px;
}

.searchFieldInner {
	display: flex;
	min-width: 140px;
	flex: 1;
	align-items: center;
	gap: 8px;
}

.selectedPill {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px 8px;
	background-color: var(--brand-primary);
	border-radius: 9999px;
	color: white;
	font-size: 14px;
	line-height: 1;
}

.removeButton {
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	padding: 0;
	background: transparent;
	border-radius: 9999px;
	transition: background-color 0.2s ease;
	cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
	.removeButton:hover {
		background-color: rgba(255, 255, 255, 0.2);
	}
}

.searchIcon {
	width: 20px;
	height: 20px;
	color: var(--text-primary-muted);
	transition: color 0.2s ease;
}

.searchIconFocused {
	color: var(--text-primary);
}

.searchInput {
	flex: 1;
	min-width: 0;
	height: 20px;
	background-color: transparent;
	color: var(--text-primary);
	font-size: 14px;
	line-height: 1.25;
	border: 0;
	padding: 0;
	outline: none;
}

.searchInput::placeholder {
	color: var(--text-tertiary);
}

.scroller {
	--scrollbar-track-bg: var(--background-secondary);
	margin-top: 16px;
	flex: 1;
	min-height: 0;
}

.scrollerNoSearch {
	margin-top: 0;
}

.emptyState {
	display: flex;
	height: 100%;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.emptyStateText {
	text-align: center;
	color: var(--text-primary-muted);
}

.groupsContainer {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding-bottom: 16px;
}

.groupContainer {
	margin-bottom: 8px;
}

.groupLetter {
	margin-bottom: 8px;
	padding: 0 16px;
	font-weight: 600;
	font-size: 14px;
	color: var(--text-primary-muted);
}

.friendsList {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.friendButton {
	position: relative;
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	padding: 8px 16px;
	cursor: pointer;
}

.friendButton::before {
	content: '';
	position: absolute;
	inset: 0 var(--spacing-2);
	border-radius: var(--radius-md);
	transition: background-color 0.15s ease;
	pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
	.friendButton:hover::before {
		background-color: var(--background-modifier-hover);
	}
}

.friendButtonSelected::before {
	background-color: var(--background-modifier-hover);
}

.friendButtonDisabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.friendButtonDisabled:hover::before {
	background-color: transparent;
}

.friendInfo {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 12px;
}

.friendName {
	font-weight: 500;
	color: var(--text-primary);
}

.checkboxContainer {
	position: relative;
	z-index: 1;
	pointer-events: none;
}

.removeIcon {
	height: 12px;
	width: 12px;
}
