/* ===== CMD+K Spotlight Search ===== */

/* --- Overlay --- */
.spotlight-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: min(16vh, 140px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s cubic-bezier(.4,0,.2,1), visibility .2s cubic-bezier(.4,0,.2,1);
}
.spotlight-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
body.spotlight-open { overflow: hidden; }

/* --- Box --- */
.spotlight-box {
    width: 100%;
    max-width: 580px;
    margin: 0 16px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 18px;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.04),
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 24px 64px -12px rgba(0, 0, 0, 0.14);
    overflow: hidden;
    transform: translateY(-16px) scale(0.96);
    transition: transform .25s cubic-bezier(.22, 1, .36, 1), opacity .2s ease;
    opacity: 0;
}
.spotlight-overlay.open .spotlight-box {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* --- Input row --- */
.spotlight-input-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.spotlight-input-row .spotlight-icon {
    font-size: 18px;
    color: #0ea5e9;
    flex-shrink: 0;
    opacity: 0.85;
}
.spotlight-input-row input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: #0f172a;
    caret-color: #0ea5e9;
    min-width: 0;
}
.spotlight-input-row input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Kbd badges */
.spotlight-kbd-hint {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

/* Close button */
.spotlight-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all .12s ease;
}
.spotlight-close-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}
.theme-dark .spotlight-close-btn {
    background: rgba(255, 255, 255, 0.06);
    color: #64748b;
}
.theme-dark .spotlight-close-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}
.spotlight-kbd-hint kbd,
.spotlight-footer kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    line-height: 1;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

/* --- Results --- */
.spotlight-results {
    max-height: min(380px, 50vh);
    overflow-y: auto;
    padding: 6px 8px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.08) transparent;
}
.spotlight-results::-webkit-scrollbar { width: 5px; }
.spotlight-results::-webkit-scrollbar-track { background: transparent; }
.spotlight-results::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.08); border-radius: 10px; }
.spotlight-results::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.14); }

/* Group title */
.spotlight-group-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    padding: 12px 12px 5px;
    user-select: none;
}
.spotlight-group-title:not(:first-child) {
    margin-top: 4px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    padding-top: 12px;
}

/* Item */
.spotlight-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: #1e293b;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.005em;
    cursor: pointer;
    transition: background .12s ease, box-shadow .12s ease;
}
.spotlight-item:hover {
    background: rgba(0, 0, 0, 0.04);
}
.spotlight-item.active {
    background: #0ea5e9;
    color: #fff;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.30);
}

/* Item icon */
.spotlight-item i {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(14, 165, 233, 0.08);
    color: #0ea5e9;
    font-size: 14px;
    flex-shrink: 0;
    transition: background .12s ease, color .12s ease;
}
.spotlight-item:hover i {
    background: rgba(14, 165, 233, 0.13);
}
.spotlight-item.active i {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Item label & number hint */
.spotlight-item-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spotlight-item .spotlight-item-kbd {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.04);
    transition: background .12s ease, color .12s ease;
}
.spotlight-item.active .spotlight-item-kbd {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

/* Empty state */
.spotlight-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
}
.spotlight-empty i {
    font-size: 28px;
    margin-bottom: 10px;
    display: block;
    opacity: 0.4;
}

/* --- Footer --- */
.spotlight-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    user-select: none;
}
.spotlight-footer span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ===== Dark Theme ===== */
.theme-dark .spotlight-overlay {
    background: rgba(0, 0, 0, 0.65);
}
.theme-dark .spotlight-box {
    background: rgba(10, 18, 40, 0.94);
    border-color: rgba(56, 189, 248, 0.10);
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.06),
        0 8px 32px rgba(0, 0, 0, 0.45),
        0 24px 64px -12px rgba(0, 0, 0, 0.55);
}
.theme-dark .spotlight-input-row {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}
.theme-dark .spotlight-input-row .spotlight-icon {
    color: #38bdf8;
}
.theme-dark .spotlight-input-row input {
    color: #f1f5f9;
    caret-color: #38bdf8;
}
.theme-dark .spotlight-input-row input::placeholder {
    color: #64748b;
}
.theme-dark .spotlight-kbd-hint kbd,
.theme-dark .spotlight-footer kbd {
    background: rgba(56, 189, 248, 0.07);
    border-color: rgba(56, 189, 248, 0.12);
    color: #64748b;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}
.theme-dark .spotlight-results {
    scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}
.theme-dark .spotlight-results::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.06); }
.theme-dark .spotlight-results::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.1); }
.theme-dark .spotlight-group-title {
    color: #64748b;
}
.theme-dark .spotlight-group-title:not(:first-child) {
    border-top-color: rgba(56, 189, 248, 0.07);
}
.theme-dark .spotlight-item {
    color: #e2e8f0;
}
.theme-dark .spotlight-item:hover {
    background: rgba(14, 165, 233, 0.08);
}
.theme-dark .spotlight-item.active {
    background: linear-gradient(135deg, #0369a1, #0ea5e9);
    color: #fff;
    box-shadow: 0 2px 12px rgba(14, 165, 233, 0.35);
}
.theme-dark .spotlight-item i {
    background: rgba(56, 189, 248, 0.10);
    color: #38bdf8;
}
.theme-dark .spotlight-item:hover i {
    background: rgba(56, 189, 248, 0.16);
}
.theme-dark .spotlight-item.active i {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}
.theme-dark .spotlight-item .spotlight-item-kbd {
    color: #64748b;
    background: rgba(56, 189, 248, 0.06);
}
.theme-dark .spotlight-item.active .spotlight-item-kbd {
    background: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.8);
}
.theme-dark .spotlight-empty {
    color: #64748b;
}
.theme-dark .spotlight-footer {
    border-top-color: rgba(56, 189, 248, 0.08);
    color: #64748b;
}

/* ===== Mobile v3.0 ===== */
