/* reprodb-profile.css — Styles for the unified profile page and profile_common.
   Search box & hero base styles are in reprodb-search-hero.css (shared). */

/* ── Profile-specific hero overrides ───────────────────────────────────── */
.profile-search-hero {
  min-height: 40vh;
}
.profile-search-hero.has-profile {
  min-height: 0;
  padding-top: 8px;
  padding-bottom: 0;
}
.profile-search-hero-inner {
  max-width: 600px;
}
.profile-search-hero.has-profile .profile-search-hero-inner {
  max-width: 480px;
}
.profile-search-heading {
  font-size: 1.4em;
  font-weight: 400;
  margin-bottom: 16px;
  transition: font-size 0.4s ease, margin 0.4s ease, opacity 0.3s ease;
}
.profile-search-hero.has-profile .profile-search-heading {
  font-size: 0;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  height: 0;
}

/* ── Autocomplete results ──────────────────────────────────────────────── */
.profile-search-results { list-style:none; padding:0; margin:4px 0 0 0; max-height:260px; overflow-y:auto; border:1px solid #ddd; border-radius:12px; position:absolute; background:#fff; z-index:100; width:100%; box-shadow: 0 4px 16px rgba(0,0,0,0.10); }
.profile-search-results li { padding:8px 14px; cursor:pointer; border-bottom:1px solid #f0f0f0; }
.profile-search-results li:hover,
.profile-search-results li.active { background:#e8f4f8; }
.profile-search-results .sr-detail { font-size:0.82em; color:#666; }
.profile-search-results .sr-detail-indent { margin-left:58px; }

/* ── Profile layout ────────────────────────────────────────────────────── */
.profile-container { margin-top:20px; }
.profile-header { margin-bottom:18px; }
.profile-header h2 { margin-bottom:2px; display:inline; }
.profile-header .affil { color:#555; font-size:0.95em; }

/* Score cards now use shared .rdb-cards / .rdb-card from reprodb-charts.css */

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge-tag { display:inline-block; padding:2px 8px; border-radius:3px; font-size:0.8em; margin:1px 2px; color:#fff; }
.badge-available { background:#3498db; }
.badge-functional { background:#27ae60; }
.badge-reproducible,
.badge-reproduced,
.badge-reusable { background:#8e44ad; }

/* ── Chart ─────────────────────────────────────────────────────────────── */
.chart-container { max-width:1050px; margin:16px 0; position:relative; height:290px; }

/* ── Loading ───────────────────────────────────────────────────────────── */
.profile-loading { color:#888; font-style:italic; text-align:center; padding:2em 0; }

/* ── Share button ──────────────────────────────────────────────────────── */
.share-btn { display:inline-block; margin-left:10px; padding:3px 10px; font-size:0.7em; cursor:pointer; background:#f0f0f0; border:1px solid #ccc; border-radius:4px; color:#555; vertical-align:middle; position:relative; }
.share-btn:hover { background:#e0e0e0; }
.share-btn .share-tip { display:none; position:absolute; bottom:125%; left:50%; transform:translateX(-50%); background:#333; color:#fff; font-size:0.85em; padding:4px 8px; border-radius:4px; white-space:nowrap; z-index:100; pointer-events:none; }
.share-btn.copied .share-tip { display:block; }

/* ── Tables (shared) ──────────────────────────────────────────────────── */
.profile-table { font-size:0.88em; border-collapse:collapse; width:100%; margin:10px 0; }
.profile-table th,
.profile-table td { padding:6px 10px; border:1px solid #ddd; text-align:left; }
.profile-table th { background:#f2f2f2; white-space:nowrap; }
.profile-table tr:nth-child(even) { background:#fafafa; }

/* ── Availability warnings ─────────────────────────────────────────────── */
.avail-warn { position:relative; cursor:help; font-size:0.8em; color:#b26a00; background:#fff8e1; padding:1px 5px; border-radius:3px; border:1px solid #ffe0b2; }
.avail-warn .avail-tip { display:none; position:absolute; bottom:125%; left:50%; transform:translateX(-50%); background:#333; color:#fff; font-size:0.85em; padding:4px 8px; border-radius:4px; white-space:nowrap; z-index:100; pointer-events:none; }
.avail-warn:hover .avail-tip { display:block; }

/* ── Author-specific ───────────────────────────────────────────────────── */
.ae-table { font-size:0.88em; border-collapse:collapse; width:100%; margin:10px 0; }
.ae-table th,
.ae-table td { padding:6px 10px; border:1px solid #ddd; text-align:left; }
.ae-table th { background:#f2f2f2; }
.ae-table tr:nth-child(even) { background:#fafafa; }
.category-tag { display:inline-block; padding:1px 7px; border-radius:3px; font-size:0.78em; color:#fff; margin-left:6px; }
.cat-systems { background:#2980b9; }
.cat-security { background:#c0392b; }
.cat-both { background:#8e44ad; }

/* ── Institution-specific ──────────────────────────────────────────────── */
.inst-table { font-size:0.88em; border-collapse:collapse; width:100%; margin:10px 0; }
.inst-table th,
.inst-table td { padding:6px 10px; border:1px solid #ddd; text-align:left; }
.inst-table th { background:#f2f2f2; white-space:nowrap; cursor:pointer; }
.inst-table tr:nth-child(even) { background:#fafafa; }
.inst-table tr:hover { background:#e8f4f8; }
.ae-detail-row td { padding:4px 10px 12px 30px; background:#f9f9f9; }
.ae-detail-row:hover { background:#f9f9f9; }
.ae-inline-table { font-size:0.9em; border-collapse:collapse; width:auto; margin:4px 0; }
.ae-inline-table th,
.ae-inline-table td { padding:3px 8px; border:1px solid #e0e0e0; text-align:left; }
.ae-inline-table th { background:#eee; }
.ae-toggle { text-decoration:underline; cursor:pointer; }
.pag-controls { margin:8px 0; font-size:0.9em; }
.pag-controls button { padding:2px 8px; font-size:0.9em; }
.pag-controls span { margin:0 8px; }
.role-tag { display:inline-block; padding:1px 7px; border-radius:3px; font-size:0.78em; color:#fff; margin-left:6px; }
.role-balanced { background:#8e44ad; }
.role-artifact { background:#2980b9; }
.role-evaluation { background:#27ae60; }

/* Chair-star indicator used in author/institution profile cards and tables. */
.chair-stars {
  color: #d18c00;
  letter-spacing: 0.02em;
  white-space: nowrap;
  margin-bottom: 0.3em;
}

.profile-name-stars {
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  line-height: 1;
}

/* ── Unified search result type labels ─────────────────────────────────── */
.sr-type { display:inline-block; padding:1px 6px; border-radius:3px; font-size:0.72em; color:#fff; margin-right:6px; vertical-align:middle; }
.sr-type-author { background:#2980b9; }
.sr-type-inst { background:#27ae60; }

/* ── Collapsible ranking history ───────────────────────────────────────── */
.ranking-history-details summary { cursor:pointer; list-style:none; }
.ranking-history-details summary::-webkit-details-marker { display:none; }
.ranking-history-details summary h3 { display:inline; }
.ranking-history-details summary::before { content:'▶ '; font-size:0.8em; color:#555; }
.ranking-history-details[open] summary::before { content:'▼ '; }

/* ── Dark-mode overrides ───────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .profile-search-heading { color: #aab0b8; }
  html:not([data-theme="light"]) .profile-search-results {
    background: #1e2127; border-color: #4a4f57; color: #d6d9dc; box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  }
  html:not([data-theme="light"]) .profile-search-results li { border-bottom-color: #383c43; color: #d6d9dc; }
  html:not([data-theme="light"]) .profile-search-results li:hover,
  html:not([data-theme="light"]) .profile-search-results li.active { background: #2a3038; }
  html:not([data-theme="light"]) .profile-search-results .sr-detail { color: #aab0b8; }
  html:not([data-theme="light"]) .profile-header .affil { color: #aab0b8; }
  html:not([data-theme="light"]) .share-btn { background: #23272d; border-color: #4a4f57; color: #aab0b8; }
  html:not([data-theme="light"]) .share-btn:hover { background: #2a3038; }
  html:not([data-theme="light"]) .profile-table th,
  html:not([data-theme="light"]) .ae-table th,
  html:not([data-theme="light"]) .inst-table th,
  html:not([data-theme="light"]) .ae-inline-table th { background: #23272d; color: #d6d9dc; border-color: #4a4f57; }
  html:not([data-theme="light"]) .profile-table td,
  html:not([data-theme="light"]) .ae-table td,
  html:not([data-theme="light"]) .inst-table td,
  html:not([data-theme="light"]) .ae-inline-table td { border-color: #4a4f57; color: #d6d9dc; }
  html:not([data-theme="light"]) .profile-table tr:nth-child(even),
  html:not([data-theme="light"]) .ae-table tr:nth-child(even),
  html:not([data-theme="light"]) .inst-table tr:nth-child(even) { background: #23272d; }
  html:not([data-theme="light"]) .inst-table tr:hover { background: #2a3038; }
  html:not([data-theme="light"]) .ae-detail-row td,
  html:not([data-theme="light"]) .ae-detail-row:hover { background: #23272d; }
  html:not([data-theme="light"]) .ranking-history-details summary::before { color: #aab0b8; }
  html:not([data-theme="light"]) .avail-warn { color: #f0c040; background: #332b00; border-color: #665500; }
}
html[data-theme="dark"] .profile-search-heading { color: #aab0b8; }
html[data-theme="dark"] .profile-search-results {
  background: #1e2127; border-color: #4a4f57; color: #d6d9dc; box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
html[data-theme="dark"] .profile-search-results li { border-bottom-color: #383c43; color: #d6d9dc; }
html[data-theme="dark"] .profile-search-results li:hover,
html[data-theme="dark"] .profile-search-results li.active { background: #2a3038; }
html[data-theme="dark"] .profile-search-results .sr-detail { color: #aab0b8; }
html[data-theme="dark"] .profile-header .affil { color: #aab0b8; }
html[data-theme="dark"] .share-btn { background: #23272d; border-color: #4a4f57; color: #aab0b8; }
html[data-theme="dark"] .share-btn:hover { background: #2a3038; }
html[data-theme="dark"] .profile-table th,
html[data-theme="dark"] .ae-table th,
html[data-theme="dark"] .inst-table th,
html[data-theme="dark"] .ae-inline-table th { background: #23272d; color: #d6d9dc; border-color: #4a4f57; }
html[data-theme="dark"] .profile-table td,
html[data-theme="dark"] .ae-table td,
html[data-theme="dark"] .inst-table td,
html[data-theme="dark"] .ae-inline-table td { border-color: #4a4f57; color: #d6d9dc; }
html[data-theme="dark"] .profile-table tr:nth-child(even),
html[data-theme="dark"] .ae-table tr:nth-child(even),
html[data-theme="dark"] .inst-table tr:nth-child(even) { background: #23272d; }
html[data-theme="dark"] .inst-table tr:hover { background: #2a3038; }
html[data-theme="dark"] .ae-detail-row td,
html[data-theme="dark"] .ae-detail-row:hover { background: #23272d; }
html[data-theme="dark"] .ranking-history-details summary::before { color: #aab0b8; }
html[data-theme="dark"] .avail-warn { color: #f0c040; background: #332b00; border-color: #665500; }
html[data-theme="dark"] .chair-stars { color: #f5c44c; }
