/* =====================================================================
   topbar.css — Fixed top navigation bar
   ===================================================================== */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 500;
  transition: background-color var(--transition-fast);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 80px;
}

.topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.topbar-brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: color var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.topbar-brand span {
  color: var(--accent);
}

.topbar-brand:hover {
  color: var(--accent);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 80px;
  justify-content: flex-end;
}

/* ── Back Button ──────────────────────────────────────────────────────── */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.btn-back:hover {
  background: var(--bg-raised);
  color: var(--text-primary);
}

.btn-back.hidden {
  visibility: hidden;
  pointer-events: none;
}

/* ── Icon Buttons in Topbar ───────────────────────────────────────────── */
.topbar-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-btn);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}

.topbar-btn:hover {
  background: var(--bg-raised);
  border-color: var(--border);
  color: var(--text-primary);
}

.topbar-btn svg {
  width: 18px;
  height: 18px;
}

/* ── Account Button ───────────────────────────────────────────────────── */
.account-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  transition: all var(--transition-fast);
  position: relative;
  font-family: inherit;
  letter-spacing: 0;
}

.account-btn:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
}

.account-btn.logged-in {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.account-btn.logged-in:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ── Account Dropdown Panel ───────────────────────────────────────────── */
.account-panel {
  position: absolute;
  top: calc(var(--topbar-height) + 6px);
  right: 12px;
  width: 280px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-dropdown);
  z-index: 600;
  overflow: hidden;
  animation: slideInUp 150ms ease;
}

.account-panel.hidden {
  display: none;
}

.account-panel-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
}

.account-panel-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.account-panel-header p {
  font-size: 12px;
  color: var(--text-secondary);
}

.account-panel-body {
  padding: 16px;
}

.account-panel-body .form-group {
  margin-bottom: 12px;
}

.account-panel-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.account-panel-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.account-panel-user-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.account-panel-user-info p {
  font-size: 12px;
  color: var(--text-secondary);
}

.account-panel-body .btn {
  width: 100%;
  justify-content: center;
}

.login-error {
  font-size: 12px;
  color: var(--status-action);
  text-align: center;
  min-height: 18px;
  margin-top: -6px;
  margin-bottom: 6px;
}
