/* =============================================
   PRODUCTIVEAPP - COMMAND PALETTE CSS
   Palette de commandes premium (Cmd+K / Ctrl+K)
   Glassmorphism design with theme integration
   ============================================= */

/* === BACKDROP === */
.cmd-palette-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 150ms ease, visibility 150ms ease;
}

.cmd-palette-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* === MODAL CONTAINER === */
.cmd-palette-modal {
    width: 100%;
    max-width: 600px;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.5),
        0 0 1px rgba(255, 255, 255, 0.1),
        0 0 40px var(--accent-glow, rgba(100, 100, 255, 0.08));
    overflow: hidden;
    transform: scale(0.95) translateY(-10px);
    opacity: 0;
    transition: transform 150ms cubic-bezier(0.32, 0.72, 0, 1), opacity 150ms ease;
}

.cmd-palette-backdrop.active .cmd-palette-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* === SEARCH SECTION === */
.cmd-palette-search {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.cmd-palette-search-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-left: 12px;
    color: var(--text-muted, #888);
    opacity: 0.6;
}

.cmd-palette-search-icon svg {
    width: 100%;
    height: 100%;
}

.cmd-palette-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text, #fff);
    font-size: 18px;
    font-family: inherit;
    padding: 18px 16px;
    caret-color: var(--accent, #6366f1);
}

.cmd-palette-input::placeholder {
    color: var(--text-muted, #666);
    opacity: 0.6;
}

/* === RESULTS LIST === */
.cmd-palette-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
    scroll-behavior: smooth;
}

.cmd-palette-results::-webkit-scrollbar {
    width: 4px;
}

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

.cmd-palette-results::-webkit-scrollbar-thumb {
    background: var(--border, rgba(255, 255, 255, 0.12));
    border-radius: 4px;
}

.cmd-palette-results::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted, rgba(255, 255, 255, 0.25));
}

/* === CATEGORY HEADER === */
.cmd-palette-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent, #6366f1);
    padding: 10px 12px 6px;
    user-select: none;
}

/* === RESULT ITEM === */
.cmd-palette-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 80ms ease;
    user-select: none;
}

.cmd-palette-item:hover {
    background: var(--accent, rgba(99, 102, 241, 0.12));
    background: color-mix(in srgb, var(--accent, #6366f1) 10%, transparent);
}

.cmd-palette-item.active {
    background: var(--accent, rgba(99, 102, 241, 0.18));
    background: color-mix(in srgb, var(--accent, #6366f1) 18%, transparent);
}

.cmd-palette-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.05));
    border-radius: 8px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
}

.cmd-palette-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cmd-palette-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text, #e5e5e5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmd-palette-item.active .cmd-palette-item-title {
    color: #fff;
}

.cmd-palette-item-subtitle {
    font-size: 12px;
    color: var(--text-muted, #777);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === CATEGORY TAG === */
.cmd-palette-tag {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.06));
    color: var(--text-muted, #888);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
}

/* === SHORTCUT HINT === */
.cmd-palette-shortcut {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 3px;
}

.cmd-palette-shortcut kbd {
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.06));
    color: var(--text-muted, #888);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    line-height: 1.4;
}

/* === EMPTY STATE === */
.cmd-palette-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted, #666);
    font-size: 14px;
}

.cmd-palette-empty-icon {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* === FOOTER === */
.cmd-palette-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 16px;
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.06));
    font-size: 12px;
    color: var(--text-muted, #555);
    user-select: none;
}

.cmd-palette-footer-hint {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cmd-palette-footer-hint kbd {
    font-family: inherit;
    font-size: 11px;
    padding: 1px 5px;
    border-radius: 3px;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    color: var(--text-muted, #777);
    line-height: 1.5;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
    .cmd-palette-backdrop {
        padding-top: 5vh;
        padding-left: 12px;
        padding-right: 12px;
    }

    .cmd-palette-modal {
        max-width: 100%;
        border-radius: 12px;
    }

    .cmd-palette-input {
        font-size: 16px;
        padding: 14px 12px;
    }

    .cmd-palette-results {
        max-height: 50vh;
    }

    .cmd-palette-shortcut {
        display: none;
    }

    .cmd-palette-footer {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    .cmd-palette-backdrop,
    .cmd-palette-modal,
    .cmd-palette-item {
        transition: none;
    }
}
