/*
 * Per-user search mode dropdown (JIVEAI-75).
 *
 * Sits INLINE in core's search form, between the query box and the Search button, so it
 * reads as part of composing the query. It therefore has to align to a button rather than
 * occupy a bar of its own: vertical-align middle against the submit input, and the same
 * border colour as the query field so the row looks like one control group.
 *
 * Colours are literals rather than tokens because core exposes no CSS custom properties
 * here; they are sampled from the surrounding Jive chrome.
 */
.js-semantic-mode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* Sits between the input and the button, which both carry their own margins. */
    margin: 0 8px 0 4px;
    vertical-align: middle;
}

.js-semantic-mode-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: #6a7684;
    margin: 0;
    cursor: pointer;
    white-space: nowrap;
}

.js-semantic-mode-select {
    font-size: 13px;
    color: #2c3742;
    background: #fff;
    /* Matches the query field's border, so the two read as one group. */
    border: 1px solid #c6ced8;
    border-radius: 3px;
    padding: 5px 6px;
    max-width: 15em;
    cursor: pointer;
}

.js-semantic-mode-select:hover {
    border-color: #9aa5b1;
}

/* Keyboard focus must stay visible: several Jive stylesheets zero out default outlines. */
.js-semantic-mode-select:focus-visible {
    outline: 2px solid #1b6b4f;
    outline-offset: 1px;
}

/* Empty unless a save failed, so it takes no space in the normal case. */
.js-semantic-mode-note:not(:empty) {
    font-size: 11.5px;
    color: #9c4a4a;
    white-space: nowrap;
    margin-left: 2px;
}

/* Saving. The Search button is disabled in script at the same time, so a query cannot be
   issued in the old mode; this only signals it. */
.js-semantic-mode-busy .js-semantic-mode-select {
    opacity: 0.6;
    cursor: progress;
}

.js-semantic-mode-failed .js-semantic-mode-select {
    border-color: #d9b3b3;
}

/* Fallback placement, above the results, when the search form is not in its usual shape.
   Then it IS a bar of its own and needs the padding a bar wants. */
.js-semantic-mode-block {
    display: flex;
    margin: 0 0 10px;
    padding: 8px 12px;
    border: 1px solid #e4e8ed;
    border-radius: 5px;
    background: #fbfcfd;
}

/*
 * The spotlight instance.
 *
 * The overlay panel is LIGHT, not dark — an earlier revision styled it for a dark ground and
 * the control rendered as pale text on white, which is what "not displayed properly" looked
 * like. It therefore inherits the base colours above and only changes what has to change:
 * it sits in a single-row search bar next to the query field, so it must stay compact and
 * must not wrap.
 */
.js-semantic-mode-visor {
    margin: 0 0 0 10px;
    vertical-align: middle;
    white-space: nowrap;
}

.js-semantic-mode-visor .js-semantic-mode-select {
    font-size: 12px;
    padding: 2px 4px;
    /* Mode names only, so the control never needs to be wide. */
    max-width: 9em;
}
