/* ── Shared Navbar ─────────────────────────────────────────────── */
/* Extracted from styles.css so dashboard, study, and graph all look identical */

#top-bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 48px; padding: 0 14px;
  background: var(--bg-secondary, #111827); border-bottom: 1px solid var(--border, rgba(56,189,248,0.12));
  z-index: 100; gap: 10px;
  position: sticky; top: 0;
  overflow: visible;
}
.top-bar-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.top-bar-center { flex: 1; max-width: 460px; margin: 0 auto; }
.top-bar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 1; min-width: 0; }
#nav-right-extra { display: flex; align-items: center; gap: 8px; flex-shrink: 1; min-width: 0; white-space: nowrap; }
#nav-user-container { flex-shrink: 0; }

/* Logo */
.tb-logo {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(56,189,248,0.12), rgba(232,121,249,0.12));
  border: 1px solid rgba(56,189,248,0.15); text-decoration: none;
  font-size: 1.1rem; font-family: var(--font-jp, 'Noto Sans JP', sans-serif); flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.tb-logo:hover { border-color: rgba(56,189,248,0.3); }
.logo-accent {
  background: var(--gradient, linear-gradient(135deg, #38bdf8, #e879f9));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Navigation links */
.tb-nav { display: flex; align-items: center; gap: 2px; }
.tb-nav-link {
  padding: 6px 12px; font-size: 0.78rem; font-weight: 500;
  color: var(--text-muted, #64748b); text-decoration: none; border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.tb-nav-link:hover { color: var(--text-secondary, #94a3b8); background: rgba(255,255,255,0.04); }
.tb-nav-link.active { color: var(--text, #f1f5f9); background: rgba(255,255,255,0.06); }

.tb-nav-link { position: relative; }
.tb-review-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px;
  font-size: 0.6rem; font-weight: 700; line-height: 1;
  background: var(--magenta, #e879f9); color: #fff;
  border-radius: 8px; margin-left: 4px; vertical-align: middle;
}

.tb-divider { width: 1px; height: 20px; background: var(--border, rgba(56,189,248,0.12)); flex-shrink: 0; }

/* User menu */
.user-menu-wrap { position: relative; }
.user-menu-trigger {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1px solid transparent; border-radius: 8px;
  padding: 4px 8px 4px 4px; cursor: pointer; color: var(--text-secondary, #94a3b8);
  font-family: var(--font, 'Inter', sans-serif); font-size: 0.78rem; font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.user-menu-trigger:hover { background: rgba(255,255,255,0.04); border-color: var(--border, rgba(56,189,248,0.12)); }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-primary, #0a0e17); border: 1.5px solid var(--teal, #38bdf8);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; color: var(--teal, #38bdf8); flex-shrink: 0;
}
.user-avatar.premium { border-color: var(--gold, #fbbf24); color: var(--gold, #fbbf24); }
.user-trigger-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chevron { font-size: 0.65rem; color: var(--text-muted, #64748b); margin-left: 2px; }

.user-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 200px; background: var(--bg-secondary, #111827);
  border: 1px solid var(--border, rgba(56,189,248,0.12)); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 200; overflow: hidden;
}
.user-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }

.ud-section { padding: 12px 14px; }
.ud-username { font-size: 0.85rem; font-weight: 600; color: var(--text, #f1f5f9); }
.ud-label { font-size: 0.82rem; font-weight: 600; color: var(--text, #f1f5f9); }
.ud-hint { font-size: 0.72rem; color: var(--text-muted, #64748b); margin-top: 2px; }
.ud-plan-row { margin-top: 6px; }
.ud-plan-badge {
  display: inline-block; font-size: 0.65rem; font-weight: 700;
  padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.05em;
}
.ud-plan-badge.free { background: rgba(100,116,139,0.15); color: var(--text-muted, #64748b); }
.ud-plan-badge.premium { background: rgba(251,191,36,0.12); color: var(--gold, #fbbf24); }

.ud-divider { height: 1px; background: var(--border, rgba(56,189,248,0.12)); }

.ud-item {
  display: block; width: 100%; padding: 9px 14px;
  font-family: var(--font, 'Inter', sans-serif); font-size: 0.8rem; color: var(--text-secondary, #94a3b8);
  background: none; border: none; text-align: left; cursor: pointer;
  text-decoration: none; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.ud-item:hover { background: rgba(255,255,255,0.04); color: var(--text, #f1f5f9); }
.ud-upgrade { color: var(--gold, #fbbf24); font-weight: 600; }
.ud-upgrade:hover { background: rgba(251,191,36,0.06); color: var(--gold, #fbbf24); }
.ud-highlight { color: var(--teal, #38bdf8); font-weight: 600; }
.ud-highlight:hover { background: rgba(56,189,248,0.06); color: var(--teal, #38bdf8); }
.ud-premium-active { color: var(--gold, #fbbf24); font-size: 0.75rem; cursor: default; }
.ud-logout { color: var(--red, #f87171); }
.ud-logout:hover { background: rgba(248,113,113,0.06); }
