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

:root {
	--popout-padding: 8px;
	--popout-border-radius: 4px;
	--popout-item-radius: 3px;
	--popout-gap: 1px;
	--popout-shadow: 0 8px 16px rgba(0, 0, 0, 0.24);
	--menu-gap-main: 16px;
	--menu-gap-nested: 6px;
	--menu-item-padding: 6px 8px;
	--menu-item-gap: 12px;
}

.container {
	width: 320px;
}

.customStatusRow {
	display: flex;
	align-items: center;
}

.customStatusRow:hover {
	--emoji-show-animated: 1;
}

.customStatusPlaceholder {
	display: inline-flex;
	align-items: center;
	gap: 0.25em;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	font-size: 0.75rem;
	line-height: 1rem;
}

.customStatusPlaceholder:hover .customStatusPlaceholderText {
	text-decoration: underline;
}

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

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

.copyUsernameButton {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.25rem;
	height: 1.25rem;
	padding: 0;
	border: none;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--text-tertiary);
	cursor: pointer;
	opacity: 0;
	transition:
		opacity 0.15s ease,
		color 0.15s ease,
		background-color 0.15s ease;
}

.copyUsernameButton:hover {
	background: var(--background-modifier-hover);
	color: var(--text-primary);
}

.container:hover .copyUsernameButton,
.container:focus-within .copyUsernameButton {
	opacity: 1;
}

.footer {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	width: 100%;
}

.actionGroup {
	display: flex;
	flex-direction: column;
	border-radius: 0.75rem;
	background-color: var(--background-secondary-alt);
	overflow: hidden;
}

.editProfileButton {
	margin-top: 0;
}

.actionButton {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	width: 100%;
	padding: 0.625rem 0.75rem;
	border: none;
	background: transparent;
	color: var(--text-primary);
	text-align: left;
	font-weight: 500;
	cursor: pointer;
}

.actionButton:hover {
	background: var(--background-modifier-hover);
}

.actionDivider {
	margin-left: 0.75rem;
	margin-right: 0.75rem;
	height: 1px;
	background-color: var(--background-header-secondary);
	opacity: 0.3;
}

.actionButton:disabled {
	cursor: not-allowed;
}

.actionButtonDisabled {
	opacity: 0.5;
}

.actionIcon {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--text-secondary);
}

.actionContent {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.actionLabel {
	font-weight: 500;
	font-size: 0.8125rem;
	color: var(--text-primary);
	line-height: 1.25;
}

.actionHint {
	font-size: 0.6875rem;
	color: var(--text-tertiary);
	line-height: 1.25;
}

.actionChevron {
	color: var(--text-tertiary);
	flex-shrink: 0;
	align-self: center;
}

.statusMenu {
	display: flex;
	flex-direction: column;
	width: 280px;
	padding: var(--popout-padding);
	margin-left: var(--menu-gap-main);
	background-color: var(--background-primary);
	border: 1px solid var(--background-modifier-accent);
	border-radius: var(--popout-border-radius);
	box-shadow: var(--popout-shadow);
}

.expiryPopup {
	display: flex;
	flex-direction: column;
	width: 220px;
	padding: var(--popout-padding);
	margin-left: var(--menu-gap-nested);
	background-color: var(--background-primary);
	border: 1px solid var(--background-modifier-accent);
	border-radius: var(--popout-border-radius);
	box-shadow: var(--popout-shadow);
}

.switchMenu {
	display: flex;
	flex-direction: column;
	width: 280px;
	padding: var(--popout-padding);
	margin-left: var(--menu-gap-main);
	background-color: var(--background-primary);
	border: 1px solid var(--background-modifier-accent);
	border-radius: var(--popout-border-radius);
	box-shadow: var(--popout-shadow);
}

.switchMenuList {
	display: flex;
	flex-direction: column;
}

.switchMenuFooter {
	margin-top: var(--popout-padding);
	padding-top: var(--popout-padding);
	border-top: 1px solid var(--background-modifier-accent);
}

.manageAccountsButton {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: var(--menu-item-padding);
	border: none;
	border-radius: var(--popout-item-radius);
	background: transparent;
	color: var(--text-secondary);
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	line-height: 16px;
	text-align: left;
}

.manageAccountsButton:hover {
	background-color: var(--background-modifier-hover);
	color: var(--text-primary);
}

.accountMenuItem {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: var(--menu-item-padding);
	margin: var(--popout-gap) 0;
	border: none;
	border-radius: var(--popout-item-radius);
	background: transparent;
	color: var(--text-secondary);
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	line-height: 16px;
	text-align: left;
}

.accountMenuItem:hover {
	background-color: var(--background-modifier-hover);
	color: var(--text-primary);
}

.accountMenuAvatar {
	flex-shrink: 0;
}

.accountMenuInfo {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
	gap: 0.125rem;
}

.accountMenuTag {
	font-weight: 500;
	font-size: 13px;
	line-height: 16px;
}

.accountMenuDiscriminator {
	color: var(--text-tertiary);
	font-weight: 400;
}

.accountMenuMeta {
	font-size: 11px;
	color: var(--status-online);
	line-height: 14px;
}

.accountMenuCheck {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 1.25rem;
	height: 1.25rem;
	background-color: var(--brand-primary);
	border-radius: 50%;
	color: white;
}

.statusMenuRow {
	margin: var(--popout-gap) 0;
}

.statusMenuItem {
	display: grid;
	grid-template-columns: 18px 1fr auto;
	align-items: flex-start;
	gap: var(--menu-item-gap);
	width: 100%;
	padding: var(--menu-item-padding);
	margin: var(--popout-gap) 0;
	border: none;
	border-radius: var(--popout-item-radius);
	background: transparent;
	color: var(--text-secondary);
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	line-height: 18px;
	text-align: left;
	box-sizing: border-box;

	&:hover {
		background-color: var(--background-modifier-hover);
		color: var(--text-primary);
	}
}

.statusMenuIcon {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 1px;
}

.statusMenuText {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}

.statusMenuLabel {
	font-weight: 500;
	font-size: 14px;
	line-height: 18px;
}

.statusMenuDescription {
	font-size: 12px;
	color: var(--text-tertiary);
	line-height: 16px;
	margin-top: 2px;
}

.statusMenuChevron {
	color: var(--text-secondary);
	flex-shrink: 0;
	margin-top: 2px;
}

.expiryItem {
	width: 100%;
	padding: var(--menu-item-padding);
	margin: var(--popout-gap) 0;
	border: none;
	border-radius: var(--popout-item-radius);
	background: transparent;
	color: var(--text-secondary);
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	line-height: 18px;
	text-align: left;
	box-sizing: border-box;

	&:hover {
		background-color: var(--background-modifier-hover);
		color: var(--text-primary);
	}
}

.expiryLabel {
	font-size: 14px;
	font-weight: 500;
}
