/* ============================================================================
   search-suggest - the keyword box's suggestion dropdown (js/search-suggest.js),
   shared by the old search bar and the Townsquare search bar. The wrap holds
   the input and the list; the list drops below it.

   Colours: --ss-accent (the portal's own, var(--site_color_g)) and --ss-ink;
   a theme may set both on the list (the Townsquare does, in townsquare.css).
   ============================================================================ */
.search-autocomplete-wrap {
    position: relative;
}
.search-autocomplete-list {
    --ss-accent: var(--site_color_g, #3C65F5);
    --ss-ink: var(--site_font_color_g, #1f2f56);
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 40;
    padding: 6px;
    border: 1px solid rgba(8, 15, 84, .08);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 48px -18px rgba(8, 15, 84, .35), 0 4px 12px -6px rgba(8, 15, 84, .12);
    max-height: 360px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(8, 15, 84, .2) transparent;
    text-align: left;
    color: var(--ss-ink);
    animation: ssDrop .14s ease-out;
}
.search-autocomplete-list.is-visible {
    display: block;
}
@keyframes ssDrop {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

/* loading: a thin moving bar over the rows already showing */
.search-autocomplete-list.is-loading::before {
    content: "";
    position: sticky;
    top: -6px;
    display: block;
    height: 3px;
    margin: -6px -6px 3px;
    border-radius: 16px 16px 0 0;
    background: linear-gradient(90deg, transparent, var(--ss-accent), transparent) 0 0 / 40% 100% no-repeat;
    animation: ssBar 1s linear infinite;
}
@keyframes ssBar {
    from { background-position: -40% 0; }
    to { background-position: 140% 0; }
}
/* loading with nothing to show yet: "Searching for ..." and a spinner */
.search-autocomplete-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    font-size: 14px;
    color: #6b7280;
}
.search-autocomplete-loading b {
    color: var(--ss-ink);
}
.search-autocomplete-spin {
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2.5px solid rgba(8, 15, 84, .12);
    border-top-color: var(--ss-accent);
    animation: ssSpin .7s linear infinite;
}
@keyframes ssSpin {
    to { transform: rotate(360deg); }
}

.search-autocomplete-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px 6px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
}
.search-autocomplete-clear {
    background: none;
    border: 0;
    padding: 2px 6px;
    border-radius: 6px;
    color: var(--ss-accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.search-autocomplete-clear:hover {
    background: rgba(8, 15, 84, .05);
}

.search-autocomplete-item {
    width: 100%;
    margin: 0 !important; /* a portal theme's button margins must not space the rows */
    border: 0;
    border-radius: 10px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    text-align: left;
    cursor: pointer;
    color: var(--ss-ink);
    font-size: 15px;
    line-height: 1.4;
    transition: background-color .12s;
}
.search-autocomplete-item:hover,
.search-autocomplete-item.is-active {
    background: rgba(8, 15, 84, .05);
}
.search-autocomplete-item.is-active {
    box-shadow: inset 3px 0 0 var(--ss-accent);
}
.search-autocomplete-item mark {
    background: none;
    padding: 0;
    color: var(--ss-accent);
    font-weight: 700;
}
.search-autocomplete-item .search-autocomplete-main {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.search-autocomplete-item .search-autocomplete-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-autocomplete-item.is-typed-keyword .search-autocomplete-prefix {
    flex: none;
    color: #6b7280;
    font-size: 14px;
    margin-right: -4px;
}
.search-autocomplete-item.is-typed-keyword .search-autocomplete-label {
    font-weight: 700;
}

/* the row's icon, drawn in the accent on a soft tile: one shape per kind */
.search-autocomplete-ico {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(8, 15, 84, .05);
    position: relative;
}
.search-autocomplete-ico::before {
    content: "";
    position: absolute;
    inset: 7px;
    background: #6b7280;
    -webkit-mask: var(--ss-ico) center / contain no-repeat;
    mask: var(--ss-ico) center / contain no-repeat;
}
.search-autocomplete-item {
    --ss-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
}
.search-autocomplete-item[data-kind="recent"] {
    --ss-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}
.search-autocomplete-item[data-kind="business"] {
    --ss-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M4 21V8l8-5 8 5v13z'/%3E%3Cpath d='M9 21v-6h6v6'/%3E%3C/svg%3E");
}
.search-autocomplete-item[data-kind="content"],
.search-autocomplete-item[data-kind="suggestion"] {
    --ss-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M6 3h9l4 4v14H6z'/%3E%3Cpath d='M9 12h7M9 16h5'/%3E%3C/svg%3E");
}
.search-autocomplete-item[data-kind="did_you_mean"] {
    --ss-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 3v3M12 18v3M3 12h3M18 12h3M6 6l2 2M16 16l2 2M6 18l2-2M16 8l2-2'/%3E%3C/svg%3E");
}
.search-autocomplete-item.is-typed-keyword .search-autocomplete-ico,
.search-autocomplete-item:hover .search-autocomplete-ico,
.search-autocomplete-item.is-active .search-autocomplete-ico {
    background: color-mix(in srgb, var(--ss-accent) 12%, #fff);
}
.search-autocomplete-item.is-typed-keyword .search-autocomplete-ico::before,
.search-autocomplete-item:hover .search-autocomplete-ico::before,
.search-autocomplete-item.is-active .search-autocomplete-ico::before {
    background: var(--ss-accent);
}

/* the kind, on the right: a soft pill */
.search-autocomplete-type {
    flex: none;
    padding: 2px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ss-accent) 10%, #fff);
    color: var(--ss-accent);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
.search-autocomplete-dym {
    flex: none;
    padding: 2px 10px;
    border-radius: 999px;
    background: #fff4e5;
    color: #b45309;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
