@use "@shared/styles/variables" as *;

.trigger {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;

	&:focus-visible {
		outline: none;
		box-shadow: var(--focus-ring);
		border-radius: variables.$radius-sm;
	}
}

.content,
.subContent {
	z-index: 100;
	min-width: 180px;
	padding: 6px;
	background-color: variables.$bg-default;
	border: 1px solid variables.$border-default;
	border-radius: variables.$radius-md;
	box-shadow: var(--shadow-lg);
	&[data-state="open"] {
		animation: fadeIn var(--duration-normal) var(--ease-out);
	}
	&[data-state="closed"] {
		animation: fadeOut var(--duration-fast) ease-in;
	}
}

.item,
.checkboxItem,
.radioItem,
.subTrigger {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 8px 10px;
	font-size: 13px;
	font-weight: 500;
	color: variables.$text-primary;
	cursor: pointer;
	border-radius: variables.$radius-sm;
	outline: none;
	transition: background-color var(--duration-fast) var(--ease-out);

	&[data-highlighted] {
		background-color: variables.$bg-surface;
	}

	&[data-disabled] {
		color: variables.$text-tertiary;
		pointer-events: none;
		opacity: 0.5;
	}
}

.subTrigger {
	justify-content: space-between;

	&[data-state="open"] {
		background-color: variables.$bg-surface;
	}
}

.itemIndicator {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	color: variables.$color-secondary;
}

.label {
	padding: 8px 10px 4px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: variables.$text-tertiary;
}

.separator {
	height: 1px;
	margin: 4px 0;
	background-color: variables.$border-default;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: scale(0.96) translateY(-4px);
	}

	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

@keyframes fadeOut {
	from {
		opacity: 1;
		transform: scale(1) translateY(0);
	}

	to {
		opacity: 0;
		transform: scale(0.96) translateY(-4px);
	}
}
