/* reprodb-search.css — Styles for the main search / index page.
   Search box & hero styles are in reprodb-search-hero.css (shared). */

/* ── Search container ──────────────────────────────────────────────────── */
html { overflow-y: scroll; }
#search-container {
  width: 100%;
}

/* ── Filters / toolbar row ─────────────────────────────────────────── */
#filters {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
#filters select {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9em;
  background: #fff;
}
.rdb-search-status {
  margin-left: auto;
  font-size: 0.85em;
  color: #666;
  white-space: nowrap;
}
#sortSelect {
  font-size: 0.85em;
}

/* ── Icon action buttons ──────────────────────────────────────────── */
.rdb-action-btns {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}
.rdb-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  color: #555;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.rdb-icon-btn:hover {
  background: #f0f0f0;
  color: #333;
}
.rdb-icon-btn svg {
  display: block;
}

/* ── Profile cards (author/institution cards in search results) ─────── */
#profileCards {
  max-width: 720px;
  margin: 0 auto 16px;
}
.profile-cards-row { display:flex; flex-wrap:wrap; gap:12px; justify-content:center; }
.profile-card { display:flex; align-items:center; gap:8px; background:#fff; border:1px solid #e0e0e0; border-radius:10px; padding:8px 12px; min-width:180px; flex:1 1 0; text-decoration:none; color:inherit; transition: box-shadow 0.2s, border-color 0.2s; cursor:pointer; position:relative; }
.profile-card:hover { box-shadow:0 2px 12px rgba(0,0,0,0.10); border-color:#4285f4; }
.profile-card .avatar { width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:1.1em; font-weight:bold; color:#fff; flex-shrink:0; letter-spacing:-0.5px; }
.profile-card .avatar.author-avatar { background:#2980b9; }
.profile-card .avatar.inst-avatar { background:#27ae60; font-size:0.75em; }
.profile-card .card-info { overflow:hidden; min-width:0; }
.profile-card .card-name { font-weight:600; font-size:0.95em; word-wrap:break-word; overflow-wrap:break-word; }
.profile-card .card-detail { font-size:0.8em; color:#666; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.profile-card .card-stars { position:absolute; bottom:6px; right:8px; font-size:0.9em; }
.chair-stars-card { color:#d18c00; letter-spacing:0.02em; white-space:nowrap; }

/* ── Results ───────────────────────────────────────────────────────────── */
#noResults {
  padding: 16px;
  text-align: center;
  color: #999;
}
.rdb-result-entry { padding: 10px 0; }
.rdb-result-entry a { color: #0066cc; text-decoration: none; }
.rdb-result-title { font-weight: bold; font-size: 1em; line-height: 1.4; }
.rdb-result-authors { font-style: italic; color: #444; font-size: 0.92em; line-height: 1.4; margin-top: 2px; }
.rdb-result-meta { font-size: 0.9em; color: #555; margin-top: 2px; }
.rdb-result-links { font-size: 0.88em; margin-top: 2px; }
.rdb-badge { display: inline-block; padding: 1px 5px; margin: 0 2px; border-radius: 3px; background: #e8f5e9; font-size: 0.85em; }
.rdb-badge--award { background: #fff3e0; }

/* ── Pagination ────────────────────────────────────────────────────────── */
#pagination {
  margin-top: 12px;
  text-align: center;
}
#pagination button {
  padding: 6px 16px;
  margin: 0 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}
#pageInfo {
  margin: 0 10px;
  font-size: 0.95em;
}

/* ── Hidden data element ───────────────────────────────────────────────── */
#search-data-urls { display: none; }

/* ── Dark mode ─────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) #filters select { background: #1e2127; color: #d6d9dc; border-color: #4a4f57; }
  html:not([data-theme="light"]) .rdb-icon-btn { background: #1e2127; color: #d6d9dc; border-color: #4a4f57; }
  html:not([data-theme="light"]) .rdb-icon-btn:hover { background: #2a3038; color: #fff; }
  html:not([data-theme="light"]) #pagination button { background: #1e2127; color: #d6d9dc; border-color: #4a4f57; }
  html:not([data-theme="light"]) .profile-card { background: #23272d; border-color: #4a4f57; color: #d6d9dc; }
  html:not([data-theme="light"]) .profile-card:hover { border-color: #5a9cf5; }
  html:not([data-theme="light"]) .profile-card .card-detail { color: #aab0b8; }
  html:not([data-theme="light"]) .chair-stars-card { color: #f5c44c; }
  html:not([data-theme="light"]) .rdb-result-authors { color: #aab0b8; }
  html:not([data-theme="light"]) .rdb-result-meta { color: #aab0b8; }
  html:not([data-theme="light"]) .rdb-badge { background: #2e3d2e; color: #c8e6c9; }
  html:not([data-theme="light"]) .rdb-badge--award { background: #3d3525; color: #ffe0b2; }
  html:not([data-theme="light"]) .rdb-search-status { color: #aab0b8; }
  html:not([data-theme="light"]) #noResults { color: #888; }
}
html[data-theme="dark"] #filters select { background: #1e2127; color: #d6d9dc; border-color: #4a4f57; }
html[data-theme="dark"] .rdb-icon-btn { background: #1e2127; color: #d6d9dc; border-color: #4a4f57; }
html[data-theme="dark"] .rdb-icon-btn:hover { background: #2a3038; color: #fff; }
html[data-theme="dark"] #pagination button { background: #1e2127; color: #d6d9dc; border-color: #4a4f57; }
html[data-theme="dark"] .profile-card { background: #23272d; border-color: #4a4f57; color: #d6d9dc; }
html[data-theme="dark"] .profile-card:hover { border-color: #5a9cf5; }
html[data-theme="dark"] .profile-card .card-detail { color: #aab0b8; }
html[data-theme="dark"] .chair-stars-card { color: #f5c44c; }
html[data-theme="dark"] .rdb-result-authors { color: #aab0b8; }
html[data-theme="dark"] .rdb-result-meta { color: #aab0b8; }
html[data-theme="dark"] .rdb-badge { background: #2e3d2e; color: #c8e6c9; }
html[data-theme="dark"] .rdb-badge--award { background: #3d3525; color: #ffe0b2; }
html[data-theme="dark"] .rdb-search-status { color: #aab0b8; }
html[data-theme="dark"] #noResults { color: #888; }
