/* ================================================================
   AnimeOshi SSG — ao.css
   Shared chrome styles for all SSG pages.
   Requires: ao-external.v1.css (design tokens + base reset)
   ================================================================ */

/* ── Search bar (in header) ───────────────────────────────────── */

#ao-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 320px;
  margin: 0 8px;
}

#ao-search-form {
  display: flex;
  align-items: center;
  width: 100%;
  background: rgba(237, 237, 237, 0.08);
  border: 1px solid rgba(237, 237, 237, 0.12);
  border-radius: 100px;
  padding: 6px 14px;
  gap: 8px;
  transition: border-color 0.2s;
  cursor: text;
}

#ao-search-form:focus-within {
  border-color: rgba(237, 237, 237, 0.4);
}

#ao-search-input {
  background: none;
  border: none;
  outline: none;
  color: #ededed;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  width: 100%;
  cursor: text;
}

#ao-search-input::placeholder {
  color: rgba(237, 237, 237, 0.4);
}

/* ── Search overlay ───────────────────────────────────────────── */

#ao-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: flex-start;
  justify-content: center;
}

#ao-search-overlay.open {
  display: flex;
}

#ao-search-sheet {
  background: hsl(271, 45%, 9%);
  width: 100%;
  max-width: 680px;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  max-height: 90vh;
  overflow-y: auto;
}

#ao-search-overlay-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(237, 237, 237, 0.08);
}

#ao-search-overlay-back {
  background: none;
  border: none;
  color: rgba(237, 237, 237, 0.7);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#ao-search-overlay-back:hover {
  background: rgba(237, 237, 237, 0.08);
}

#ao-overlay-form {
  display: flex;
  align-items: center;
  flex: 1;
  background: rgba(237, 237, 237, 0.08);
  border: 1px solid rgba(237, 237, 237, 0.12);
  border-radius: 100px;
  padding: 8px 14px;
  gap: 8px;
}

#ao-overlay-form:focus-within {
  border-color: rgba(237, 237, 237, 0.35);
}

#ao-overlay-input {
  background: none;
  border: none;
  outline: none;
  color: #ededed;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  width: 100%;
}

#ao-overlay-input::placeholder {
  color: rgba(237, 237, 237, 0.4);
}

#ao-overlay-submit {
  background: rgba(237, 237, 237, 0.1);
  border: none;
  color: #ededed;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
}

#ao-overlay-submit:hover {
  background: rgba(237, 237, 237, 0.18);
}

#ao-search-overlay-body {
  padding: 20px 16px;
}

/* ── Trending section ─────────────────────────────────────────── */

.ao-trending-section h2 {
  font-size: 14px;
  font-weight: 700;
  color: rgba(237, 237, 237, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.ao-trending-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ao-trending-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s;
}

.ao-trending-btn:hover {
  background: rgba(237, 237, 237, 0.08);
}

.ao-trending-rank {
  font-size: 14px;
  font-weight: 700;
  color: rgba(237, 237, 237, 0.35);
  min-width: 20px;
  text-align: center;
}

.ao-trending-query {
  font-size: 15px;
  font-weight: 500;
  color: #ededed;
  flex: 1;
}

.ao-trending-boost {
  font-size: 12px;
  font-weight: 600;
  color: #ededed;
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0.7;
}

.ao-trending-loading {
  padding: 8px;
  font-size: 13px;
  color: rgba(237, 237, 237, 0.4);
  list-style: none;
}

/* ── Search results ───────────────────────────────────────────── */

.ao-overlay-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ao-overlay-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: #ededed;
  transition: background 0.15s;
}

.ao-overlay-result-item:hover {
  background: rgba(237, 237, 237, 0.08);
}

.ao-overlay-result-item img {
  width: 40px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: rgba(237, 237, 237, 0.08);
}

.ao-overlay-result-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ao-overlay-result-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ao-overlay-result-sub {
  font-size: 12px;
  color: rgba(237, 237, 237, 0.5);
}

.ao-sr-empty {
  padding: 14px;
  font-size: 13px;
  color: rgba(237, 237, 237, 0.4);
  text-align: center;
}
