/**
 * Command Palette Styles
 * Modern, clean command palette UI
 */

.command-palette {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.command-palette-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.15s ease-out;
}

.command-palette-container {
    position: relative;
    width: 90%;
    max-width: 640px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .command-palette-container {
        background: #1e1e1e;
        color: #e0e0e0;
    }
}

.command-palette-header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

@media (prefers-color-scheme: dark) {
    .command-palette-header {
        border-bottom-color: #333;
    }
}

#commandPaletteInput {
    width: 100%;
    border: none;
    outline: none;
    font-size: 18px;
    padding: 8px 0;
    background: transparent;
    color: inherit;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#commandPaletteInput::placeholder {
    color: #9ca3af;
}

.command-palette-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
    display: flex;
    gap: 12px;
}

.command-palette-hint kbd {
    display: inline-block;
    padding: 2px 6px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
    color: #374151;
}

@media (prefers-color-scheme: dark) {
    .command-palette-hint kbd {
        background: #2d2d2d;
        border-color: #444;
        color: #aaa;
    }
}

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

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

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

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

.command-palette-results::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

@media (prefers-color-scheme: dark) {
    .command-palette-results::-webkit-scrollbar-thumb {
        background: #444;
    }
    .command-palette-results::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

.command-results-header {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    margin-top: 4px;
}

.command-result-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.1s ease;
    gap: 12px;
}

.command-result-item:hover,
.command-result-item.selected {
    background: #f3f4f6;
}

@media (prefers-color-scheme: dark) {
    .command-result-item:hover,
    .command-result-item.selected {
        background: #2d2d2d;
    }
}

.command-result-icon {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.command-result-text {
    flex: 1;
    font-size: 14px;
    color: #111827;
}

@media (prefers-color-scheme: dark) {
    .command-result-text {
        color: #e0e0e0;
    }
}

.command-result-text mark {
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

@media (prefers-color-scheme: dark) {
    .command-result-text mark {
        background: #4a3000;
        color: #fbbf24;
    }
}

.command-result-badge {
    flex-shrink: 0;
    font-size: 11px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 10px;
}

@media (prefers-color-scheme: dark) {
    .command-result-badge {
        background: #2d2d2d;
        color: #999;
    }
}

.command-no-results {
    padding: 40px 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

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

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

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

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

    #commandPaletteInput {
        font-size: 16px; /* Prevent zoom on iOS */
    }

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