.search-wrapper {
  --search-text: #1e3049;
  --search-muted: #718096;
  --search-border: #dce4ed;
  --search-accent: #315f9d;
  --search-accent-hover: #234a7e;
  --search-soft: #f3f6fa;
  --search-highlight: #fff0b8;
  width: 100%;
  max-width: 850px;
  margin: 45px auto;
  padding: 0 18px;
  color: var(--search-text);
  background: transparent;
  color-scheme: light;
}

[data-bs-theme="dark"] .search-wrapper {
  --search-text: #edf2f8;
  --search-muted: #a4b1c3;
  --search-border: #39475a;
  --search-accent: #78aef2;
  --search-accent-hover: #9ac4fa;
  --search-soft: #222e40;
  --search-highlight: #55471f;
  color-scheme: dark;
}

.search-heading {
  text-align: center;
  margin-bottom: 28px;
}

.search-heading h2 {
  color: var(--search-text);
  font-size: clamp(28px, 4vw, 39px);
  font-weight: 800;
  letter-spacing: -1.3px;
  line-height: 1.2;
  margin-bottom: 12px;
}

.search-heading p {
  color: var(--search-muted);
  font-size: 15px;
  line-height: 1.8;
  max-width: 590px;
  margin: auto;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 8px 7px 21px;
  background: transparent;
  border: 1px solid var(--search-border);
  border-radius: 50px;
  box-shadow: 0 5px 20px rgba(40, 60, 90, 0.045);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-field:focus-within {
  border-color: var(--search-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--search-accent) 12%, transparent);
}

.search-icon {
  color: var(--search-muted);
  font-size: 19px;
  flex-shrink: 0;
}

.search-field input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--search-text) !important;
  font-size: 15px;
}

.search-field input::placeholder {
  color: var(--search-muted);
  opacity: 0.85;
}

.search-button {
  border: none;
  border-radius: 50px;
  background: var(--search-accent);
  color: #fff;
  padding: 13px 27px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.search-button:hover {
  background: var(--search-accent-hover);
  color: white;
}

.search-button:active {
  transform: scale(0.97);
}

.popular-searches {
  margin-top: 22px;
}

.popular-searches > span {
  display: block;
  color: var(--search-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.topic-list button {
  padding: 8px 15px;
  border: 1px solid var(--search-border);
  border-radius: 30px;
  background: transparent;
  color: var(--search-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.topic-list button:hover {
  color: var(--search-accent);
  border-color: var(--search-accent);
  background: var(--search-soft);
}

.search-wrapper .search-results {
  display: none !important;
}

.search-wrapper .search-results.is-visible {
  display: block !important;
  margin-top: 28px;
  border: 1px solid var(--search-border);
  border-radius: 16px;
  background: transparent;
  color: var(--search-text);
  overflow: hidden;
  box-shadow: 0 6px 25px rgba(40, 60, 90, 0.045);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 19px 22px;
  background: var(--search-soft);
  border-bottom: 1px solid var(--search-border);
}

.results-label {
  display: block;
  color: var(--search-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.results-summary {
  color: var(--search-text);
  font-size: 18px;
  font-weight: 750;
  margin-top: 4px;
}

.results-query {
  padding: 13px 22px;
  background: transparent;
  border-bottom: 1px solid var(--search-border);
  color: var(--search-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.results-query strong {
  color: var(--search-accent);
}

.search-wrapper .search-results ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-wrapper .search-result-item {
  padding: 22px;
  background: transparent;
  border-bottom: 1px solid var(--search-border);
  transition: background 0.2s;
}

.search-wrapper .search-result-item:hover {
  background: var(--search-soft);
}

.search-wrapper .search-result-item a {
  display: inline-block;
  color: var(--search-accent) !important;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.5;
  text-decoration: none;
  margin-bottom: 8px;
}

.search-wrapper .search-result-item a:hover {
  text-decoration: underline;
}

.search-wrapper .search-result-item p {
  color: var(--search-muted);
  font-size: 14px;
  line-height: 1.8;
  margin: 0;
}

.search-wrapper .search-result-item p strong {
  color: var(--search-text);
  background: var(--search-highlight);
  padding: 2px 4px;
  border-radius: 3px;
}

.clear-search-results {
  border: 1px solid var(--search-border);
  border-radius: 9px;
  background: transparent;
  color: var(--search-muted);
  padding: 8px 13px;
  font-size: 12px;
  cursor: pointer;
}

.clear-search-results:hover {
  color: var(--search-accent);
  border-color: var(--search-accent);
}

.search-wrapper .search-footer {
  padding: 13px 20px;
  color: var(--search-muted);
  background: var(--search-soft);
  text-align: right;
  font-size: 11px;
}

.search-wrapper .search-error {
  margin-top: 14px;
  padding: 13px 16px;
  color: var(--search-text);
  background: var(--search-soft);
  border: 1px solid var(--search-border);
  border-radius: 11px;
}

.search-wrapper button:focus-visible, .search-wrapper a:focus-visible {
  outline: 3px solid var(--search-accent);
  outline-offset: 3px;
}

@media (max-width: 576px) {
  .search-wrapper {
    margin: 28px auto;
    padding: 0 12px;
  }
}

@media (max-width: 576px) {
  .search-heading h2 {
    font-size: 28px;
  }
}

@media (max-width: 576px) {
  .search-heading p {
    font-size: 14px;
  }
}

@media (max-width: 576px) {
  .search-field {
    padding-left: 15px;
    gap: 8px;
  }
}

@media (max-width: 576px) {
  .search-field input {
    font-size: 14px;
    height: 43px;
  }
}

@media (max-width: 576px) {
  .search-button {
    padding: 12px 17px;
    font-size: 13px;
  }
}

@media (max-width: 576px) {
  .search-wrapper .search-result-item {
    padding: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .search-wrapper *, .search-wrapper *::before, .search-wrapper *::after {
    transition: none !important;
  }
}

