/* Search Container */
.search-container {
  position: relative;
  flex: 1;
  max-width: 600px;
  margin: 0 2rem;
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 400px;
  overflow-y: auto;
  z-index: 9999;
  margin-top: 3px;
}

.search-results.hidden {
  display: none;
}

/* Search Result Item */
.search-result-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-decoration: none;
  color: inherit;
}

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

.search-result-item:hover {
  background-color: #f8f9fa;
}

.search-result-title {
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 6px;
  font-size: 14px;
}

.search-result-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #666;
}

.search-result-category {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  color: #2e7d32;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.search-result-notes,
.search-result-views {
  color: #666;
}

.search-result-rating {
  color: #f59e0b;
  font-weight: 600;
}

/* Loading and Empty States */
.search-loading,
.search-no-results,
.search-error {
  padding: 16px;
  text-align: center;
  color: #666;
  font-size: 14px;
}

.search-loading {
  font-style: italic;
  animation: pulse 1.5s ease-in-out infinite;
}

.search-error {
  color: #dc2626;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* Scrollbar Styling */
.search-results::-webkit-scrollbar {
  width: 8px;
}

.search-results::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 0 0 8px 0;
}

.search-results::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Responsive */
@media (max-width: 768px) {
  .search-container {
    margin: 0 1rem;
  }
  
  .search-results {
    max-height: 300px;
  }
}
