/**
 * Command Palette Styles
 * Hacker aesthetic - monospace, dark, terminal-style
 */

/* Hide custom cursor when command palette is open */
.command-palette-active .custom-cursor,
.command-palette-active .cursor-paw,
.command-palette-active .cursor-trail {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.command-palette-active {
    cursor: default !important;
}

.command-palette {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    cursor: default !important;
}

.command-palette.open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}

/* Backdrop */
.command-palette-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.1s ease-out;
}

/* Modal - Terminal style */
.command-palette-modal {
    position: relative;
    width: 90%;
    max-width: 560px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 4px;
    box-shadow:
        0 0 0 1px rgba(0, 255, 0, 0.1),
        0 25px 60px -15px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    animation: slideDown 0.15s ease-out;
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
}

/* Header with prompt */
.command-palette-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #222;
    background: #0d0d0d;
}

.command-palette-prompt {
    color: #00ff00;
    font-size: 1rem;
    font-weight: bold;
    margin-right: 8px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.command-palette-input {
    flex: 1;
    padding: 8px 0;
    font-size: 0.95rem;
    font-family: inherit;
    background: transparent;
    border: none;
    color: #00ff00;
    outline: none;
    caret-color: #00ff00;
}

.command-palette-input::placeholder {
    color: #444;
}

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

.command-palette-results::-webkit-scrollbar {
    width: 4px;
}

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

.command-palette-results::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}

/* Group */
.command-palette-group {
    margin-bottom: 4px;
}

.command-palette-group-label {
    padding: 8px 12px 4px;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: #555;
}

/* Item */
.command-palette-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 2px;
    cursor: pointer !important;
    pointer-events: auto !important;
    transition: all 0.08s ease;
    border: 1px solid transparent;
    user-select: none;
}

.command-palette-item:hover,
.command-palette-item.selected {
    background: #111;
}

.command-palette-item.selected {
    background: rgba(0, 255, 0, 0.08);
    border-color: #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.1);
}

.command-palette-item-icon {
    font-size: 0.8rem;
    color: #00ff00;
    min-width: 32px;
    text-align: left;
    opacity: 0.7;
}

.command-palette-item.selected .command-palette-item-icon {
    opacity: 1;
    text-shadow: 0 0 8px rgba(0, 255, 0, 0.5);
}

.command-palette-item-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.command-palette-item-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #ccc;
}

.command-palette-item.selected .command-palette-item-label {
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.command-palette-item-description {
    font-size: 0.7rem;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer */
.command-palette-footer {
    display: flex;
    gap: 16px;
    padding: 8px 16px;
    border-top: 1px solid #222;
    background: #0d0d0d;
    font-size: 0.65rem;
    color: #444;
}

.command-palette-footer kbd {
    display: inline-block;
    padding: 2px 5px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 2px;
    font-family: inherit;
    font-size: 0.6rem;
    color: #666;
    margin-right: 4px;
}

/* Empty State */
.command-palette-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 20px;
    color: #444;
    font-size: 0.8rem;
}

.command-palette-empty-icon {
    font-size: 1.2rem;
    color: #333;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   THEME OVERRIDES
   ======================================== */

/* Blood Moon - Red accent */
[data-theme="blood-moon"] .command-palette-prompt,
[data-theme="blood-moon"] .command-palette-input {
    color: #ff3333;
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.5);
    caret-color: #ff3333;
}

[data-theme="blood-moon"] .command-palette-item-icon {
    color: #ff3333;
}

[data-theme="blood-moon"] .command-palette-item.selected {
    background: rgba(255, 51, 51, 0.08);
    border-color: #ff3333;
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.1);
}

[data-theme="blood-moon"] .command-palette-item.selected .command-palette-item-label,
[data-theme="blood-moon"] .command-palette-item.selected .command-palette-item-icon {
    color: #ff3333;
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.3);
}

/* Arctic Wolf - Always dark command palette */
[data-theme="arctic-wolf"] .command-palette-modal {
    background: #0a0a0a;
    border-color: #333;
}

[data-theme="arctic-wolf"] .command-palette-header,
[data-theme="arctic-wolf"] .command-palette-footer {
    background: #0d0d0d;
}

[data-theme="arctic-wolf"] .command-palette-prompt,
[data-theme="arctic-wolf"] .command-palette-input {
    color: #3b82f6;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    caret-color: #3b82f6;
}

[data-theme="arctic-wolf"] .command-palette-item-icon {
    color: #3b82f6;
}

[data-theme="arctic-wolf"] .command-palette-item-label {
    color: #ccc;
}

[data-theme="arctic-wolf"] .command-palette-item.selected {
    background: rgba(59, 130, 246, 0.08);
    border-color: #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
}

[data-theme="arctic-wolf"] .command-palette-item.selected .command-palette-item-label,
[data-theme="arctic-wolf"] .command-palette-item.selected .command-palette-item-icon {
    color: #3b82f6;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* Forest Pack - Green accent */
[data-theme="forest-pack"] .command-palette-prompt,
[data-theme="forest-pack"] .command-palette-input {
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
    caret-color: #4ade80;
}

[data-theme="forest-pack"] .command-palette-item-icon {
    color: #4ade80;
}

[data-theme="forest-pack"] .command-palette-item.selected {
    background: rgba(74, 222, 128, 0.08);
    border-color: #4ade80;
}

[data-theme="forest-pack"] .command-palette-item.selected .command-palette-item-label,
[data-theme="forest-pack"] .command-palette-item.selected .command-palette-item-icon {
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

/* Neon Hunt - Pink accent */
[data-theme="neon-hunt"] .command-palette-prompt,
[data-theme="neon-hunt"] .command-palette-input {
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
    caret-color: #ff00ff;
}

[data-theme="neon-hunt"] .command-palette-item-icon {
    color: #00ffff;
}

[data-theme="neon-hunt"] .command-palette-modal {
    border-color: #ff00ff;
    box-shadow:
        0 0 20px rgba(255, 0, 255, 0.2),
        0 0 40px rgba(0, 255, 255, 0.1);
}

[data-theme="neon-hunt"] .command-palette-item.selected {
    background: rgba(255, 0, 255, 0.08);
    border-color: #ff00ff;
}

[data-theme="neon-hunt"] .command-palette-item.selected .command-palette-item-label {
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
}

[data-theme="neon-hunt"] .command-palette-item.selected .command-palette-item-icon {
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Terminal - Matrix green (default) */
[data-theme="terminal"] .command-palette-modal {
    border-color: #00ff00;
    box-shadow:
        0 0 25px rgba(0, 255, 0, 0.15),
        inset 0 0 30px rgba(0, 255, 0, 0.02);
}