/* =================================================================
   COMMAND PALETTE (Cmd+K)
   Modern power-user feature
   ================================================================= */

.command-palette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: calc(var(--z-modal) + 10);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
}

.command-palette.open {
    opacity: 1;
    visibility: visible;
}

.command-palette-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.command-palette-container {
    position: relative;
    width: 90%;
    max-width: 640px;
    max-height: 70vh;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(-20px);
    transition: transform var(--transition-base);
    overflow: hidden;
}

.command-palette.open .command-palette-container {
    transform: scale(1) translateY(0);
}

/* Header */
.command-palette-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.command-search-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.command-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.125rem;
    color: var(--text-primary);
    padding: 0;
}

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

.command-hint {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

/* Body */
.command-palette-body {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
    max-height: 400px;
}

.command-list {
    padding: 0.5rem;
}

.command-category {
    padding: 0.75rem 1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.command-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.command-item:hover,
.command-item.selected {
    background: var(--bg-hover);
}

.command-item.selected {
    border-left: 3px solid var(--primary-500);
    box-shadow: 0 0 0 1px var(--primary-500);
}

.command-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.command-content {
    flex: 1;
    min-width: 0;
}

.command-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.command-title mark {
    background: var(--primary-500);
    color: white;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

.command-description {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Empty State */
.command-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

.command-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.command-empty-text {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* Footer */
.command-palette-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.command-shortcuts {
    display: flex;
    gap: 1.5rem;
    justify-content: flex-end;
}

.command-shortcut-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.command-shortcut-item kbd {
    min-width: 24px;
    padding: 0.25rem 0.5rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6875rem;
    text-align: center;
}

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

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

.command-palette-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.command-palette-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .command-palette {
        padding-top: 10vh;
    }
    
    .command-palette-container {
        width: 95%;
        max-height: 80vh;
    }
    
    .command-search-input {
        font-size: 1rem;
    }
    
    .command-shortcuts {
        gap: 1rem;
    }
    
    .command-shortcut-item span {
        display: none;
    }
}

/* =================================================================
   KEYBOARD SHORTCUTS MODAL
   ================================================================= */

.shortcuts-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.shortcuts-modal .modal-content {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.shortcuts-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.shortcuts-modal .modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.shortcuts-modal .modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.shortcuts-modal .modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.shortcuts-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.shortcut-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary-500);
}

.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.shortcut-keys kbd {
    min-width: 32px;
    padding: 0.375rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    text-align: center;
    box-shadow: 0 2px 0 var(--border-color);
}

.shortcut-description {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

@media (max-width: 768px) {
    .shortcuts-modal .modal-content {
        max-width: 95%;
    }
    
    .shortcut-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .shortcut-description {
        font-size: 0.875rem;
    }
}

