.tui-select {
	position: relative;
	margin: 0.5rem 0;
	font-size: 0.9rem;
}

.tui-select.inline {
	display: inline-flex;
	flex-direction: column;
	margin: 0 0.5rem 0 0;
}

.select-label {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin-bottom: 0.35rem;
	color: var(--terminal-muted);
	font-size: 0.85rem;
}

:global(.label-icon) {
	color: var(--select-color);
}

.select-trigger {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.5rem 0.75rem;
	background: color-mix(in srgb, var(--terminal-bg) 80%, black);
	border: 1px solid var(--terminal-muted);
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.15s ease;
}

.tui-select.open .select-trigger,
.select-trigger:focus-visible {
	border-color: var(--select-color);
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--select-color) 30%, transparent);
}

.tui-select.error .select-trigger {
	border-color: #f38ba8;
}

.tui-select.disabled .select-trigger {
	opacity: 0.5;
	cursor: not-allowed;
}

.select-prompt {
	color: var(--select-color);
	font-weight: bold;
}

.select-value {
	flex: 1;
	color: var(--terminal-text);
}

.select-value.placeholder {
	color: var(--terminal-muted);
	opacity: 0.6;
}

.select-arrow {
	color: var(--terminal-muted);
	font-size: 0.7rem;
}

.select-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 0.25rem;
	background: var(--terminal-bg);
	border: 1px solid var(--select-color);
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	z-index: 100;
	overflow: hidden;
}

.select-search {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid var(--terminal-muted);
}

.select-search input {
	flex: 1;
	background: transparent;
	border: none;
	color: var(--terminal-text);
	font-family: inherit;
	font-size: inherit;
	outline: none;
}

.select-search input::placeholder {
	color: var(--terminal-muted);
}

.select-options {
	max-height: 200px;
	overflow-y: auto;
}

.select-option {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	cursor: pointer;
	transition: background 0.1s ease;
}

.select-option.highlighted {
	background: color-mix(in srgb, var(--select-color) 15%, transparent);
}

.select-option.selected {
	color: var(--select-color);
}

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

:global(.option-icon) {
	color: var(--select-color);
}

.option-label {
	flex: 1;
}

:global(.check-icon) {
	color: var(--select-color);
}

.select-empty {
	padding: 0.75rem;
	text-align: center;
	color: var(--terminal-muted);
	font-style: italic;
}

.select-error {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.35rem;
	color: #f38ba8;
	font-size: 0.8rem;
}
