/* Search Container and Dropdown Styles */

#search-container {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1000;
  background: var(--popup-bg);
  color: var(--text-color);
  padding: 8px;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  width: 320px;
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#searchBox {
  width: 100%;
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid var(--dropdown-border);
  border-radius: 4px;
  background: var(--popup-bg);
  color: var(--text-color);
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#resultsDropdown {
  margin-top: 6px;
  max-height: 75vh;
  overflow-y: auto;
  display: none;
  background: var(--dropdown-bg);
  color: var(--text-color);
  border: 1px solid var(--dropdown-border);
  border-radius: 4px;
  font-size: 14px;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item.active {
  background-color: var(--dropdown-hover);
  color: var(--dropdown-highlight);
}

.dropdown-item {
  padding: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  background: var(--dropdown-bg);
  color: var(--text-color);
}

.dropdown-item img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
}

.dropdown-text strong {
  font-size: 0.9em;
  color: var(--text-color);
}

.dropdown-text span {
  font-size: 0.8em;
  color: var(--text-color);
  opacity: 1;
}

/* Search result styling */
.dropdown-item.character-result {
  background: linear-gradient(90deg, #f8f9fa 0%, #ffffff 100%);
  border-left: 4px solid #6366f1;
  padding: 12px;
  min-height: 80px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.dropdown-item.location-result {
  background: linear-gradient(90deg, #f8f9fa 0%, #ffffff 100%);
  border-left: 4px solid #10b981;
  padding: 12px;
  min-height: 80px;
  border-radius: 6px;
  margin-bottom: 4px;
}

/* Enhanced result layout */
.result-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  margin-right: 12px;
}

.result-avatar img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.character-placeholder {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.relationship-indicator,
.location-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  border: 2px solid white;
}

.dropdown-text {
  flex: 1;
  min-width: 0;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.result-badges {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.match-badge {
  font-size: 12px;
  opacity: 0.7;
  background: rgba(0,0,0,0.05);
  padding: 2px 4px;
  border-radius: 4px;
  display: none; /* Hide for cleaner look */
}

.relevance-score {
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.2);
  display: none; /* Hide relevance scores */
}
/* Text styling improvements */
.dropdown-text strong {
  font-size: 1em;
  color: var(--text-color);
  font-weight: 600;
}

.character-title {
  font-style: italic;
  color: #64748b;
  font-size: 0.85em;
  margin-bottom: 6px;
  font-weight: 500;
}

.character-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.85em;
}

.status-badge {
  padding: 3px 8px;
  border-radius: 16px;
  font-size: 0.75em;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.character-preview,
.location-preview {
  font-size: 0.8em;
  color: #64748b;
  line-height: 1.4;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Highlight styling - more subtle */
mark {
  background-color: rgba(99, 102, 241, 0.2);
  color: #4f46e5;
  padding: 1px 3px;
  border-radius: 3px;
  font-weight: 600;
}

/* Hover effects */
.dropdown-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.dropdown-item:hover .result-avatar img,
.dropdown-item:hover .character-placeholder {
  transform: scale(1.05);
  transition: transform 0.2s ease;
}

/* Dark theme enhancements */
[data-theme="dark"] .dropdown-item.character-result {
  background: linear-gradient(90deg, #1e293b 0%, #334155 100%);
  border-left-color: #8b5cf6;
}

[data-theme="dark"] .dropdown-item.location-result {
  background: linear-gradient(90deg, #1e293b 0%, #334155 100%);
  border-left-color: #10b981;
}

[data-theme="dark"] .character-placeholder {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
}

[data-theme="dark"] .character-title {
  color: #94a3b8;
}

[data-theme="dark"] .character-preview,
[data-theme="dark"] .location-preview {
  color: #cbd5e0;
}

[data-theme="dark"] .relevance-score {
  background: rgba(139, 92, 246, 0.1);
  color: #a855f7;
  border-color: rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] mark {
  background-color: rgba(168, 85, 247, 0.3);
  color: #c4b5fd;
}
