/* Command Palette Styles */

.command-palette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

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

.command-palette-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease-out;
}

.command-palette-container {
    position: relative;
    width: 90%;
    max-width: 640px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(168, 85, 247, 0.1);
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.command-palette-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.command-palette-search-icon {
    font-size: 1.125rem;
    color: #a855f7;
    flex-shrink: 0;
}

.command-palette-search {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f5f5f5;
    font-size: 1rem;
    font-family: inherit;
    padding: 0;
}

.command-palette-search::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.command-palette-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.command-palette-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

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

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

.command-palette-results::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3);
    border-radius: 4px;
}

.command-palette-results::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.5);
}

.command-palette-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.command-palette-item:hover,
.command-palette-item.selected {
    background: rgba(168, 85, 247, 0.15);
}

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

.command-palette-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

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

.command-palette-name {
    color: #f5f5f5;
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.command-palette-description {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.command-palette-external {
    color: rgba(255, 255, 255, 0.35);
    font-size: 1.125rem;
    flex-shrink: 0;
}

.command-palette-empty {
    padding: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.9375rem;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Divider */
.command-palette-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.5rem 0;
}

/* Ask AI Option */
.command-palette-ask-ai {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(168, 85, 247, 0.05);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.command-palette-ask-ai:hover,
.command-palette-ask-ai.selected {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
}

.ai-icon {
    color: #a855f7;
    font-size: 1.25rem;
}

.command-palette-hint-inline {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

/* AI Response Area */
.command-palette-ai-response {
    padding: 1.5rem;
}

.ai-response-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-response-icon {
    color: #a855f7;
    font-size: 1.25rem;
}

.ai-response-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #a855f7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ai-response-content {
    color: #f5f5f5;
    font-size: 0.9375rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.ai-response-content p {
    margin: 0;
}

.ai-error {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.ai-response-back {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-response-back:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.3);
    color: #a855f7;
}

/* AI Loading Animation */
.ai-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9375rem;
}

.ai-loading-dots {
    display: flex;
    gap: 0.25rem;
}

.ai-loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a855f7;
    animation: aiDotPulse 1.4s infinite ease-in-out both;
}

.ai-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes aiDotPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

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

    .command-palette-container {
        width: 95%;
    }

    .command-palette-results {
        max-height: 60vh;
    }

    .command-palette-ai-response {
        padding: 1rem;
    }
}
