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

.modalRoot {
	composes: root default from './Modal.module.css';
	width: 580px;
	max-width: min(580px, calc(100vw - 32px));
	min-height: 420px;
	height: 440px;
	max-height: min(480px, calc(100svh - 96px));
	border-radius: 1rem;
	padding: 0;
	overflow: hidden;
	background: var(--background-primary);
}

@media screen and (max-width: 720px) {
	.modalRoot {
		width: min(100%, calc(100vw - 32px));
		min-height: 360px;
		height: auto;
		max-height: calc(100svh - 48px);
	}
}

.modalContent {
	height: 100%;
	padding: 0;
	overflow: hidden;
}

.modalLayout {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	width: 100%;
	height: 100%;
	min-height: 0;
	background: var(--background-primary);
}

.sidebar {
	display: flex;
	flex-direction: column;
	background: var(--background-secondary);
	height: 100%;
	min-height: 0;
	width: 96px;
	min-width: 96px;
}

.reactionFiltersPane {
	flex: 1;
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
	padding: 0;
}

.scrollerPadding {
	padding: 0.35rem 0.35rem 0.45rem 0.35rem;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	align-items: center;
}

.sidebarScroller {
	height: 100%;
	min-height: 0;
}

.reactionFilterButtonContainer {
	display: flex;
	justify-content: center;
	width: 100%;
	margin-bottom: 0.25rem;
}

.reactionFilterButton {
	width: 100%;
	padding: 0;
	border-radius: 0.6rem;
	background: transparent;
	border: none;
	color: inherit;
	transition:
		color 0.15s ease,
		transform 0.15s ease;
}

.reactionFilterButtonIdle {
	cursor: pointer;
}

.reactionFilterButtonIdle:hover {
	transform: translateY(-1px);
}

.reactionFilterButtonSelected {
	box-shadow: 0 0 0 2px var(--background-modifier-accent-focus);
	background-color: var(--background-modifier-hover);
	transform: translateY(-1px);
}

.reactionEmoji {
	width: 24px;
	height: 16px;
	object-fit: contain;
}

.reactionCount {
	font-weight: 600;
	font-size: 0.75rem;
	color: inherit;
	line-height: 1;
	margin-left: auto;
}

.noReactionsContainer {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	color: var(--text-primary-muted);
	min-height: 0;
}

.noReactionsText {
	font-size: 0.875rem;
}

.reactionListContainer {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
	padding: 0.45rem;
	padding-top: 0;
	background: var(--background-secondary);
}

.reactionListPanel {
	display: flex;
	flex: 1;
	flex-direction: column;
	background: var(--background-secondary-lighter);
	border-radius: 8px;
	padding: 0.2rem 0;
	overflow: hidden;
	border: 1px solid var(--border-color);
}

.scrollerColumn {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
}

.reactorScroller {
	height: 100%;
	min-height: 0;
}

.reactorItem {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.55rem 0.85rem;
	min-height: 44px;
}

.reactorItemBorder {
	border-top: 1px solid var(--background-header-secondary);
}

.reactorInfo {
	margin-left: 0.35rem;
	display: flex;
	flex: 1 1 auto;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 0.4rem;
	overflow: hidden;
}

.reactorName {
	font-size: 0.95rem;
	color: var(--text-chat);
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 180px;
	margin-top: -2px;
}

.reactorTag {
	font-size: 0.75rem;
	color: var(--text-chat-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 120px;
}

.removeReactionButton {
	margin-left: 0.5rem;
	flex: none;
	color: var(--text-chat-muted);
	cursor: pointer;
	background: transparent;
	border: none;
	padding: 0;
}

.removeReactionButton:hover {
	color: var(--text-chat);
}

.removeReactionIcon {
	height: 1rem;
	width: 1rem;
}

.loadingContainer {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	padding: 1rem;
	gap: 1rem;
}

.srOnly {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}
