/*
 * File Path: assets/css/admin/classification/classification-typeahead.css
 * Classification metabox -- typeahead search results, suggested code
 * checkbox items, chip flash animation, suggestion group wrappers.
 * Component of mbs-admin-classification.css (R-015).
 */

/* ── Typeahead ───────────────────────────────────────────────── */

.mbs-class-typeahead-wrap {
    position: relative;
    max-width: 380px;
}

.mbs-class-search {
    width: 100%;
}

.mbs-class-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-top: none;
    border-radius: 0 0 3px 3px;
    max-height: 220px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.mbs-class-result {
    padding: 7px 10px;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f6f7f7;
    transition: background 0.1s;
}

.mbs-class-result:last-child {
    border-bottom: none;
}

.mbs-class-result:hover {
    background: #f0f6fc;
}

/* ── Suggested Codes — checkbox items ───────────────────────────────────────── */
#mbs-genre-suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 4px 0;
}

.mbs-suggestion-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	border: 1px solid #8c8f94;
	border-radius: 3px;
	background: #fff;
	cursor: pointer;
	font-size: 12px;
	line-height: 1.4;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.mbs-suggestion-item:hover {
	border-color: var(--mbs-status-info);
	background: #f0f5fb;
}

.mbs-suggestion-item input[type="checkbox"] {
	margin: 0;
	cursor: pointer;
	flex-shrink: 0;
}

/* Checked state — code is now in the BISAC/Thema section. */
.mbs-suggestion-item:has(input:checked) {
	border-color: var(--mbs-status-info);
	background: #e8f0fb;
	color: var(--mbs-status-info-dark);
}

/* Flash animation — briefly highlights newly added BISAC chip. */
@keyframes mbs-chip-flash {
	0%   { background-color: #bdd7ee; box-shadow: 0 0 0 2px var(--mbs-status-info); }
	100% { background-color: transparent; box-shadow: none; }
}

.mbs-chip--flash {
	animation: mbs-chip-flash 1.4s ease-out forwards;
}

/* Suggestion group wrapper — adds spacing between BISAC and Thema blocks. */
.mbs-suggestions-group {
	margin-bottom: 10px;
}

.mbs-suggestions-group:last-child {
	margin-bottom: 0;
}

/* Secondary label (Suggested Thema Codes) — slightly de-emphasised. */
.mbs-genre-label--secondary {
	color: #50575e;
	font-style: italic;
}

