/* Custom search styles */

.search-container {
  margin-top: var(--spacing-lg);
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-input {
  background-color: #161b22;
  border: 1px solid #30363d;
  color: #c9d1d9;
  padding: 0.75rem 3rem 0.75rem 1rem;
  font-size: 1rem;
  width: 100%;
  border-radius: 6px;
}

.search-input:focus {
  outline: 2px solid #58a6ff;
  outline-offset: 2px;
  border-color: #58a6ff;
}

.search-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.search-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #8b949e;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  border-radius: 3px;
}

.search-clear:hover {
  background: #30363d;
  color: #c9d1d9;
}

.search-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.section-filter {
  background-color: #21262d;
  border: 1px solid #30363d;
  color: #8b949e;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.section-filter:hover {
  background-color: #30363d;
  color: #c9d1d9;
}

.section-filter.active {
  background-color: #58a6ff;
  border-color: #58a6ff;
  color: #ffffff;
}

.search-count {
  color: #8b949e;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.search-result {
  /* No bottom border or padding */
}

.search-result-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.search-result-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
}

.search-result-title a {
  color: #58a6ff;
  text-decoration: none;
}

.search-result-title a:hover {
  color: #79c0ff;
  text-decoration: underline;
}

.search-result-section {
  background-color: #21262d;
  color: #8b949e;
  padding: 0.25rem 0.625rem;
  border-radius: 3px;
  font-size: 0.8125rem;
  text-transform: capitalize;
  border: 1px solid #30363d;
  white-space: nowrap;
}

.search-result-section.section-blog {
  background-color: #1f6feb26;
  border-color: #1f6feb;
  color: #58a6ff;
}

.search-result-section.section-notes {
  background-color: #9e6a0326;
  border-color: #9e6a03;
  color: #d29922;
}

.search-result-section.section-projects {
  background-color: #8957e526;
  border-color: #8957e5;
  color: #a371f7;
}

.search-result-date {
  color: #8b949e;
  font-size: 0.875rem;
  display: block;
  margin-bottom: 0.5rem;
}

.search-result-excerpt {
  color: #8b949e;
  line-height: 1.6;
  margin: 0.5rem 0;
}

.search-result-excerpt mark {
  background-color: #388bfd26;
  color: #79c0ff;
  padding: 0.1em 0.25em;
  border-radius: 3px;
  font-weight: 500;
}

.search-result-excerpt code {
  background-color: #161b22;
  color: #e6edf3;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  border: 1px solid #30363d;
}

.search-result-excerpt pre {
  background-color: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 0.75rem;
  overflow-x: auto;
  margin: 0.5rem 0;
}

.search-result-excerpt pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  display: block;
}

.search-result-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.search-result-tags .tag {
  background-color: #21262d;
  color: #8b949e;
  padding: 0.25rem 0.625rem;
  border-radius: 3px;
  font-size: 0.8125rem;
  border: 1px solid #30363d;
}

.search-no-results,
.search-error {
  color: #8b949e;
  padding: 2rem 0;
  text-align: center;
}

.search-error {
  color: #f85149;
}
