/* ==========================================================================
   Command Palette (Spotlight Search Modal)
   DailyArchive - Smart Quant Search
   ========================================================================== */

.cmd-palette-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    animation: cmdFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cmd-palette-backdrop.active {
    display: flex;
}

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

.cmd-palette-modal {
    width: 92%;
    max-width: 640px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 14px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: scale(0.98);
    animation: cmdPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[data-theme="dark"] .cmd-palette-modal {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
}

@keyframes cmdPopIn {
    to { transform: scale(1); }
}

.cmd-palette-header {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    gap: 12px;
}

.cmd-search-icon {
    font-size: 1.25rem;
    color: var(--text-muted, #64748b);
}

.cmd-palette-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main, #0f172a);
    outline: none;
}

[data-theme="dark"] .cmd-palette-input {
    color: #f8fafc;
}

.cmd-palette-input::placeholder {
    color: var(--text-muted, #94a3b8);
    font-weight: 500;
}

.cmd-palette-esc {
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg-body, #f1f5f9);
    border: 1px solid var(--border, #cbd5e1);
    color: var(--text-muted, #64748b);
    padding: 3px 8px;
    border-radius: 6px;
    cursor: pointer;
}

[data-theme="dark"] .cmd-palette-esc {
    background: #0f172a;
    border-color: #475569;
    color: #94a3b8;
}

.cmd-palette-results {
    max-height: 380px;
    overflow-y: auto;
    padding: 8px;
}

.cmd-group-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 12px 4px;
}

.cmd-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-main, #0f172a);
    transition: all 0.15s ease;
}

[data-theme="dark"] .cmd-item {
    color: #e2e8f0;
}

.cmd-item:hover,
.cmd-item.selected {
    background: rgba(37, 99, 235, 0.09);
    color: var(--primary, #2563eb);
}

[data-theme="dark"] .cmd-item:hover,
[data-theme="dark"] .cmd-item.selected {
    background: rgba(59, 130, 246, 0.18);
    color: #60a5fa;
}

.cmd-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.cmd-item-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.cmd-item-info {
    overflow: hidden;
}

.cmd-item-title {
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmd-item-desc {
    font-size: 0.76rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmd-item-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    flex-shrink: 0;
}

.cmd-palette-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-body, #f8fafc);
    border-top: 1px solid var(--border, #e2e8f0);
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
}

[data-theme="dark"] .cmd-palette-footer {
    background: #0f172a;
    border-top-color: #334155;
    color: #94a3b8;
}

.cmd-footer-keys {
    display: flex;
    gap: 8px;
}

.cmd-footer-key {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border, #cbd5e1);
    padding: 2px 5px;
    border-radius: 4px;
    font-weight: 700;
}

[data-theme="dark"] .cmd-footer-key {
    background: #1e293b;
    border-color: #475569;
}
