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

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

.headerLeftContent {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
	color: var(--text-primary);
}

.headerIcon {
	flex-shrink: 0;
	color: var(--text-tertiary);
}

.headerLabel {
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.5rem;
	white-space: nowrap;
}

.content {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	padding: 1rem 1.25rem 0;
}

.toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-shrink: 0;
	padding-bottom: 0.75rem;
}

.toolbarLeft {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
}

.toolbarTitle {
	margin: 0;
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.5rem;
	color: var(--text-primary);
	white-space: nowrap;
}

.toolbarRight {
	display: flex;
	align-items: stretch;
	gap: 0.5rem;
}

.searchInput {
	width: 14rem;
	min-width: 0;
}

.sortButton {
	flex-shrink: 0;
	height: auto;
	min-height: 0;
}

.tableWrapper {
	display: flex;
	flex-direction: column;
	min-height: 400px;
	border: 1px solid var(--background-header-secondary);
	border-radius: 0.5rem;
	background-color: var(--background-secondary-alt);
	overflow: hidden;
}

.emptyState {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
}

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

.table {
	width: 100%;
	min-width: 780px;
	border-collapse: collapse;
	table-layout: fixed;
}

.tableHead {
	position: sticky;
	top: 0;
	z-index: 1;
	background-color: var(--background-secondary-alt);
}

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

.progressRow {
	height: 0;
	line-height: 0;
}

.progressCell {
	padding: 0 !important;
	height: 2px;
	position: relative;
	overflow: hidden;
}

.progressTrack {
	position: absolute;
	inset: 0;
	background: transparent;
	overflow: hidden;
}

.progressBar {
	position: absolute;
	top: 0;
	left: 0;
	width: 30%;
	height: 100%;
	background-color: var(--brand-primary-light);
	border-radius: 1px;
	will-change: transform;
}

:global(.theme-light) .progressBar {
	background-color: var(--brand-primary);
}

.th {
	padding: 0.3125rem 0.875rem;
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: var(--text-tertiary);
	text-align: left;
	white-space: nowrap;
}

.thContent {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	min-width: 0;
	flex-wrap: nowrap;
}

.filterButton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.125rem;
	border: none;
	border-radius: 0.25rem;
	background: transparent;
	color: var(--text-tertiary);
	cursor: pointer;
	transition: color 150ms ease;
}

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

.filterButtonActive {
	color: var(--focus-primary);
}

.filterButtonActive:hover {
	color: var(--focus-primary);
}

.nameCol {
	width: 25%;
	min-width: 140px;
}

.dateCol {
	width: 14%;
	min-width: 110px;
}

.joinMethodCol {
	width: 17%;
	min-width: 130px;
}

.rolesCol {
	width: 23%;
	min-width: 120px;
}

.actionsCol {
	width: 4.5rem;
	max-width: none;
	overflow: visible;
	text-align: center;
}

.tr {
	border-bottom: 1px solid var(--background-header-secondary);
	transition: background-color 0.1s;
	cursor: pointer;
}

.tr:last-child {
	border-bottom: none;
}

.tr:hover,
.tr[data-menu-active] {
	background-color: var(--background-modifier-hover);
}

.td {
	padding: 0;
	padding-inline: 0.875rem;
	font-size: 0.875rem;
	vertical-align: middle;
	color: var(--text-primary);
	max-width: 0;
	overflow: hidden;
	height: 3rem;
}

.cellContent {
	display: flex;
	align-items: center;
	height: 3rem;
}

.nameCell {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	min-width: 0;
	height: 3rem;
}

.nameInfo {
	display: flex;
	flex-direction: column;
	gap: 0.0625rem;
	min-width: 0;
}

.nameRow {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	min-width: 0;
}

.displayName {
	font-weight: 600;
	font-size: 0.875rem;
	line-height: 1.3;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ownerIcon {
	height: 0.875rem;
	width: 0.875rem;
	flex-shrink: 0;
	color: var(--status-idle);
}

.tag {
	font-size: 0.75rem;
	line-height: 1.25;
	color: var(--text-tertiary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.timestampText {
	display: inline-block;
	max-width: 100%;
	font-size: 0.8125rem;
	color: var(--text-primary-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pill {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.125rem 0.5rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 500;
	white-space: nowrap;
	background-color: var(--background-secondary);
	color: var(--text-primary-muted);
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rolePill {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.125rem 0.5rem;
	border-radius: 0.25rem;
	font-size: 0.75rem;
	font-weight: 500;
	white-space: nowrap;
	color: var(--text-primary);
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}

.roleDot {
	width: 0.5625rem;
	height: 0.5625rem;
	border-radius: 50%;
	flex-shrink: 0;
}

.rolesCell {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	flex-wrap: nowrap;
	min-width: 0;
	overflow: hidden;
	height: 3rem;
}

.overflowPill {
	display: inline-flex;
	align-items: center;
	padding: 0.125rem 0.375rem;
	border-radius: 0.25rem;
	font-size: 0.75rem;
	font-weight: 600;
	white-space: nowrap;
	background-color: var(--background-secondary);
	color: var(--text-primary-muted);
	cursor: pointer;
	border: none;
	transition:
		background-color 200ms ease,
		color 200ms ease;
}

.overflowPill:hover {
	background-color: var(--background-secondary-alt);
	color: var(--text-primary);
}

.actionsButton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	border: none;
	border-radius: 50%;
	background-color: var(--background-secondary);
	color: var(--text-tertiary);
	cursor: pointer;
	transition:
		background-color 200ms ease,
		color 200ms ease;
}

.actionsButton:hover {
	background-color: var(--background-secondary-alt);
	color: var(--text-primary);
}

.actionsButton[data-menu-active] {
	background-color: var(--background-secondary-alt);
	color: var(--text-primary);
}

.loadMoreContainer {
	display: flex;
	justify-content: center;
	padding: 0.625rem;
	border-top: 1px solid var(--background-header-secondary);
}

.footer {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.625rem 0.875rem;
	font-size: 0.8125rem;
	color: var(--text-primary-muted);
	flex-shrink: 0;
	border-top: 1px solid var(--background-header-secondary);
}

.pageSizeSelect {
	width: 5.5rem;
}

.roleFilterItem {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.roleFilterDot {
	width: 0.75rem;
	height: 0.75rem;
	border-radius: 50%;
	flex-shrink: 0;
}

.inviterTooltip {
	display: flex;
	align-items: center;
	gap: 0.375rem;
}

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

.readonlyRoleItem {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 12px;
	width: 100%;
}

.readonlyRoleLabel {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	overflow: hidden;
}

.readonlyRoleDot {
	width: 12px;
	height: 12px;
	flex-shrink: 0;
	border-radius: 50%;
}

.readonlyRoleSpacer {
	width: 20px;
	height: 20px;
}
