/* AI home search — Google-style grouped autocomplete.
   Uses the site brand vars: --yprimary (#4b47ee), --ysecondary (#ffb624). */

.ai-search {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    text-align: left;
    z-index: 50;
}

.ai-search__bar {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e7e7ee;
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(31, 36, 48, .10);
    padding: 6px 6px 6px 18px;
    transition: box-shadow .18s ease, border-color .18s ease;
}
.ai-search.is-open .ai-search__bar,
.ai-search__bar:focus-within {
    border-color: var(--yprimary);
    box-shadow: 0 12px 36px rgba(75,71,238, .18);
}

.ai-search__spark {
    color: var(--yprimary);
    font-size: 18px;
    margin-right: 10px;
    flex: 0 0 auto;
}

.ai-search__input {
    flex: 1 1 auto;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 17px;
    line-height: 1.4;
    color: #1f2430;
    padding: 12px 6px;
    min-width: 0;
}
.ai-search__input::placeholder { color: #9aa0ab; }

.ai-search__btn {
    flex: 0 0 auto;
    border: 0;
    background: var(--yprimary);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 26px;
    border-radius: 999px;
    cursor: pointer;
    transition: filter .15s ease, transform .05s ease;
}
.ai-search__btn:hover { filter: brightness(1.08); }
.ai-search__btn:active { transform: translateY(1px); }

/* dropdown panel */
.ai-search__panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #eceCF3;
    border-radius: 18px;
    box-shadow: 0 20px 48px rgba(31, 36, 48, .16);
    padding: 8px;
    display: none;
    max-height: 70vh;
    overflow-y: auto;
}
.ai-search.is-open .ai-search__panel { display: block; }

.ai-search__group-label {
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #9aa0ab;
    font-weight: 700;
    padding: 12px 14px 6px;
}

.ai-search__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    color: #1f2430;
    text-decoration: none;
}
.ai-search__item:hover,
.ai-search__item.is-active {
    background: #f6eefc;   /* pale purple */
}

.ai-search__icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #f2f2f7;
    color: var(--yprimary);
    font-size: 14px;
}
.ai-search__item.is-active .ai-search__icon { background: #fff; }

.ai-search__text { flex: 1 1 auto; min-width: 0; }
.ai-search__title {
    font-size: 15px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ai-search__title b { color: #1f2430; font-weight: 700; }
.ai-search__sub {
    font-size: 12.5px;
    color: #8a909b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-search__meta {
    flex: 0 0 auto;
    font-size: 12px;
    color: #8a909b;
}
.ai-search__rating {
    flex: 0 0 auto;
    font-size: 12.5px;
    font-weight: 700;
    color: #b26a00;
    background: #fff6e5;
    border-radius: 999px;
    padding: 2px 9px;
}
.ai-search__rating i { color: var(--ysecondary); margin-right: 3px; }

.ai-search__hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    margin-top: 4px;
    border-top: 1px solid #f0f0f5;
    font-size: 12px;
    color: #9aa0ab;
}
.ai-search__kbd {
    border: 1px solid #e2e2ea;
    border-bottom-width: 2px;
    border-radius: 6px;
    padding: 1px 7px;
    font-size: 11px;
    color: #6b7280;
    background: #fbfbfd;
}

.ai-search__empty {
    padding: 18px 16px;
    color: #9aa0ab;
    font-size: 14px;
    text-align: center;
}

/* quick chips under the bar */
.ai-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 16px auto 0;
    max-width: 720px;
}
.ai-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #e7e7ee;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13.5px;
    color: #3a3f4b;
    text-decoration: none;
    transition: border-color .15s, color .15s, box-shadow .15s;
}
.ai-chip:hover {
    border-color: var(--yprimary);
    color: var(--yprimary);
    box-shadow: 0 4px 12px rgba(75,71,238, .10);
}
.ai-chip i { color: var(--yprimary); font-size: 12px; }

@media (max-width: 575px) {
    .ai-search__btn { padding: 12px 18px; }
    .ai-search__input { font-size: 16px; }
}

.ai-chip__count {
    font-size: 11px;
    font-weight: 700;
    color: var(--yprimary);
    background: #f2e9fb;
    border-radius: 999px;
    padding: 1px 7px;
    margin-left: 2px;
}
