/* ============================================
   css/topbar.css
   Top utility bar — logo (real image) + links
   ============================================ */

.topbar {
  background: #080808;
  border-bottom: 1px solid var(--color-border);
  padding: 8px var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

/* ── Logo image ── */
.topbar__logo {
  display: flex;
  align-items: center;
}

.topbar__logo img {
  height: 45px;
  width: auto;
  object-fit: contain;
  display: block;
  /* keep crisp on dark bg */
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.6));
}

/* ── Right-side user links ── */
.topbar__links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--color-text-muted);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.topbar__link:hover {
  color: var(--color-green);
  background: rgba(76,175,80,0.07);
}

.topbar__link .tb-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.72;
}

/* standalone magnifier icon on far right */
.topbar__link--icon-only {
  padding: 5px 8px;
  border-left: 1px solid var(--color-border);
  margin-left: 4px;
}

/* ══════════════════════════════════════════
   SEARCH FORM + LIVE RESULTS
   ══════════════════════════════════════════ */

.topbar__search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  max-width: 720px;
  margin: 0 20px;
}

.topbar__input {
  height: 32px;
  padding: 0 10px;
  background: #111;
  border: 1px solid #222;
  border-radius: 5px;
  color: #c8c8c8;
  font-size: 12.5px;
  font-family: var(--font-body, sans-serif);
  outline: none;
  transition: border-color 0.14s, background 0.14s;
  min-width: 0;
  flex: 1;
}

.topbar__input::placeholder { color: #3a3a3a; }

.topbar__input:focus {
  border-color: #2e6a2e;
  background: #131613;
}

/* ── Results dropdown ── */
.topbar__results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #111213;
  border: 1px solid #1e2a1e;
  border-radius: 7px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.6);
  z-index: 9999;
  max-height: 340px;
  overflow-y: auto;
}

/* Results list */
.tsr-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.tsr-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid #181818;
}

.tsr-item:last-child { border-bottom: none; }

.tsr-item:hover {
  background: #131f13;
}

.tsr-id {
  font-size: 10.5px;
  font-weight: 700;
  color: #2e6a2e;
  background: #0e1e0e;
  border: 1px solid #1a3a1a;
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tsr-title {
  font-size: 13px;
  color: #c8c8c8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tsr-item:hover .tsr-title { color: #bde8bd; }

/* Loading state */
.tsr-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 12.5px;
  color: #3a5a3a;
}

.tsr-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #1e3a1e;
  border-top-color: #4caf50;
  border-radius: 50%;
  animation: tsrSpin 0.6s linear infinite;
  flex-shrink: 0;
}

@keyframes tsrSpin { to { transform: rotate(360deg); } }

/* Empty / error */
.tsr-empty {
  padding: 14px;
  font-size: 12.5px;
  color: #3a3a3a;
  text-align: center;
}

/* Responsive: stack inputs on small screens */
@media (max-width: 900px) {
  .topbar__search { max-width: 100%; margin: 8px 0; }
  .topbar {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .topbar__search { flex-wrap: wrap; }
  .topbar__input  { flex: 1 1 120px; }
}

/* ── Result rows (updated design) ── */
.tsr-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.tsr-item {
  display: block;
  border-bottom: 1px solid #161616;
}

.tsr-item:last-child { border-bottom: none; }

.tsr-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  text-decoration: none;
  transition: background 0.12s;
}

.tsr-link:hover { background: #131f13; }

/* Avatar circle */
.tsr-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a3a1a, #0e1e0e);
  border: 1px solid #2a4a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #5a9a5a;
  flex-shrink: 0;
}

/* Body: title + meta stacked */
.tsr-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tsr-title {
  font-size: 13px;
  font-weight: 600;
  color: #d0d0d0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.12s;
}

.tsr-link:hover .tsr-title { color: #bde8bd; }

.tsr-meta {
  font-size: 11px;
  color: #3a5a3a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Arrow icon */
.tsr-arrow {
  width: 12px;
  height: 12px;
  color: #2a4a2a;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: color 0.12s, transform 0.12s;
}

.tsr-link:hover .tsr-arrow {
  color: #4caf50;
  transform: translateX(2px);
}

/* Empty */
.tsr-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 14px;
  font-size: 12.5px;
  color: #3a3a3a;
}

.tsr-empty svg {
  width: 14px;
  height: 14px;
  opacity: 0.35;
  flex-shrink: 0;
}

/* Image avatar — same size as letter avatar */
.tsr-avatar--img {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #2a4a2a;
  background: #0e1e0e;
  display: block;
}