/**
 * Command Palette (Cmd+K)
 * GitHub/VSCode style command palette
 */

/* ===================================
   COMMAND PALETTE OVERLAY
   =================================== */

.command-palette-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    animation: overlayFadeIn 0.2s ease;
}

.command-palette-overlay.active {
    display: flex;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===================================
   COMMAND PALETTE CONTAINER
   =================================== */

.command-palette {
    width: 90%;
    max-width: 640px;
    background: rgba(10, 14, 39, 0.98);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 16px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(0, 243, 255, 0.1);
    animation: paletteSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

@keyframes paletteSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }

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

/* ===================================
   SEARCH INPUT
   =================================== */

.command-search {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 12px;
}

.command-search-icon {
    font-size: 20px;
    color: rgba(0, 243, 255, 0.7);
}

.command-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 16px;
    color: #ffffff;
    font-weight: 500;
}

.command-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.command-shortcut {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

/* ===================================
   COMMANDS LIST
   =================================== */

.command-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.command-list::-webkit-scrollbar {
    width: 8px;
}

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

.command-list::-webkit-scrollbar-thumb {
    background: rgba(0, 243, 255, 0.2);
    border-radius: 4px;
}

.command-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 243, 255, 0.3);
}

/* ===================================
   COMMAND ITEMS
   =================================== */

.command-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.command-item:hover,
.command-item.selected {
    background: rgba(0, 243, 255, 0.1);
    border-left: 3px solid #00f3ff;
    padding-left: 13px;
}

.command-icon {
    width: 32px;
    height: 32px;
    background: rgba(0, 243, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #00f3ff;
    flex-shrink: 0;
}

.command-content {
    flex: 1;
}

.command-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2px;
}

.command-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.command-kbd {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-family: monospace;
    white-space: nowrap;
}

/* ===================================
   COMMAND CATEGORIES
   =================================== */

.command-category {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.command-category:first-child {
    margin-top: 0;
}

/* ===================================
   EMPTY STATE
   =================================== */

.command-empty {
    padding: 40px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
}

.command-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.command-empty-text {
    font-size: 14px;
    font-weight: 500;
}

/* ===================================
   COMMAND FOOTER
   =================================== */

.command-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
}

.command-footer-hint {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.command-footer-hint span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.command-footer-kbd {
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    font-family: monospace;
}

/* ===================================
   RECENT COMMANDS
   =================================== */

.command-recent-badge {
    padding: 2px 8px;
    background: rgba(0, 243, 255, 0.1);
    border-radius: 12px;
    font-size: 10px;
    color: #00f3ff;
    font-weight: 600;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .command-palette-overlay {
        padding-top: 10vh;
    }

    .command-palette {
        width: 95%;
        max-width: none;
    }

    .command-list {
        max-height: 300px;
    }

    .command-footer-hint {
        flex-wrap: wrap;
        gap: 8px;
    }
}