/* ──────────────────────────────────────────────
 * Spotlight — global command palette modal.
 *
 * Mirrors the visual chrome of the knowledge-base
 * search modal (css/modules/knowledge-base/kb-shell.css)
 * so the two surfaces feel like one product. Classes
 * are namespaced with `dmu-spotlight` because this
 * modal ships everywhere the portal does, not just
 * inside the KB shell.
 * ────────────────────────────────────────────── */

.dmu-spotlight {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: none;
}
.dmu-spotlight.is-open { display: block; }

.dmu-spotlight-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 20, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.dmu-spotlight-dialog {
    position: relative;
    width: min(720px, calc(100% - 2rem));
    max-height: calc(100vh - 6rem);
    margin: 4rem auto 0;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dmu-spotlight-input-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dmu-spotlight-input-icon {
    width: 18px !important;
    height: 18px !important;
    color: rgba(0, 0, 0, 0.45);
    flex-shrink: 0;
}

.dmu-spotlight-input {
    flex: 1 1 auto;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 1rem;
    color: var(--body);
    padding: 0.25rem 0;
}
.dmu-spotlight-input::placeholder { color: rgba(0, 0, 0, 0.4); }

.dmu-spotlight-esc {
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.03);
    color: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    transition: background 0.15s ease;
}
.dmu-spotlight-esc:hover { background: rgba(0, 0, 0, 0.06); }

.dmu-spotlight-results {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.4rem 0;
    max-height: 60vh;
}

.dmu-spotlight-empty {
    padding: 1.5rem 1.25rem;
    text-align: center;
    color: var(--alternate);
    font-size: 0.9rem;
}

/* Category header inside the results list. */
.dmu-spotlight-category {
    padding: 0.6rem 1rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--alternate);
}
.dmu-spotlight-category:not(:first-child) {
    margin-top: 0.35rem;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    padding-top: 0.7rem;
}

/* One row in the results list. Uses a flex layout so the
   icon, text block and chevron align cleanly regardless of
   description length. */
.dmu-spotlight-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0.5rem;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--body);
    transition: background 0.1s ease;
    cursor: pointer;
}
.dmu-spotlight-result:hover,
.dmu-spotlight-result.is-active {
    background: rgba(var(--primary-rgb), 0.06);
    color: var(--body);
}

.dmu-spotlight-result-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.dmu-spotlight-result-icon i {
    width: 16px !important;
    height: 16px !important;
}

.dmu-spotlight-result-text {
    flex: 1 1 auto;
    min-width: 0;
}

.dmu-spotlight-result-title {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--body);
    line-height: 1.3;
}
.dmu-spotlight-result.is-active .dmu-spotlight-result-title {
    color: var(--primary);
}

.dmu-spotlight-result-desc {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.78rem;
    color: var(--alternate);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dmu-spotlight-result-enter {
    flex-shrink: 0;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--alternate);
    opacity: 0;
    transition: opacity 0.1s ease;
}
.dmu-spotlight-result.is-active .dmu-spotlight-result-enter {
    opacity: 1;
}

.dmu-spotlight-hl {
    background: transparent;
    color: inherit;
    font-weight: 700;
    padding: 0;
}

.dmu-spotlight-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.015);
    color: var(--alternate);
    font-size: 0.75rem;
}

.dmu-spotlight-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.dmu-spotlight-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 0.3rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: #ffffff;
    color: rgba(0, 0, 0, 0.65);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 600;
}

body.dmu-spotlight-open {
    overflow: hidden;
}

/* Dark mode — same swap pattern as the KB modal. */
[data-bs-theme="dark"] .dmu-spotlight-dialog,
html[data-color^="dark-"] .dmu-spotlight-dialog {
    background: #1c1c22;
    border-color: rgba(255, 255, 255, 0.08);
}
[data-bs-theme="dark"] .dmu-spotlight-input-row,
html[data-color^="dark-"] .dmu-spotlight-input-row {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}
[data-bs-theme="dark"] .dmu-spotlight-category:not(:first-child),
html[data-color^="dark-"] .dmu-spotlight-category:not(:first-child) {
    border-top-color: rgba(255, 255, 255, 0.05);
}
[data-bs-theme="dark"] .dmu-spotlight-footer,
html[data-color^="dark-"] .dmu-spotlight-footer {
    border-top-color: rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}
[data-bs-theme="dark"] .dmu-spotlight-kbd,
html[data-color^="dark-"] .dmu-spotlight-kbd {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.78);
}
[data-bs-theme="dark"] .dmu-spotlight-esc,
html[data-color^="dark-"] .dmu-spotlight-esc {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
}
