/* ============================================
   Command Palette Styles (⌘K) - Cyberpunk Fairy
   Modern command interface for power users
   ============================================ */

/* Modal Backdrop */
.command-palette-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgb(0, 0, 0, 0); /* design-spec: transparent reset for animation start state */
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    z-index: var(--z-command);
    transition: background 0.2s ease;
}

.command-palette-modal.command-palette-open {
    display: flex;
    background: rgb(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
}

/* Container */
.command-palette-container {
    background: var(--surface);
    border-radius: var(--r-xl);
    box-shadow: 0 20px 60px rgb(0, 0, 0, 0.4), 0 0 40px var(--primary-glow); /* design-spec: command-palette premium overlay with glow */
    border: 2px solid var(--primary);
    width: 640px;
    max-width: 90vw;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    opacity: 0;
    animation: commandPaletteIn 0.15s ease forwards;
    position: relative;
}

.command-palette-container .command-palette-alva {
    position: absolute;
    top: 12px;
    right: 12px;
    opacity: 0.6;
    animation: float 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

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

/* Search Section */
.command-palette-search {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.command-palette-search-icon {
    font-size: 20px;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow), 0 0 20px var(--primary-tint);
}

.command-palette-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--fg);
    background: transparent;
}

.command-palette-input::placeholder {
    color: var(--fg-3);
}

.command-palette-hint {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--fg-3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", monospace;
}

/* Results Section */
.command-palette-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    max-height: 400px;
}

/* Category */
.command-category {
    margin-bottom: 8px;
}

.command-category:last-child {
    margin-bottom: 0;
}

.command-category-label {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fg-3);
}

/* Command Item - Cyberpunk Style */
.command-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 2px;
    position: relative;
    border: 1px solid transparent;
}

.command-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.15s ease;
}

.command-item:hover::before,
.command-item.selected::before {
    opacity: 1;
}

.command-item:hover,
.command-item.selected {
    background: linear-gradient(90deg, var(--primary-tint), var(--accent-tint));
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.command-item.selected {
    background: linear-gradient(90deg, var(--primary-tint), var(--accent-tint));
}

.command-item.selected .command-item-icon {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow), 0 0 20px var(--primary-tint);
}

.command-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.command-item-icon {
    font-size: 16px;
    color: var(--fg-2);
    transition: color 0.1s ease;
}

.command-item-label {
    font-size: 14px;
    font-weight: 500;
}

/* No Results */
.command-palette-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: var(--fg-3);
    text-align: center;
}

.command-palette-no-results i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.command-palette-no-results p {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.command-palette-no-results small {
    font-size: 13px;
}

/* Footer */
.command-palette-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.command-palette-shortcuts {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--fg-3);
}

.command-palette-shortcuts kbd {
    background: linear-gradient(135deg, var(--primary-tint), var(--accent-tint));
    border: 1px solid var(--primary);
    border-radius: var(--r-sm);
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    margin: 0 2px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", monospace;
    color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

/* Utility */
.hidden {
    display: none !important;
}

/* Scrollbar */
.command-palette-results::-webkit-scrollbar {
    width: 8px;
}

.command-palette-results::-webkit-scrollbar-track {
    background: transparent;
}

.command-palette-results::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--r-sm);
}

.command-palette-results::-webkit-scrollbar-thumb:hover {
    background: var(--fg-3);
}

/* Responsive */
@media (max-width: 767.98px) {
    .command-palette-container {
        width: 100%;
        max-width: calc(100vw - 32px);
        max-height: 80vh;
    }

    .command-palette-modal {
        padding-top: 10vh;
    }
}
