  Let $ \mathcal{B}:=\{f(z)=\sum_{n=0}^{\infty}a_nz^n\; \mbox{with}\;
|f(z)|<1\;\mbox{for all}\; z\in\mathbb{D}\} $. The improved version of the
classical Bohr's inequality \cite{Bohr-1914} states that if $ f\in\mathcal{B}
$, then the associated majorant series $
M_f(r):=\sum_{n=0}^{\infty}|a_n|r^n\leq 1 $ holds for $ |z|=r\leq 1/3 $ and the
constant $ 1/3 $ cannot be improved. Bohr's original theorem and its subsequent
generalizations remain active fields of study, driving investigations in a wide
range of function spaces. In this paper, first we establish a generalized Bohr
inequality for the class $\mathcal{B}$ by allowing a sequence
$\{\varphi_n(r)\}_{n=0}^{\infty}$ of non-negative continuous functions on $[0,
1)$ in the place of $\{r^n\}_{n=0}^{\infty}$ of the majorant series $M_f(r)$
introducing a weighted sequence of non-negative continuous functions
$\{\Phi_n(r)\}_{n=0}^{\infty}$ on $[0, 1)$. Secondly, as a generalization, we
obtain a refined version of the Bohr inequality for a certain class
$\tilde{G}^0_{\mathcal{H}}(\beta)$ of harmonic mappings. All the results are
proved to be sharp.
