/* ============================================================
   SearchableCustomField - Select recherchable
   Style inspiré du visual_select de MantisClients
   ============================================================ */

/* Conteneur principal */
.scf-container {
	position: relative;
	display: inline-block;
	min-width: 300px;
	max-width: 500px;
	font-family: "Open Sans", sans-serif;
}

/* Affichage de la valeur sélectionnée */
.scf-selected {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
	border: 1px solid #dcebf7;
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	min-height: 20px;
	transition: border-color 0.15s;
}

.scf-container.scf-open .scf-selected {
	border-color: #2693ff;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
}

.scf-selected-text {
	flex: 1;
	color: #333;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.scf-selected-text:empty::before {
	content: "-- Sélectionner --";
	color: #999;
}

/* Bouton clear */
.scf-clear {
	display: none;
	margin-left: 8px;
	color: #999;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
}

.scf-clear:hover {
	color: #c00;
}

.scf-container.scf-has-value .scf-clear {
	display: inline;
}

/* Barre de recherche */
.scf-search {
	display: none;
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #dcebf7;
	border-top: none;
	font-size: 14px;
	outline: none;
	background: #fdfdfd;
	box-sizing: border-box;
}

.scf-container.scf-open .scf-search {
	display: block;
}

.scf-search:focus {
	background: #fff;
}

/* Liste déroulante */
.scf-list {
	display: none;
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 250px;
	overflow-y: auto;
	position: absolute;
	z-index: 999;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #dcebf7;
	border-top: none;
	border-bottom-left-radius: 4px;
	border-bottom-right-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.scf-container.scf-open .scf-list {
	display: block;
}

/* Items de la liste */
.scf-item {
	display: block;
	padding: 8px 12px;
	border-bottom: 1px solid #f2f2f2;
	cursor: pointer;
	color: #333;
	font-size: 0.95em;
	transition: background 0.1s;
}

.scf-item:last-child {
	border-bottom: none;
}

.scf-item:hover {
	background-color: #eef4f9;
	color: #2693ff;
}

/* Item actif (navigation clavier) */
.scf-item.scf-active {
	background-color: #e2e2e2;
	outline: 1px solid #ccc;
}

/* Item masqué par le filtre */
.scf-item.scf-hidden {
	display: none !important;
}

/* Message "aucun résultat" */
.scf-no-results {
	display: none;
	padding: 12px;
	color: #999;
	text-align: center;
	font-style: italic;
}

.scf-container.scf-open .scf-no-results.scf-visible {
	display: block;
}
