/* ===================================
   Command Palette (Ctrl+K overlay)
   =================================== */

.cmd-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.cmd-overlay.open {
    display: block;
}

.cmd-palette {
    display: none;
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 201;
    width: 90%;
    max-width: 560px;
    max-height: 60vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), var(--glow-accent);
    overflow: hidden;
    flex-direction: column;
}

.cmd-palette.open {
    display: flex;
}

.cmd-palette-header {
    display: flex;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    gap: var(--space-2);
}

.cmd-input {
    flex: 1;
    background: none;
    border: none;
    padding: var(--space-2) 0;
    font-size: var(--body);
    font-family: var(--font);
    color: var(--text-primary);
    outline: none;
}

.cmd-input::placeholder {
    color: var(--text-dim);
}

.cmd-hint {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: var(--xs);
    color: var(--text-dim);
    padding: 2px 6px;
    background: var(--surface-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.cmd-results {
    overflow-y: auto;
    padding: var(--space-2);
    max-height: 50vh;
}

.cmd-group {
    margin-bottom: var(--space-2);
}

.cmd-group:last-child {
    margin-bottom: 0;
}

.cmd-group-label {
    font-size: var(--xs);
    font-weight: var(--weight-semibold);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: var(--space-1) var(--space-2);
    margin-bottom: var(--space-1);
}

.cmd-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition);
    color: var(--text-primary);
}

.cmd-item:hover,
.cmd-item:focus {
    background: var(--surface-bg-hover);
    outline: none;
}

.cmd-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
    font-size: var(--body);
}

.cmd-item-img {
    width: 24px;
    height: 34px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--surface-bg);
    flex-shrink: 0;
}

.cmd-item-title {
    font-size: var(--body);
    font-weight: var(--weight-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmd-empty {
    text-align: center;
    padding: var(--space-6) var(--space-3);
    color: var(--text-dim);
    font-size: var(--body);
}

@media (max-width: 768px) {
    .cmd-palette {
        top: 10%;
        width: 94%;
        max-height: 70vh;
    }
    .cmd-results {
        max-height: 60vh;
    }
}
