/* Housing landing page: "AI Search / Filter Search" toggle and the AI bar.
   The bar itself is the shared listings search bar (partials/searchbar.css). */

.hl-mode-toggle {
    display: inline-flex;
    align-self: center;
    gap: 4px;
    padding: 5px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

.hl-mode-toggle__option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #8a8a8a;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.hl-mode-toggle__option:hover {
    color: #333333;
}

.hl-mode-toggle__option[aria-selected="true"] {
    background: #f1f1f1;
    color: #111111;
}

.hl-mode-toggle__option:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Only the selected mode's panel is shown. */
.hl-hero__inner[data-hl-search-mode="ai"] [data-hl-mode-panel="filter"],
.hl-hero__inner[data-hl-search-mode="filter"] [data-hl-mode-panel="ai"] {
    display: none;
}

/* No box: the bar and caption sit directly on the hero image.
   Bar: 46px tall with a 24px radius like Google's box, a little wider (692px). */
.hl-ai-search {
    width: min(692px, 100%);
    align-self: center;
    box-sizing: border-box;
}

.hl-ai-search__form {
    position: relative;
    margin: 0;
}

.hl-ai-search__form .search-row {
    z-index: 42;
    --searchbar-input-font-size: 16px;
    --searchbar-input-y: 0px;
    box-sizing: border-box;
    height: 46px;
    margin: 0;
    padding: 0 5px 0 14px;
    align-items: center;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}

.hl-ai-search__form .search-row:hover,
.hl-ai-search__form .search-row:focus-within {
    border-color: rgba(223, 225, 229, 0);
    box-shadow: 0 1px 8px rgba(32, 33, 36, 0.4);
}

.hl-ai-search__form .search-row .search-field {
    height: 100%;
}

.hl-ai-search__form .search-row .search-field input {
    font-size: 16px;
}

.hl-ai-search__form .search-row .search-button.search-button--icon {
    align-self: center;
    width: 36px;
    height: 36px;
}

/* housinglistings.css positions every .search-button absolutely for the tab
   forms; the shared bar's button belongs in the row's flex flow. */
.hl-ai-search .search-row .search-button {
    position: static;
    right: auto;
    bottom: auto;
}

/*
 * Google-style open state: the dropdown is one white card that starts at the
 * top of the bar (behind it) and grows downward, so the bar and the list read
 * as a single surface. The bar goes transparent while it is open.
 */
.hl-ai-search__dropdown {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 41;
    box-sizing: border-box;
    padding: 46px 0 14px;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 4px 6px rgba(32, 33, 36, 0.28);
}

.hl-ai-search__form.has-suggestions .search-row,
.hl-ai-search__form.has-suggestions .search-row:hover,
.hl-ai-search__form.has-suggestions .search-row:focus-within {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.hl-ai-search .mus-suggest__list {
    max-height: min(56vh, 420px);
    padding-top: 6px;
}

/* Rows: full width, grey band on hover, blue accent on the keyboard row. */
.hl-ai-search .mus-suggest__row {
    position: relative;
    box-sizing: border-box;
    width: calc(100% - 12px);
    min-height: 44px;
    margin: 0 12px 0 0;
    padding: 6px 20px 6px 16px;
    gap: 14px;
    border-radius: 0 999px 999px 0;
    color: #202124;
}

.hl-ai-search .mus-suggest__row:hover {
    background: #f1f3f4;
}

.hl-ai-search .mus-suggest__row.is-active {
    background: #e8eaed;
}

.hl-ai-search .mus-suggest__row.is-active::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: #1a73e8;
}

.hl-ai-search .mus-suggest__gutter {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    color: #70757a;
    font-size: 16px;
}

.hl-ai-search .mus-suggest__label {
    color: #202124;
    font-size: 15px;
}

.hl-ai-search .mus-suggest__meta {
    color: #70757a;
    font-size: 12.5px;
}

.hl-ai-search .mus-suggest__trail {
    color: #202124;
    font-size: 14px;
    font-weight: 600;
}

.hl-ai-search .mus-suggest__trail--count {
    color: #70757a;
}

/* A group change gets a thin inset rule instead of a full-width border. */
.hl-ai-search .mus-suggest__row--divider {
    margin-top: 9px;
    padding-top: 6px;
    border-top: 0;
    border-radius: 0 999px 999px 0;
}

.hl-ai-search .mus-suggest__row--divider::after {
    content: "";
    position: absolute;
    top: -5px;
    left: 20px;
    right: 8px;
    height: 1px;
    background: #e8eaed;
}

/* "See all N results" reads as an action. */
.hl-ai-search .mus-suggest__row--all .mus-suggest__label {
    color: #1a0dab;
    font-size: 14px;
    font-weight: 500;
}

.hl-ai-search__dropdown[hidden] {
    display: none;
}

.hl-ai-search__message {
    margin: 0;
    padding: 8px 20px;
    color: #70757a;
    font-size: 13px;
}

.hl-ai-search__message[hidden] {
    display: none;
}

.hl-ai-search__caption {
    margin: 6px 0 2px;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 600px) {
    .hl-mode-toggle__option {
        padding: 7px 14px;
        font-size: 14px;
    }

}

/* Give the query most of the bar; the short location (UCSB) sits near the button. */
.hl-ai-search__form .search-row .search-field:first-child {
    flex: 1 1 auto;
}

/* Compact location slot hugging the button, so the text field dominates. */
.hl-ai-search__form .search-row .search-field.location {
    flex: 0 0 104px;
}

.hl-ai-search__form .search-row .search-field.location input {
    padding-left: 8px;
}

.hl-ai-search__form .search-row .search-field.location .icon {
    margin: 0 -2px 0 12px;
}

.hl-ai-search__form .search-row .search-button.search-button--icon {
    margin-left: 2px;
}

/* Calm bar states: no blue divider or blue button just because the bar has focus. */
.hl-ai-search .search-row:focus-within .search-field.location::before,
.hl-ai-search .search-row .search-field.location::before {
    background: #dadce0;
}

.hl-ai-search .search-row .search-button.search-button--icon,
.hl-ai-search .search-row:focus-within .search-button.search-button--icon {
    background-color: #f1f3f4;
    color: #3c4043;
}

.hl-ai-search .search-row .search-button.search-button--icon:hover,
.hl-ai-search .search-row .search-button.search-button--icon:focus-visible,
.hl-ai-search .search-row:focus-within .search-button.search-button--icon:hover {
    background-color: #005698;
    color: #ffffff;
}

.hl-ai-search .search-row .search-field__clear {
    width: 24px;
    height: 24px;
    color: #70757a;
    font-size: 14px;
}

/* Tighter left edge: the sparkle icon sits closer to the bar's rounded end. */
.hl-ai-search__form .search-row .search-field:first-child .icon {
    margin-left: 2px;
}
