/* ================================================
   Pollux — Spotlight / Command Palette (Universal)
   ================================================ */

.spotlight-overlay {
    position: fixed;
    inset: 0;
    z-index: 10002;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.spotlight-overlay.hidden { display: none; }

.spotlight-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: spotlightFadeIn 150ms ease;
}

@keyframes spotlightFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.spotlight-dialog {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 560px;
    max-height: 520px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.04);
    animation: spotlightSlideIn 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes spotlightSlideIn {
    from { opacity: 0; transform: translateY(-12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Input ---- */

.spotlight-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.spotlight-search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.spotlight-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    font: 400 15px/1.5 var(--sans);
    outline: none;
    padding: 0;
}

.spotlight-input::placeholder {
    color: var(--text-muted);
}

.spotlight-kbd {
    font: 500 9px/1 var(--mono);
    color: var(--text-muted);
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 6px;
    flex-shrink: 0;
}

/* ---- Results ---- */

.spotlight-results {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.spotlight-group-label {
    font: 600 9px/1 var(--mono);
    color: var(--text-muted);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 12px 16px 6px;
}

.spotlight-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 80ms;
    color: var(--text-dim);
}

.spotlight-result-item:hover,
.spotlight-result-item.active {
    background: var(--bg-hover);
    color: var(--text);
}

.spotlight-result-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--elevated);
    color: var(--text-dim);
    transition: all 80ms;
}

.spotlight-result-item.active .spotlight-result-icon {
    background: var(--accent-glow);
    color: var(--accent);
}

.spotlight-result-body {
    flex: 1;
    min-width: 0;
}

.spotlight-result-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.spotlight-result-label {
    font: 500 13px/1.3 var(--sans);
    color: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotlight-result-desc {
    font: 400 11px/1.3 var(--mono);
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.spotlight-result-date {
    font: 400 10px/1 var(--mono);
    color: var(--text-muted);
    flex-shrink: 0;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--elevated);
}

.spotlight-result-enter {
    font: 500 9px/1 var(--mono);
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 80ms;
}

.spotlight-result-item.active .spotlight-result-enter {
    opacity: 1;
}

/* ---- Intent Badge ---- */

.spotlight-intent-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 16px 4px;
    padding: 4px 10px;
    font: 500 10px/1.3 var(--mono);
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    border-radius: 6px;
    letter-spacing: 0.3px;
}

/* ---- Dynamic Section (universal search results) ---- */

.spotlight-dynamic-section {
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 2px;
}

.spotlight-dynamic-section .spotlight-group-label:first-child {
    padding-top: 10px;
}

/* ---- Footer ---- */

.spotlight-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 16px;
    border-top: 1px solid var(--border);
    font: 400 10px/1 var(--mono);
    color: var(--text-muted);
}

.spotlight-footer kbd {
    font: 500 9px/1 var(--mono);
    color: var(--text-muted);
    background: var(--elevated);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 2px 5px;
    margin: 0 2px;
}

/* ---- Empty / Loading ---- */

.spotlight-empty {
    text-align: center;
    padding: 32px 16px;
    font: 400 12px/1.5 var(--sans);
    color: var(--text-muted);
}

.spotlight-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    font: 400 11px/1 var(--mono);
    color: var(--text-muted);
}

.spotlight-search-loading {
    border-top: 1px dashed var(--border);
    margin-top: 4px;
}

.spotlight-loading-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: spotlightPulse 1s ease-in-out infinite;
}

.spotlight-loading-dot:nth-child(2) { animation-delay: 0.15s; }
.spotlight-loading-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes spotlightPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
    .spotlight-overlay { padding-top: 8vh; }
    .spotlight-dialog { width: 95%; max-width: none; border-radius: 10px; max-height: 70vh; }
    .spotlight-input { font-size: 16px; }
}
