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

.fieldset {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.labelContainer {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

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

.inputContainer {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.inputWrapper {
	display: flex;
	height: 2.75rem;
	width: 100%;
	overflow: hidden;
	border-radius: 0.5rem;
	border: 1px solid var(--background-modifier-accent);
	transition-property: color, background-color, border-color;
	transition-duration: 150ms;
	transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.inputWrapper:focus-within {
	border-color: var(--background-modifier-accent-focus);
}

.input {
	height: 100%;
	width: 100%;
	min-width: 0;
	flex: 1 1 0%;
	appearance: none;
	border: none;
	background-color: transparent;
	padding: 0.625rem 1rem;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
	font-size: 0.875rem;
	line-height: 1.25rem;
	outline: none;
	color: var(--text-primary);
}

.input::placeholder {
	color: var(--text-primary-muted);
}

.input:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.inputError {
	color: var(--status-danger);
}

.divider {
	height: auto;
	width: 1px;
	background-color: var(--background-modifier-accent);
}

.swatchButton {
	position: relative;
	display: flex;
	height: 100%;
	width: 3rem;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
}

.swatchButton:enabled {
	cursor: pointer;
}

.swatchButton:disabled {
	cursor: not-allowed;
	opacity: 0.5;
}

.swatchIcon {
	filter: drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06));
}

.description {
	color: var(--text-primary-muted);
	font-size: 0.75rem;
	line-height: 1rem;
}

.errorText {
	color: var(--status-danger);
	font-size: 0.75rem;
	line-height: 1rem;
}

.popover {
	z-index: 20000;
	outline: none;
}

.popover[data-entering] {
	animation: popover-enter 150ms ease-out;
}

.popover[data-exiting] {
	animation: popover-exit 100ms ease-in;
}

@keyframes popover-enter {
	from {
		opacity: 0;
		transform: scale(0.95);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes popover-exit {
	from {
		opacity: 1;
		transform: scale(1);
	}
	to {
		opacity: 0;
		transform: scale(0.95);
	}
}

.dialog {
	outline: none;
}
