/*
 * 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;
	flex-direction: column;
	gap: var(--spacing-3);
}

.headerRow {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--spacing-3);
}

.header {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-1);
}

.title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.25rem;
	font-weight: 600;
	color: var(--text-primary);
}

.description {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.25rem;
	color: var(--text-primary-muted);
}

.headerActions {
	display: flex;
	align-items: center;
	gap: var(--spacing-2);
}

.devToggleRow {
	display: flex;
	justify-content: flex-start;
	margin-bottom: var(--spacing-2);
}

.devToggle {
	display: flex;
	align-items: center;
	gap: var(--spacing-1);
	font-size: 0.8125rem;
	color: var(--text-primary-muted);
}

.devToggleLabel {
	white-space: nowrap;
}

.callout {
	background-color: var(--panel-control-bg);
	border-radius: var(--radius-lg);
	border: 1px solid var(--panel-control-border);
	padding: var(--spacing-3);
	display: flex;
	flex-direction: column;
	gap: var(--spacing-2);
	box-shadow: var(--shadow-sm);
}

.calloutTitle {
	display: flex;
	align-items: center;
	gap: var(--spacing-2);
	font-weight: 500;
	color: var(--text-primary);
	font-size: 0.875rem;
}

.calloutIcon {
	color: var(--accent-info);
}

.pttHint {
	margin: 0;
	margin-top: var(--spacing-1);
	font-size: 0.8125rem;
	color: var(--text-chat-muted);
}

.toggleRow {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-2);
	padding: var(--spacing-3);
	border-radius: var(--radius-lg);
	border: 1px solid var(--panel-control-divider);
	background-color: var(--panel-control-bg);
}

@media (min-width: 768px) {
	.toggleRow {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
}

.toggleText {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-1);
	max-width: 520px;
}

.label {
	font-weight: 500;
	font-size: 0.875rem;
	color: var(--text-primary);
}

.section {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-2);
}

.sectionTitle {
	font-size: 0.75rem;
	line-height: 1rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--text-primary-muted);
}

.rowWrapper {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.row {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-2);
	padding: var(--spacing-3);
	border-radius: var(--radius-xl);
	border: 1px solid var(--background-modifier-accent);
	background-color: var(--background-textarea);
	min-height: 88px;
	box-shadow: var(--shadow-sm);
	transition:
		background-color var(--transition-fast),
		border-color var(--transition-fast),
		transform var(--transition-fast);
}

@media (min-width: 768px) {
	.row {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
}

.rowText {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-1);
	min-width: 0;
}

.rowText .label {
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
}

.rowDescription {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.25rem;
	color: var(--text-primary-muted);
	display: -webkit-box;
	line-clamp: 2;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.rowControls {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-2);
	align-items: stretch;
	width: 100%;
}

@media (min-width: 480px) {
	.rowControls {
		align-items: flex-end;
		width: auto;
	}
}

.primaryControls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--spacing-2);
}

.globalFooter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--spacing-1);
	padding: var(--spacing-2) var(--spacing-3);
	border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.globalFooterBrand {
	border: 1px solid var(--brand-primary);
	background-color: var(--brand-primary);
	color: var(--text-on-brand-primary);
}

.globalFooterDesktop {
	border: 1px solid var(--background-modifier-accent);
	background-color: var(--background-primary);
	color: var(--text-primary);
}

.globalFooterText {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.globalDescription {
	font-size: 0.75rem;
	margin: 0;
}

.globalLabel {
	font-size: 0.8125rem;
}

.globalFooterControls {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: var(--spacing-2);
}

.hasFooterWrapper .row {
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	margin-bottom: 0;
}

.globalRow {
	display: flex;
	align-items: center;
	gap: var(--spacing-2);
	font-size: 0.75rem;
	color: var(--text-primary-muted);
}

.globalLabel {
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 600;
}

.permissionCard {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-3);
	padding: var(--spacing-3);
	border-radius: var(--radius-lg);
	border: 1px solid var(--panel-control-border);
	background-color: var(--panel-control-bg);
	box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
	.permissionCard {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
}

.permissionText {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-1);
	flex: 1;
}

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

.permissionDescription,
.permissionHelp {
	margin: 0;
	font-size: 0.8125rem;
	color: var(--text-primary-muted);
}

.permissionHelp {
	color: var(--text-warning, var(--status-warning-foreground, var(--text-primary)));
}

.permissionActions {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-2);
	align-items: flex-start;
}

@media (min-width: 480px) {
	.permissionActions {
		align-items: flex-end;
	}
}

.permissionStatus {
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--text-primary-muted);
}

.permissionStatus[data-status='granted'] {
	color: var(--success-foreground, #22c55e);
}

.permissionStatus[data-status='denied'] {
	color: var(--status-danger-foreground, #f97316);
}

.permissionStatus[data-status='checking'] {
	color: var(--text-primary-muted);
}
