/* ---------- Search bar ---------- */
.search-bar {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-bar__input-wrap {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 0 0.75rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color var(--transition), background var(--transition);
}
.search-bar__input-wrap:focus-within {
  border-color: rgba(79, 142, 247, 0.70);
  background: rgba(255, 255, 255, 0.10);
}

.theme-light .search-bar__input-wrap {
  background: rgba(255, 255, 255, 0.60);
  border: 1px solid rgba(0, 0, 0, 0.10);
}
.theme-light .search-bar__input-wrap:focus-within {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.80);
}

.search-bar__icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-bar__input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 0.5rem 0.5rem;
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
}
.search-bar__input::placeholder { color: var(--text-muted); }

.search-bar__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.search-bar__error {
  color: #ff6b6b;
  font-size: 0.8rem;
  margin-top: 0.25rem;
  padding: 0 0.5rem;
}

/* ---------- Search dropdown ---------- */
.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(18, 22, 35, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-sm);
  list-style: none;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.50);
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
}

.theme-light .search-dropdown {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.search-dropdown__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: background var(--transition);
  gap: 1rem;
}
.search-dropdown__item:hover { background: var(--surface-2); }
.search-dropdown__item--disabled {
  cursor: not-allowed;
  opacity: 0.7;
}
.search-dropdown__item--disabled:hover {
  background: transparent;
}
.search-dropdown__item + .search-dropdown__item {
  border-top: 1px solid var(--border);
}

.search-dropdown__section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 0.5rem 1rem 0.25rem;
  list-style: none;
}

.search-dropdown__name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.search-dropdown__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.search-dropdown__aqi {
  background: var(--surface-2);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-weight: 600;
  color: var(--text);
}
