/* ═══════════════════════════════════════════════════════════
   Top Bar Component
   ═══════════════════════════════════════════════════════════ */

.topbar {
  grid-area: topbar;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
}

.topbar-menu-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  background: transparent;
  border: none;
  cursor: pointer;
}

.topbar-menu-btn:hover {
  background: var(--bg-hover);
}

/* Search bar */
.search-bar {
  flex: 1;
  max-width: 600px;
  position: relative;
}

.search-input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 38px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s;
}

.search-input:focus {
  outline: none;
  border-color: var(--purple);
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-shortcut {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4px;
}

.key-badge {
  padding: 2px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Search results dropdown */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  max-height: 480px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  box-shadow: var(--shadow-elevated);
}

.search-results.show {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background 0.15s;
}

.search-result-item:hover {
  background: var(--bg-hover);
}

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

.search-result-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--base-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-weight: 700;
  font-size: 11px;
  color: white;
}

.search-result-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-symbol {
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-result-chain-tag {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
}

.search-result-name {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-price {
  text-align: right;
  flex-shrink: 0;
}

.search-result-price > div:first-child {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
}

.search-result-price > div:last-child {
  font-size: 11px;
  font-weight: 600;
}

/* Topbar right actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.15s;
  position: relative;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--purple);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.chain-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
  color: var(--text-main);
  position: relative;
}

.chain-selector:hover {
  border-color: var(--purple);
}

/* Chain dropdown */
.chain-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  min-width: 180px;
  z-index: 100;
  display: none;
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
}

.chain-dropdown.show {
  display: block;
}

.chain-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
  color: var(--text-muted);
}

.chain-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.chain-dropdown-item.active {
  background: var(--solana-glow);
  color: var(--text-main);
  font-weight: 600;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--base-blue));
  cursor: pointer;
}
