.selection-ai-panel {
    position: absolute;
    z-index: 10000;
    display: flex;
    align-items: center;
    background: rgba(24, 24, 28, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 12px 28px rgba(0, 0, 0, 0.4);
    padding: 4px 6px;
    gap: 4px;
    pointer-events: none; /* Controlled by inline styles */
    user-select: none;
    animation: fadeInScale 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.selection-ai-panel.below {
    animation: fadeInScaleBelow 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScaleBelow {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #e4e4e7; /* zinc-200 */
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    font-family: inherit;
}

.toolbar-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.toolbar-btn.primary {
    color: var(--nexus-neon, #00ff99);
}

.toolbar-btn.primary:hover:not(.disabled) {
    background: rgba(0, 255, 153, 0.08);
    box-shadow: 0 0 12px rgba(0, 255, 153, 0.15);
}

.toolbar-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.toolbar-divider {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.spinner-inline {
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.opacity-50 {
    opacity: 0.5 !important;
}

.cursor-not-allowed {
    cursor: not-allowed !important;
}

/* Light mode overrides */
.theme-light .selection-ai-panel {
    background: rgba(254, 254, 254, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05), 0 10px 30px rgba(0, 0, 0, 0.04);
}

.theme-light .toolbar-btn {
    color: #57524e;
}

.theme-light .toolbar-btn:hover:not(.disabled) {
    background: rgba(0, 0, 0, 0.04);
    color: #1c1917;
}

.theme-light .toolbar-btn.primary {
    color: #10b981;
}

.theme-light .toolbar-btn.primary:hover:not(.disabled) {
    background: rgba(16, 185, 129, 0.06);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.1);
}

.theme-light .toolbar-divider {
    background: rgba(0, 0, 0, 0.08);
}


