/* help-center-panel.css
 *
 * The typeahead panel under the help center's search field: groups, option rows and the all-results row.
 * Split from help-center-search.css along the same line as the JavaScript (help-center-panel.js builds
 * this markup at runtime, which is also why none of it can be a Tailwind utility — the content scan
 * never sees these class names).
 */

/* ---------- suggestion panel ---------- */

.hc-panel {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 10px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    max-height: min(60vh, 480px);
    overflow: hidden;
    border: 1px solid #e4e4e7;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 48px -20px rgb(24 24 27 / 30%), 0 2px 8px rgb(24 24 27 / 6%);
    text-align: start;
    animation: hc-panel-in 0.16s ease-out both;
}

.hc-panel[hidden] { display: none; }

/* The panel is the frame (border, shadow, the overlay bar of help-center.css); the list inside it is what
   scrolls, so the bar stays put while the suggestions move under it. */
.hc-panel-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
}

@keyframes hc-panel-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.99); }
    to { opacity: 1; transform: none; }
}

.hc-group {
    padding: 10px 12px 6px;
    color: #a1a1aa;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hc-option {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 10px;
    color: inherit;
    font-weight: 400;
    text-decoration: none;
    transition: background-color 0.12s ease;
}

/* Pointer hover and keyboard cursor land on the same visual state. */
.hc-option:hover,
.hc-option[data-hc-active="true"] {
    background: #f4f4f5;
}

.hc-option-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-top: 1px;
    border-radius: 9px;
    /* The tile carries the provider's colour, the glyph does not: an accent-on-tint glyph at 16px is two
       shades of one hue and reads as disabled. Ink on the soft tint is the pairing the rows next to it use. */
    background: var(--lw-widget-tint, #eef2ff);
    color: #18181b;
}

.hc-option-icon svg { width: 16px; height: 16px; }

.hc-option-body { min-width: 0; flex: 1 1 auto; }

.hc-option-title {
    display: block;
    overflow: hidden;
    color: #18181b;
    font-size: 14.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hc-option-meta,
.hc-option-snippet {
    display: block;
    margin-top: 2px;
    color: #71717a;
    font-size: 12.5px;
    line-height: 1.45;
}

.hc-option-snippet {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.hc-option-count {
    flex: none;
    align-self: center;
    color: #a1a1aa;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* The last row of the panel: hands the query to the full results page. */
.hc-option-all {
    justify-content: center;
    margin-top: 4px;
    border-top: 1px solid #f4f4f5;
    border-radius: 0 0 10px 10px;
    color: var(--lw-widget-on-light, #4f46e5);
    font-size: 13px;
    font-weight: 600;
}

.hc-empty {
    padding: 22px 12px;
    color: #71717a;
    font-size: 14px;
    text-align: center;
}

/* ---------- dark scheme ---------- */

.dark .hc-panel {
    border-color: #3f3f46;
    background: #18181b;
    box-shadow: 0 24px 48px -20px rgb(0 0 0 / 60%), 0 2px 8px rgb(0 0 0 / 40%);
}

.dark .hc-group { color: #71717a; }

.dark .hc-option:hover,
.dark .hc-option[data-hc-active="true"] {
    background: #27272a;
}

.dark .hc-option-icon {
    background: var(--lw-widget-tint-dark, #312e81);
    color: #fafafa;
}

.dark .hc-option-title { color: #fafafa; }

.dark .hc-option-meta,
.dark .hc-option-snippet { color: #a1a1aa; }

.dark .hc-option-count { color: #71717a; }

.dark .hc-option-all {
    border-top-color: #27272a;
    color: var(--lw-widget-on-dark, #a5b4fc);
}

.dark .hc-empty { color: #a1a1aa; }

@media (prefers-reduced-motion: reduce) {
    .hc-panel { animation: none; }
}
