/* Galaxy Hub — Search */

.gh-search {
  position: relative;
  width: 100%;
}

.gh-search__form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.3rem 0.3rem 0.3rem 0;
  border: 2px solid var(--gh-border, #e5e7eb);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gh-search__form:focus-within {
  border-color: var(--gh-primary, #266ab4);
  box-shadow: 0 0 0 3px rgba(38, 106, 180, 0.12);
}

.gh-search__form:focus-within .gh-search__submit {
  box-shadow: 0 6px 18px rgba(38, 106, 180, 0.42);
}

.gh-search__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 1rem;
  color: #9ca3af;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.gh-search__input {
  flex: 1;
  border: none;
  padding: 0.75rem 0.65rem;
  font-size: 0.925rem;
  outline: none;
  background: transparent;
  min-width: 0;
  color: var(--gh-text, #111827);
}

.gh-search__input::-webkit-search-cancel-button,
.gh-search__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.gh-search__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 0.25rem;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease;
}

.gh-search__clear:hover {
  background: #e5e7eb;
  color: #374151;
}

.gh-search__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 1.2rem;
  min-height: 42px;
  margin-right: 0.05rem;
  border: none;
  border-radius: 11px;
  background: linear-gradient(135deg, #1a4f8a 0%, #266ab4 52%, #3b82f6 100%);
  color: #fff;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.01em;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(38, 106, 180, 0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.gh-search__submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 8px 22px rgba(38, 106, 180, 0.42);
}

.gh-search__submit:active {
  transform: translateY(0);
  filter: brightness(0.96);
  box-shadow: 0 3px 10px rgba(38, 106, 180, 0.28);
}

.gh-search__submit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.gh-search__submit:hover .gh-search__submit-icon {
  transform: translateX(2px);
}

.gh-search__panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 1200;
  background: #fff;
  border: 1px solid var(--gh-border, #e5e7eb);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.14);
  overflow: hidden;
}

.gh-search__panel-inner {
  max-height: min(70vh, 420px);
  overflow-y: auto;
}

.gh-search__group {
  padding: 0.65rem 0;
}

.gh-search__group + .gh-search__group {
  border-top: 1px solid #f3f4f6;
}

.gh-search__group-label {
  padding: 0.35rem 1rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ca3af;
}

.gh-search__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}

.gh-search__item:hover,
.gh-search__item.is-active {
  background: #f0f7ff;
}

.gh-search__item-photo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  flex-shrink: 0;
}

.gh-search__item-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: var(--gh-primary, #266ab4);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.gh-search__item-icon--brand {
  background: #fef3c7;
  color: #d97706;
}

.gh-search__item-body {
  flex: 1;
  min-width: 0;
}

.gh-search__item-title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gh-text, #111827);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gh-search__item-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--gh-muted, #6b7280);
  margin-top: 0.1rem;
}

.gh-search__empty,
.gh-search__loading {
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--gh-muted, #6b7280);
}

.gh-search__footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #f3f4f6;
  background: #fafbfc;
}

.gh-search__footer a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--gh-primary, #266ab4);
  text-decoration: none;
}

.gh-search__footer a:hover {
  color: var(--gh-primary-dark, #1a4f8a);
}

.gh-search__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 50px;
  border: 1px solid var(--gh-border, #e5e7eb);
  background: #fff;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--gh-text, #111827);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.gh-search__item-title mark {
  background: #fef3c7;
  color: inherit;
  padding: 0 0.1rem;
  border-radius: 3px;
}

.gh-search__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.35rem 1rem 0.75rem;
}

.gh-search__submit:hover .gh-search__submit-icon {
  transform: translateX(2px);
}

.gh-search--large .gh-search__form {
  padding: 0.35rem;
  padding-left: 0;
}

.gh-search--large .gh-search__input {
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  font-size: 1rem;
}

.gh-search--large .gh-search__submit {
  min-height: 48px;
  padding: 0 1.45rem;
  border-radius: 12px;
  font-size: 0.925rem;
}

.gh-search.is-open .gh-search__form {
  border-color: var(--gh-primary, #266ab4);
  box-shadow: 0 0 0 3px rgba(38, 106, 180, 0.12);
}

/* Header integration */
.gh-header__search-wrap {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.gh-header__search-wrap .gh-search__form {
  border-color: #bfdbfe;
  background: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}

.gh-header__search-wrap .gh-search__submit {
  min-height: 42px;
  padding: 0 1.15rem;
  border-radius: 10px;
}

/* Search results page */
.gh-search-page__bar {
  background: #fff;
  border-bottom: 1px solid var(--gh-border, #e5e7eb);
  padding: 1.25rem 0 1.5rem;
}

.gh-search-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--gh-border, #e5e7eb);
  border-radius: var(--gh-radius, 14px);
}

.gh-search-toolbar__count {
  font-size: 0.875rem;
  color: var(--gh-muted, #6b7280);
}

.gh-search-toolbar__count strong {
  color: var(--gh-text, #111827);
  font-weight: 700;
}

.gh-search-toolbar__sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  color: var(--gh-muted, #6b7280);
}

.gh-search-toolbar__sort select {
  border: 1px solid var(--gh-border, #e5e7eb);
  border-radius: 10px;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--gh-text, #111827);
  background: #fff;
  cursor: pointer;
}

.gh-search-toolbar__sort select:focus {
  outline: none;
  border-color: var(--gh-primary, #266ab4);
  box-shadow: 0 0 0 3px rgba(38, 106, 180, 0.1);
}

.gh-search-query {
  display: inline;
  padding: 0.1rem 0.45rem;
  background: #eff6ff;
  border-radius: 6px;
  color: var(--gh-primary-dark, #1a4f8a);
  font-weight: 600;
}

.gh-search-suggestions {
  margin-top: 1.5rem;
}

.gh-search-suggestions__title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gh-muted, #6b7280);
  margin: 0 0 0.75rem;
}

.gh-search-suggestions__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.gh-search-modal .modal-body {
  overflow: visible;
}

@media (max-width: 575px) {
  .gh-search--large .gh-search__submit-text {
    display: none;
  }

  .gh-search--large .gh-search__submit {
    width: 48px;
    padding: 0;
  }

  .gh-search-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .gh-search-toolbar__sort {
    justify-content: space-between;
  }

  .gh-search-toolbar__sort select {
    flex: 1;
    max-width: 220px;
  }
}
