/* Global search modal (⌘K / Ctrl+K) */

/* ── Dialog positioning ─────────────────────────────────────────────── */
.portal-search-dialog {
    max-width: 600px;
    margin: 80px auto 0;  /* drop it below the topbar, not dead-center */
}

/* ── Modal shell ─────────────────────────────────────────────────────── */
.portal-search-content {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #1e2328;
    color: #dee2e6;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

[data-portal-theme="light"] .portal-search-content {
    background: #fff;
    color: #212529;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(15, 23, 42, 0.06);
}

/* ── Input row ──────────────────────────────────────────────────────── */
.portal-search-input-wrap {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

[data-portal-theme="light"] .portal-search-input-wrap {
    border-bottom-color: rgba(15, 23, 42, 0.09);
}

.portal-search-icon {
    color: rgba(255, 255, 255, 0.4);
    font-size: 1rem;
    flex-shrink: 0;
    margin-right: .65rem;
}

[data-portal-theme="light"] .portal-search-icon {
    color: rgba(15, 23, 42, 0.35);
}

.portal-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: inherit;
    font-size: 1rem;
    padding: .85rem 0;
    caret-color: #fff;
}

.portal-search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

[data-portal-theme="light"] .portal-search-input::placeholder {
    color: rgba(15, 23, 42, 0.3);
}

[data-portal-theme="light"] .portal-search-input {
    caret-color: #212529;
}

.portal-search-esc-hint {
    font-size: .72rem;
    padding: .2rem .4rem;
    color: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    cursor: default;
}

[data-portal-theme="light"] .portal-search-esc-hint {
    color: rgba(15, 23, 42, 0.45);
    border-color: rgba(15, 23, 42, 0.2);
    background: rgba(15, 23, 42, 0.04);
}

/* ── Results list ────────────────────────────────────────────────────── */
.portal-search-results {
    max-height: 380px;
    overflow-y: auto;
    padding: .5rem 0;
}

/* Category heading */
.portal-search-category {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, 0.35);
    padding: .55rem 1rem .2rem;
}

[data-portal-theme="light"] .portal-search-category {
    color: rgba(15, 23, 42, 0.35);
}

/* Result row */
.portal-search-result-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 1rem;
    cursor: pointer;
    border-radius: 0;
    transition: background-color 0.1s;
}

.portal-search-result-item:hover,
.portal-search-result-item.portal-search-result-active {
    background-color: rgba(0, 218, 216, 0.1);  /* teal accent */
}

[data-portal-theme="light"] .portal-search-result-item:hover,
[data-portal-theme="light"] .portal-search-result-item.portal-search-result-active {
    background-color: rgba(10, 124, 122, 0.08);
}

.portal-search-result-icon {
    font-size: .85rem;
    color: rgba(255, 255, 255, 0.4);
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
}

[data-portal-theme="light"] .portal-search-result-icon {
    color: rgba(15, 23, 42, 0.4);
}

.portal-search-result-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.portal-search-result-label {
    font-size: .9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-search-result-role {
    font-size: .75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-left: .4rem;
    font-weight: 400;
}

[data-portal-theme="light"] .portal-search-result-role {
    color: rgba(15, 23, 42, 0.4);
}

.portal-search-result-sub {
    font-size: .78rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-portal-theme="light"] .portal-search-result-sub {
    color: rgba(15, 23, 42, 0.45);
}

/* Empty / loading states */
.portal-search-empty,
.portal-search-loading {
    padding: 1.2rem 1rem;
    font-size: .875rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
}

[data-portal-theme="light"] .portal-search-empty,
[data-portal-theme="light"] .portal-search-loading {
    color: rgba(15, 23, 42, 0.4);
}

/* ── Footer hint bar ─────────────────────────────────────────────────── */
.portal-search-footer {
    display: flex;
    gap: 1.25rem;
    padding: .5rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: .72rem;
    color: rgba(255, 255, 255, 0.35);
}

[data-portal-theme="light"] .portal-search-footer {
    border-top-color: rgba(15, 23, 42, 0.07);
    color: rgba(15, 23, 42, 0.4);
}

.portal-search-footer kbd {
    font-size: .68rem;
    padding: .1rem .35rem;
    color: inherit;
    border: 1px solid currentColor;
    border-radius: 3px;
    background: transparent;
    font-family: inherit;
}

/* ── Responsive: stack dialog lower on mobile ─────────────────────────── */
@media (max-width: 575.98px) {
    .portal-search-dialog {
        margin: 20px auto 0;
        max-width: calc(100vw - 2rem);
    }
}
