/* ==========================================================================
   NimbleCommandPallet — VS Code-style command palette
   ==========================================================================
   nimble.commandpallet.css

   Self-contained styles for the NimbleCommandPallet jQuery plugin.
   Dark-themed overlay palette with keyboard navigation,
   breadcrumb trail, prefix badges, and match highlighting.
   ========================================================================== */

/* ── Overlay / Backdrop ───────────────────────────────────────────────── */
.ncp-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(0, 0, 0, .15);
}

/* ── Main Palette Container ───────────────────────────────────────────── */
.ncp-palette {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    width: 600px;
    max-width: 92vw;
    background: #1e1e2e;
    border: 1px solid #3b3b52;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .40);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #cdd6f4;
    overflow: hidden;
}

/* ── Header (input row + breadcrumb) ──────────────────────────────────── */
.ncp-header {
    padding: 0;
    border-bottom: none;
}

.ncp-palette.ncp-has-results .ncp-header {
    border-bottom: 1px solid #3b3b52;
}

.ncp-breadcrumb {
    display: none;           /* shown via JS when stack > 0 */
    padding: 6px 14px 2px;
    font-size: 0.78rem;
    color: #7f849c;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

    .ncp-breadcrumb .ncp-crumb {
        cursor: pointer;
        color: #89b4fa;
        padding: 1px 4px;
        border-radius: 3px;
    }

        .ncp-breadcrumb .ncp-crumb:hover {
            background: #313244;
            color: #b4befe;
        }

        .ncp-breadcrumb .ncp-crumb.ncp-crumb-current {
            cursor: default;
            color: #cdd6f4;
            font-weight: 600;
        }

            .ncp-breadcrumb .ncp-crumb.ncp-crumb-current:hover {
                background: transparent;
            }

    .ncp-breadcrumb .ncp-crumb-sep {
        color: #585b70;
        font-size: 0.65rem;
    }

.ncp-input-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    gap: 8px;
}

.ncp-prefix-badge {
    display: inline-block;
    background: #89b4fa;
    color: #1e1e2e;
    font-weight: 700;
    font-size: 0.85rem;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 4px;
    flex-shrink: 0;
}

.ncp-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    color: #6c7086;
    font-size: 1rem;
    padding: 4px 6px;
    line-height: 1;
    border-radius: 4px;
    transition: color 120ms ease, background 120ms ease;
}

    .ncp-close:hover {
        color: #cdd6f4;
        background: #45475a;
    }

.ncp-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #cdd6f4;
    font-size: 1rem;
    font-family: inherit;
    padding: 0;
}

    .ncp-input::placeholder {
        color: #6c7086;
    }

/* ── Body / List ──────────────────────────────────────────────────────── */
.ncp-body {
    max-height: 360px;
    overflow-y: auto;
    padding: 4px 0;
    display: none;
}

.ncp-palette.ncp-has-results .ncp-body {
    display: block;
}

    /* Scrollbar (Webkit) */
    .ncp-body::-webkit-scrollbar {
        width: 6px;
    }

    .ncp-body::-webkit-scrollbar-track {
        background: transparent;
    }

    .ncp-body::-webkit-scrollbar-thumb {
        background: #45475a;
        border-radius: 3px;
    }

.ncp-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ncp-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: background 80ms ease;
}

    .ncp-item:hover,
    .ncp-item.ncp-active {
        background: #313244;
        border-left-color: #89b4fa;
    }

.ncp-item-icon {
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.95rem;
    color: #89b4fa;
}

.ncp-item-label {
    flex: 1;
    font-weight: 500;
    color: #cdd6f4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ncp-item-desc {
    flex: 2;
    color: #7f849c;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ncp-item-shortcut {
    flex-shrink: 0;
    margin-left: auto;
}

    .ncp-item-shortcut kbd {
        background: #45475a;
        color: #a6adc8;
        padding: 2px 6px;
        border-radius: 3px;
        font-size: 0.75rem;
        font-family: inherit;
        border: 1px solid #585b70;
    }

.ncp-item-arrow {
    flex-shrink: 0;
    color: #585b70;
    font-size: 0.7rem;
}

    .ncp-item:hover .ncp-item-arrow,
    .ncp-item.ncp-active .ncp-item-arrow {
        color: #89b4fa;
    }

/* ── Empty state ──────────────────────────────────────────────────────── */
.ncp-empty {
    display: none;
    text-align: center;
    padding: 24px 14px;
    color: #6c7086;
    font-size: 0.9rem;
}

/* ── Match highlight ──────────────────────────────────────────────────── */
.ncp-item mark {
    background: rgba(250, 179, 135, .30);
    color: #fab387;
    border-radius: 2px;
    padding: 0 1px;
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.ncp-footer {
    border-top: 1px solid #3b3b52;
    padding: 6px 14px;
    text-align: center;
    display: none;
}

.ncp-palette.ncp-has-results .ncp-footer {
    display: block;
}

.ncp-hint {
    font-size: 0.75rem;
    color: #6c7086;
}

    .ncp-hint kbd {
        background: #313244;
        color: #a6adc8;
        padding: 1px 5px;
        border-radius: 3px;
        font-size: 0.7rem;
        border: 1px solid #45475a;
    }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .ncp-palette {
        width: 96vw;
        top: 0;
    }

    .ncp-item-desc {
        display: none;
    }

    .ncp-item-shortcut {
        display: none;
    }
}
