/* ==========================================================
   CIBM Studio Pro
   Command Palette
   Version 9.1
========================================================== */

/* ----------------------------------------------------------
   Overlay
---------------------------------------------------------- */

#commandPalette {

    position: fixed;

    inset: 0;

    display: none;

    justify-content: center;

    align-items: flex-start;

    padding-top: 8vh;

    background: rgba(0,0,0,.25);

    z-index: 11000;

}

#commandPalette.active {

    display: flex;

}

/* ----------------------------------------------------------
   Palette Window
---------------------------------------------------------- */

.command-palette {

    width: min(760px, 92vw);

    max-height: 70vh;

    display: flex;

    flex-direction: column;

    background: var(--background);

    border: 1px solid var(--border);

    border-radius: 10px;

    box-shadow: 0 20px 60px rgba(0,0,0,.30);

    overflow: hidden;

}

/* ----------------------------------------------------------
   Search Box
---------------------------------------------------------- */

.command-search {

    width: 100%;

    border: none;

    outline: none;

    padding: 16px 18px;

    font-size: 16px;

    border-bottom: 1px solid var(--border);

    background: var(--background);

    color: var(--text);

}

/* ----------------------------------------------------------
   Results
---------------------------------------------------------- */

.command-results {

    overflow-y: auto;

    max-height: 60vh;

}

/* ----------------------------------------------------------
   Result Item
---------------------------------------------------------- */

.command-item {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    padding: 12px 16px;

    cursor: pointer;

    transition: background .15s ease;

}

.command-item:hover,

.command-item.selected {

    background: rgba(0,102,204,.10);

}

/* ----------------------------------------------------------
   Left Side
---------------------------------------------------------- */

.command-main {

    display: flex;

    align-items: center;

    gap: 12px;

    min-width: 0;

}

.command-icon {

    width: 22px;

    text-align: center;

    opacity: .8;

}

.command-text {

    display: flex;

    flex-direction: column;

    min-width: 0;

}

.command-title {

    font-size: 14px;

    font-weight: 600;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}

.command-subtitle {

    font-size: 12px;

    color: #777;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}

/* ----------------------------------------------------------
   Right Side
---------------------------------------------------------- */

.command-shortcut {

    font-size: 12px;

    color: #666;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 4px;

    padding: 2px 6px;

    white-space: nowrap;

}

.command-category {

    font-size: 11px;

    color: var(--accent);

    font-weight: 600;

}

/* ----------------------------------------------------------
   Empty State
---------------------------------------------------------- */

.command-empty {

    padding: 32px;

    text-align: center;

    color: #888;

    font-size: 13px;

}

/* ----------------------------------------------------------
   Scrollbar
---------------------------------------------------------- */

.command-results::-webkit-scrollbar {

    width: 8px;

}

.command-results::-webkit-scrollbar-thumb {

    background: rgba(0,0,0,.20);

    border-radius: 4px;

}

.command-results::-webkit-scrollbar-thumb:hover {

    background: rgba(0,0,0,.35);

}

/* ----------------------------------------------------------
   Responsive
---------------------------------------------------------- */

@media (max-width: 640px) {

    .command-palette {

        width: 96vw;

        max-height: 80vh;

    }

    .command-search {

        font-size: 15px;

    }

    .command-shortcut {

        display: none;

    }

}