/* ========== Command Palette Wrapper ========== */
#gf-command-palette {
    position: relative;
    max-width: 520px;
    width: 100%;
    height: 32px;
    flex-shrink: 0;
}

/* ========== Pill Trigger (resting state) ========== */
#gf-palette-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 0 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    color: #1e1e1e;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
    width: 100%;
    text-align: left;
    transition: background-color 80ms ease;
}

#gf-palette-trigger:hover {
    background: #e8e8e8;
}

#gf-palette-trigger:focus,
#gf-palette-trigger:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

#gf-palette-form-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gf-palette-shortcut {
    font-size: 11px;
    color: #757575;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ========== Active Card (input + dropdown joined) ========== */
#gf-palette-card {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 520px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08);
    z-index: 999999999;
}

/* ========== Input row inside the card ========== */
#gf-palette-input-wrap {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 12px;
    background: #f6f6f6;
}

#gf-palette-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    color: #1e1e1e;
    min-width: 0;
}

#gf-palette-input:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

#gf-palette-input::placeholder {
    color: #aaa;
}

/* ========== Divider between input and results ========== */
#gf-palette-divider {
    height: 1px;
    background: #e0e0e0;
}

/* ========== Dropdown (results pane inside the card) ========== */
#gf-palette-dropdown {
    max-height: 380px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========== Results List ========== */
.gf-palette-section-label {
    padding: 8px 8px 4px;
    margin-left: -4px;
    font-size: 11px;
    font-weight: 500;
    color: #757575;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
}

#gf-palette-results {
    list-style: none;
    margin: 0;
    padding: 0 4px;
    overflow-y: auto;
    flex: 1;
}

.gf-palette-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    color: #1e1e1e;
    text-align: left;
}

.gf-palette-result-item.has-description {
    gap: 12px;
}

.gf-palette-result-item[aria-selected="true"],
.gf-palette-result-item:hover {
    background: #f0f0f0;
}

.gf-palette-result-label {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gf-palette-result-item.has-description .gf-palette-result-label {
    flex: 0 1 44%;
}

.gf-palette-result-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    opacity: 0.45;
}

img.gf-palette-result-icon {
    opacity: 1;
    object-fit: contain;
}

.gf-palette-result-description {
    font-size: 11px;
    color: #757575;
    flex: 1 1 56%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

/* ========== Empty State ========== */
.gf-palette-empty {
    padding: 16px 12px;
    font-size: 13px;
    color: #757575;
    text-align: center;
}

/* ========== Palette context highlight (used by modal context listeners) ========== */
@keyframes gf-palette-flash {
    0%   { background-color: rgba(138, 43, 226, 0.12); }
    60%  { background-color: rgba(138, 43, 226, 0.12); }
    100% { background-color: transparent; }
}

.gf-palette-highlight {
    animation: gf-palette-flash 1.5s ease forwards;
    border-radius: 3px;
}

/* ========== Footer ========== */
#gf-palette-footer {
    display: flex;
    gap: 12px;
    padding: 6px 12px;
    border-top: 1px solid #eee;
    font-size: 11px;
    color: #757575;
    flex-shrink: 0;
}

#gf-palette-footer span {
    white-space: nowrap;
}
