v.innerHTML = resultHTML;
                    statusDiv.textContent = `Found ${results.length} result${results.length !== 1 ? 's' : ''} for "${query}" (${searchTime}ms)`;
                }
                
            } catch (error) {
                console.error('Search error:', error);
                resultsDiv.innerHTML = '<div class="error">Search failed. Check console for details.</div>';
                statusDiv.innerHTML = `<div class="error">Search failed: ${error.message}</div>`;
            }
