body {
  background-color: white;
}

.page-title {
  margin-left: 20px;

}

.non-target-section {
  font-size: 0.9em;
  color: #666;
  font-style: italic;
  margin-bottom: 0.5em;
  border-left: 3px solid #ccc;
  padding-left: 0.5em;
}

.search-container {
  max-width: 900px;
  margin: 0 auto;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.search-intro {
  margin-bottom: 2rem;
}

.search-form {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f5f5f5;
  border-radius: 0.5rem;
}

.search-input-container {
  display: flex;
  margin-bottom: 1.5rem;
  position: relative;
}

#search-input {
  flex: 1;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-right: none;
  border-radius: 0.25rem 0 0 0.25rem;
}

.search-button {
  padding: 0.75rem 1.5rem;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 0 0.25rem 0.25rem 0;
  cursor: pointer;
}

.search-button:hover {
  background: #0055aa;
}

.search-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.filter-section h3 {
  font-size: 0.9rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #555;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group {
  display: flex;
  align-items: center;
}

.filter-group label {
  font-size: 0.9rem;
  color: #333;
}

.date-range {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.date-range input, #location-filter, #sort-select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  font-size: 0.9rem;
}

.search-results {
  min-height: 200px;
}

.search-start {
  text-align: center;
  color: #666;
  padding: 3rem 1rem;
  background: #f9f9f9;
  border-radius: 0.5rem;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.export-buttons {
  margin-bottom: 1.5rem;
}

.export-buttons button {
  padding: 0.5rem 1rem;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.export-buttons button:hover {
  background: #e0e0e0;
}

.search-results-list {
  margin-bottom: 2rem;
}

.search-result-item {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid #eee;
  border-radius: 0.5rem;
  background: white;
  transition: box-shadow 0.2s, transform 0.2s;
}

.search-result-item:hover {
  box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.result-title {
  display: block;
  font-size: 1.25rem;
  color: #0066cc;
  text-decoration: none;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.result-title:hover {
  text-decoration: underline;
}

.notebook-number {
  font-weight: 600;
}

.result-metadata {
  font-size: 1rem;
  color: #444;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-left: 4px solid #0066cc;
  background-color: #f8fafe;
  border-radius: 0 0.25rem 0.25rem 0;
}

.result-date {
  color: #0066cc;
  font-weight: 600;
}

.result-locations {
  color: #666;
}

.result-locations::before {
  content: "📍 ";
  margin-right: 0.25rem;
}

.publication-info {
  font-style: italic;
  color: #555;
  font-weight: 400;
  padding: 0.25rem 0.5rem;
  background-color: #f0f8ff;
  border-radius: 0.25rem;
  font-size: 0.9rem;
}

.result-excerpt {
  margin-bottom: 1rem;
  line-height: 1.6;
  font-size: 0.9375rem;
  color: #333;
  padding: 0.75rem 1rem;
  background-color: #fefefe;
  border: 1px solid #f0f0f0;
  border-radius: 0.25rem;
  font-style: italic;
}

.result-score {
  font-size: 0.75rem;
  color: #999;
}

.highlight {
  background-color: #fffdd0;
  padding: 0.125rem 0;
  border-radius: 0.125rem;
  font-weight: bold;
}

.search-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.pagination-prev, .pagination-next {
  padding: 0.5rem 1rem;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.pagination-prev:hover, .pagination-next:hover {
  background: #0055aa;
}

.pagination-info {
  font-size: 0.875rem;
  color: #666;
}

.no-results, .search-error {
  text-align: center;
  padding: 2rem;
  font-style: italic;
  color: #666;
  background: #f9f9f9;
  border-radius: 0.5rem;
}

.snippet-separator {
  color: #999;
  font-size: 1.2rem;
  margin: 0 0.25rem;
  display: inline-block;
}

/* Improved spacing between snippets */
.result-excerpt br {
  display: block;
  content: "";
  margin-top: 0.75rem;
}

/* Status badges */
.status-badge {
  font-size: 0.75em;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 12px;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.unedited-badge {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fbbf24;
}

.transcribed-badge {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

/* Optional: Style the entire result item differently for unedited notebooks */
.search-result-item.unedited-notebook {
  border-left: 3px solid #fbbf24;
  background-color: #fffbeb;
}

/* Status explanation text */
.status-explanation {
  color: #6b7280;
  font-style: italic;
  font-size: 0.9em;
}

.status-explanation::before {
  content: " ";
  margin: 0 8px;
}

/* Autocomplete suggestions styling */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 40px; /* Account for search button width */
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 0.25rem 0.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.suggestion-item {
  padding: 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.suggestion-item:hover,
.suggestion-item.active {
  background-color: #f5f5f5;
}

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

@media (max-width: 768px) {
  .search-filters {
    grid-template-columns: 1fr;
  }

  .search-input-container {
    flex-direction: column;
    gap: 0.5rem;
  }

  #search-input {
    border-right: 1px solid #ddd;
    border-radius: 0.25rem;
  }

  .search-button {
    border-radius: 0.25rem;
  }

  .search-suggestions {
    right: 0; /* Full width on mobile */
  }
}

/* Separate snippet sections styling */
.excerpt-section {
  margin-bottom: 1rem;
}

.excerpt-section:last-child {
  margin-bottom: 0;
}

.excerpt-section-header {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.excerpt-section-content {
  padding: 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Headnote section styling */
.headnote-section .excerpt-section-header {
  color: #1e40af;
}

.headnote-section .excerpt-section-content {
  background-color: #eff6ff;
  border-left: 4px solid #3b82f6;
  border-radius: 0 0.375rem 0.375rem 0;
}

/* Content section styling */
.content-section .excerpt-section-header {
  color: #059669;
}

.content-section .excerpt-section-content {
  background-color: #f0fdf4;
  border-left: 4px solid #10b981;
  border-radius: 0 0.375rem 0.375rem 0;
}

/* More hits info styling for sections */
.more-hits-info {
  font-size: 0.8125rem;
  color: #6b7280;
  font-style: italic;
  margin-top: 0.5rem;
  padding: 0.375rem 0.75rem;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 0.25rem;
  text-align: center;
}

.headnote-more-hits {
  background-color: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.content-more-hits {
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.overall-more-hits {
  font-weight: 600;
  background-color: rgba(107, 114, 128, 0.1);
  border: 1px solid rgba(107, 114, 128, 0.2);
  margin-top: 1rem;
}
