/* customSelect.css */
.custom-select-wrapper {
	position: relative;
	display: inline-block;
	width: 100%;
	font-family: inherit;
	font-size: 13px;
	user-select: none;
}

.custom-select-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 var(--spacing-sm);
	height: 28px; /* Matches default input heights typically */
	background-color: var(--bg-primary);
	border: 1px solid var(--border-medium);
	border-radius: var(--radius-sm);
	color: var(--text-primary);
	cursor: pointer;
	transition: all 0.2s ease;
	box-sizing: border-box;
}

.custom-select-trigger:hover {
	border-color: var(--border-dark);
}

.custom-select-trigger:focus,
.custom-select-trigger.is-open {
	outline: none;
	border-color: var(--accent-primary);
	box-shadow: 0 0 0 2px rgba(76, 110, 245, 0.2);
}

.custom-select-value {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.custom-select-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	margin-left: 8px;
	transition: transform 0.2s ease;
	color: var(--text-secondary);
}

.custom-select-icon svg {
	width: 14px;
	height: 14px;
}

.custom-select-trigger.is-open .custom-select-icon {
	transform: rotate(180deg);
}

/* Portal Dropdown Menu */
.custom-select-dropdown {
	position: absolute;
	z-index: 999999;
	top: 0;
	left: 0;
	min-width: 100px;
	max-height: 250px;
	overflow-y: auto;
	background-color: var(--bg-primary);
	border: 1px solid var(--border-medium);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-md);
	opacity: 0;
	transform: translateY(-5px);
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
	margin: 0;
	padding: 4px 0;
	list-style: none;
	box-sizing: border-box;
}

.custom-select-dropdown.is-open {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.custom-select-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 6px 12px;
	color: var(--text-primary);
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.custom-select-option:hover {
	background-color: var(--bg-hover);
}

.custom-select-option.is-selected {
	background-color: var(--accent-primary);
	color: #fff;
}

.custom-select-option.is-selected:hover {
	background-color: var(--accent-hover);
}

.custom-select-option-text {
	flex-grow: 1;
}

.custom-select-check {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
	margin-left: 8px;
	opacity: 0;
}

.custom-select-check svg {
	width: 14px;
	height: 14px;
}

.custom-select-option.is-selected .custom-select-check {
	opacity: 1;
}

/* Dark mode specific adjustments if needed, though CSS variables handle most */
:root.dark-theme .custom-select-dropdown {
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Scrollbar for dropdown */
.custom-select-dropdown::-webkit-scrollbar {
	width: 6px;
}
.custom-select-dropdown::-webkit-scrollbar-track {
	background: var(--bg-primary);
	border-radius: var(--radius-sm);
}
.custom-select-dropdown::-webkit-scrollbar-thumb {
	background: var(--border-dark);
	border-radius: var(--radius-sm);
}
.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
	background: var(--text-tertiary);
}
