/**
 * NOTES COMMAND PALETTE CSS - World Class Design
 * ProductiveApp v6.0
 */

/* ========== OVERLAY ========== */

.notes-command-palette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    z-index: 1100;
    animation: fadeIn 0.15s ease;
}

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

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

.notes-command-palette {
    width: 100%;
    max-width: 640px;
    max-height: 70vh;
    background: var(--bg-secondary, #0f1420);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideDown 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ========== HEADER ========== */

.notes-command-palette-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.notes-command-palette-icon {
    color: var(--primary-color, var(--accent));
    flex-shrink: 0;
}

.notes-command-palette-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary, #e4e7ec);
    font-size: 16px;
    font-weight: 400;
    padding: 0;
}

.notes-command-palette-input::placeholder {
    color: var(--text-secondary, #9ca3af);
}

.notes-command-palette-hint {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary, #9ca3af);
    font-family: monospace;
}

/* ========== RESULTS ========== */

.notes-command-palette-results {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 50vh;
}

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

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

.notes-command-palette-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.notes-command-palette-results::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Result Item */
.notes-command-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: transform 0.15s ease-out, background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out, opacity 0.15s ease-out;
    border-left: 3px solid transparent;
}

.notes-command-result:hover {
    background: rgba(255, 255, 255, 0.04);
}

.notes-command-result.selected {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border-left-color: var(--primary-color, var(--accent));
}

.notes-command-result-icon {
    font-size: 20px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.notes-command-result-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary, #e4e7ec);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.notes-command-result-subtitle {
    font-size: 12px;
    color: var(--text-secondary, #9ca3af);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notes-command-result-meta {
    display: flex;
    gap: 6px;
    align-items: center;
}

.notes-command-result-meta .badge {
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary, #9ca3af);
    letter-spacing: 0.5px;
}

.notes-command-result-meta .badge.command {
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--accent-light);
}

.notes-command-result-meta .badge.tag {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

/* Type-specific icons */
.notes-command-result.type-note .notes-command-result-icon {
    filter: grayscale(0.3);
}

.notes-command-result.type-command .notes-command-result-icon {
    filter: hue-rotate(120deg);
}

.notes-command-result.type-tag .notes-command-result-icon {
    filter: hue-rotate(240deg);
}

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

.notes-command-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary, #9ca3af);
}

.notes-command-empty svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.notes-command-empty p {
    font-size: 14px;
    margin: 0;
}

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

.notes-command-palette-footer {
    padding: 12px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.notes-command-palette-shortcuts {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary, #9ca3af);
}

.notes-command-palette-shortcuts span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.notes-command-palette-shortcuts kbd {
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    font-family: monospace;
    color: var(--text-secondary, #9ca3af);
}

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

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

    .notes-command-palette {
        max-width: 90%;
        max-height: 80vh;
    }

    .notes-command-palette-shortcuts {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* ========== LIGHT THEME ========== */

:root[data-theme*="light"] .notes-command-palette-overlay {
    background: rgba(0, 0, 0, 0.3);
}

:root[data-theme*="light"] .notes-command-palette {
    --bg-secondary: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    border-color: rgba(0, 0, 0, 0.12);
}

:root[data-theme*="light"] .notes-command-result:hover {
    background: rgba(0, 0, 0, 0.04);
}

:root[data-theme*="light"] .notes-command-result.selected {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}
