/**
 * AI Semantic Search component styles
 * Coordinate-free, minimal design that integrates with main.css
 */

[data-ai-search-component] {
  position: relative;
}

#ai-search-input {
  /* Positioned to integrate with existing search input styling */
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
}

#ai-search-input:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

#ai-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out, opacity 0.2s ease-out;
  pointer-events: none;
}

#ai-search-results.ai-search-open {
  max-height: 600px;
  opacity: 1;
  pointer-events: auto;
  overflow-y: auto;
}

.ai-search-header {
  padding: 1rem;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #666;
  background: #fafafa;
}

.ai-search-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ai-search-item {
  padding: 1rem;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color 0.15s;
}

.ai-search-item:last-child {
  border-bottom: none;
}

.ai-search-item:hover {
  background-color: #f9f9f9;
}

.ai-search-title {
  display: block;
  margin-bottom: 0.5rem;
  color: #0066cc;
  font-weight: 600;
  text-decoration: none;
  word-wrap: break-word;
}

.ai-search-title:hover {
  text-decoration: underline;
}

.ai-search-relevance {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: #e8f0ff;
  color: #0066cc;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 3px;
}

.ai-search-snippet {
  margin: 0.5rem 0 0 0;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
  word-wrap: break-word;
}

.ai-search-error {
  padding: 1rem;
  color: #d32f2f;
  font-size: 0.9rem;
  background: #ffebee;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  #ai-search-input {
    background: #1e1e1e;
    border-color: #444;
    color: #fff;
  }

  #ai-search-input:focus {
    border-color: #6699ff;
    box-shadow: 0 0 0 3px rgba(102, 153, 255, 0.2);
  }

  #ai-search-results {
    background: #1e1e1e;
    border-color: #333;
  }

  .ai-search-header {
    background: #2a2a2a;
    border-bottom-color: #333;
    color: #aaa;
  }

  .ai-search-item {
    border-bottom-color: #333;
  }

  .ai-search-item:hover {
    background-color: #272727;
  }

  .ai-search-title {
    color: #6699ff;
  }

  .ai-search-relevance {
    background: #1a3a4d;
    color: #6699ff;
  }

  .ai-search-snippet {
    color: #999;
  }

  .ai-search-error {
    color: #ff6b6b;
    background: #3a2020;
  }
}

/* Mobile responsive */
@media (max-width: 640px) {
  #ai-search-results {
    max-height: 400px;
  }

  .ai-search-item {
    padding: 0.75rem;
  }

  .ai-search-snippet {
    font-size: 0.85rem;
  }
}
