/*=============== GOOGLE FONTS ===============*/
@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:opsz,wght@6..12,200..1000&display=swap");

/*=============== VARIABLES CSS ===============*/
:root {
  --header-height: 3.5rem;

  /*========== Colors ==========*/
  /*Color mode HSL(hue, saturation, lightness)*/
  --first-color: hsl(29, 100%, 50%);


  --title-color: hsl(228, 18%, 16%);
  --text-color: hsl(228, 8%, 56%);
  --body-color: hsl(224, 44%, 95%);
  --shadow-color: hsla(228, 80%, 4%, .1);

  /*========== Font and typography ==========*/
  /*.5rem = 8px | 1rem = 16px ...*/
  --body-font: "Nunito Sans", system-ui;
  --normal-font-size: .938rem;
  --smaller-font-size: .75rem;
  --tiny-font-size: .75rem;

  /*========== Font weight ==========*/
  --font-regular: 400;
  --font-semi-bold: 600;

  /*========== z index ==========*/
  --z-tooltip: 10;
  --z-fixed: 100;
}

/*========== Responsive typography ==========*/
@media screen and (min-width: 1150px) {
  :root {
    --normal-font-size: 1rem;
    --smaller-font-size: .813rem;
  }
}

/*=============== BASE ===============*/
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

body {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--body-color);
  color: var(--text-color);
  transition: background-color .4s;
}

a {
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  all: unset;
}

/*=============== VARIABLES DARK THEME ===============*/
body.dark-theme {
  --first-color: hsl(34, 70%, 63%);
  --title-color: hsl(228, 18%, 96%);
  --text-color: hsl(228, 12%, 61%);
  --body-color: hsl(228, 24%, 16%);
  --shadow-color: hsla(228, 80%, 4%, .3);
}

/*========== 
	Color changes in some parts of 
	the website, in dark theme
==========*/
.dark-theme .sidebar__content::-webkit-scrollbar {
  background-color: hsl(228, 16%, 30%);
}

.dark-theme .sidebar__content::-webkit-scrollbar-thumb {
  background-color: hsl(228, 16%, 40%);
}

/*=============== REUSABLE CSS CLASSES ===============*/
.container {
  margin-inline: 1.5rem;
}

.main {
  padding-top: 5rem;
}

/*=============== HEADER ===============*/
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);
  margin: .75rem;
}

.header__container {
  width: 100%;
  height: var(--header-height);
  background-color: var(--body-color);
  box-shadow: 0 2px 24px var(--shadow-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-inline: 1.5rem;
  border-radius: 1rem;
  transition: background-color .4s;
}

.header__logo {
  display: inline-flex;
  align-items: center;
  column-gap: .25rem;
}

.header__logo i {
  font-size: 1.5rem;
  color: var(--first-color);
}

.header__logo span {
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
}

.header__toggle {
  font-size: 1.5rem;
  color: var(--title-color);
  cursor: pointer;
}

/*=============== SIDEBAR ===============*/

.sidebar {
    position: fixed;
    left: -120%;
    top: 0;
    bottom: 0;

    z-index: var(--z-fixed);

    width: 288px;

    background-color: var(--body-color);

    box-shadow: 2px 0 24px var(--shadow-color);

    padding-block: 1.5rem;

    margin: .75rem;

    border-radius: 1rem;

    transition:
        left .4s,
        background-color .4s,
        width .4s;
}


/*=============== SIDEBAR CONTAINER ===============*/

.sidebar__container,
.sidebar__content {
    display: flex;
    flex-direction: column;

    row-gap: 3rem;
}


.sidebar__container {
    height: 100%;

    overflow: hidden;
}


/*=============== SIDEBAR USER ===============*/

.sidebar__user {
    display: grid;

    grid-template-columns: repeat(2, max-content);

    align-items: center;

    column-gap: 1rem;

    padding-left: 2rem;
}


.sidebar__img {
    position: relative;

    width: 50px;
    height: 50px;

    background-color: var(--first-color);

    border-radius: 50%;

    overflow: hidden;

    display: grid;

    justify-items: center;
}


.sidebar__img img {
    position: absolute;

    width: 36px;

    bottom: -1px;
}


.sidebar__info h3 {
    font-size: var(--normal-font-size);

    color: var(--title-color);

    transition: color .4s;
}


.sidebar__info span {
    font-size: var(--smaller-font-size);
}


/*=============== SIDEBAR CONTENT ===============*/

.sidebar__content {
    overflow: hidden auto;
}


.sidebar__content::-webkit-scrollbar {
    width: .4rem;

    background-color: hsl(228, 8%, 85%);
}


.sidebar__content::-webkit-scrollbar-thumb {
    background-color: hsl(228, 8%, 75%);
}


/*=============== SIDEBAR TITLE ===============*/

.sidebar__title {
    width: max-content;

    font-size: var(--tiny-font-size);

    font-weight: var(--font-semi-bold);

    padding-left: 2rem;

    margin-bottom: 1.5rem;
}


/*=============== SIDEBAR LIST ===============*/

.sidebar__list,
.sidebar__actions {
    display: grid;

    row-gap: 1.5rem;
}


/*=============== SIDEBAR LINK ===============*/

.sidebar__link {
    position: relative;

    display: grid;

    grid-template-columns: repeat(2, max-content);

    align-items: center;

    column-gap: 1rem;

    color: var(--text-color);

    padding-left: 2rem;

    transition:
        color .4s,
        opacity .4s;
}


.sidebar__link i {
    font-size: 1.25rem;
}


.sidebar__link span {
    font-weight: var(--font-semi-bold);
}


.sidebar__link:hover {
    color: var(--first-color);
}


/*=============== SIDEBAR ACTIONS ===============*/

.sidebar__actions {
    margin-top: auto;
}


.sidebar__actions button {
    cursor: pointer;
}


/*=============== THEME BUTTON ===============*/

.sidebar__theme {
    width: 100%;

    font-size: 1.25rem;
}


.sidebar__theme span {
    font-size: var(--normal-font-size);

    font-family: var(--body-font);
}


/*=============== SHOW SIDEBAR ===============*/
/* Mobile / tablet only */

.show-sidebar {
    left: 0;
}


/*=============== ACTIVE LINK ===============*/

.active-link {
    color: var(--first-color);
}


.active-link::after {
    content: "";

    position: absolute;

    left: 0;

    width: 3px;
    height: 20px;

    background-color: var(--first-color);
}


/*==================================================
    MOBILE / TABLET
==================================================*/

@media screen and (max-width: 1149px) {

    /*
    Sidebar is hidden by default.

    JavaScript adds .show-sidebar
    when the menu button is clicked.
    */

    .sidebar {
        left: -120%;

        width: 288px;

        transition:
            left .4s,
            background-color .4s;
    }


    .show-sidebar {
        left: 0;
    }


    /*
    IMPORTANT:
    Mobile does NOT collapse into icons.

    The full sidebar remains visible.
    */

    .sidebar__info,
    .sidebar__link span,
    .sidebar__title {
        display: block;
        opacity: 1;
    }


    .sidebar__user {
        padding-left: 2rem;
    }


    .sidebar__link {
        grid-template-columns: repeat(2, max-content);

        padding-left: 2rem;

        column-gap: 1rem;
    }


    .sidebar__title {
        padding-left: 2rem;

        margin-inline: 0;
    }


    /*
    Prevent desktop padding behavior
    from affecting mobile.
    */

    .header {
        padding-left: 0;
    }


    .main {
        padding-left: 0;
    }


    .left-pd {
        padding-left: 0;
    }
}


/*==================================================
    SMALL DEVICES
==================================================*/

@media screen and (max-width: 480px) {

    .sidebar {
        width: 280px;

        margin: .5rem;

        padding-block: 1.25rem;

        border-radius: .9rem;
    }


    .sidebar__container,
    .sidebar__content {
        row-gap: 2rem;
    }


    .sidebar__user {
        padding-left: 1.5rem;
    }


    .sidebar__link {
        padding-left: 1.5rem;
    }


    .sidebar__title {
        padding-left: 1.5rem;
    }
}


/*==================================================
    VERY SMALL DEVICES
==================================================*/

@media screen and (max-width: 360px) {

    .header__container {
        padding-inline: 1rem;
    }


    .sidebar {
        width: 270px;

        margin: .4rem;
    }


    .sidebar__user {
        padding-left: 1.25rem;
    }


    .sidebar__link {
        padding-left: 1.25rem;
    }


    .sidebar__title {
        padding-left: 1.25rem;
    }
}


/*==================================================
    LARGE DEVICES
==================================================*/

@media screen and (min-width: 1150px) {

    /*=============== HEADER ===============*/

    .header {
        margin: 1rem;

        padding-left: 340px;

        transition: padding .4s;
    }


    .header__container {
        height: calc(var(--header-height) + 2rem);

        padding-inline: 2rem;
    }


    .header__logo {
        order: 1;
    }


    /*=============== SIDEBAR ===============*/

    .sidebar {
        left: 0;

        width: 316px;

        margin: 1rem;

        transition:
            width .4s,
            background-color .4s;
    }


    .sidebar__info,
    .sidebar__link span {
        opacity: 1;

        transition: opacity .4s;
    }


    .sidebar__user,
    .sidebar__title {
        transition:
            padding .4s;
    }


    /*================================================
        DESKTOP COLLAPSED SIDEBAR
    =================================================*/

    .sidebar-collapsed {
        width: 90px;
    }


    .sidebar-collapsed .sidebar__user {
        padding-left: 1.25rem;
    }


    .sidebar-collapsed .sidebar__title {
        padding-left: 0;

        margin-inline: auto;
    }


   .sidebar-collapsed .sidebar__info,
.sidebar-collapsed .sidebar__link span:not(.badge) {
    opacity: 0;
    pointer-events: none;
}

.sidebar-collapsed .sidebar__link .badge {
    opacity: 1;
    pointer-events: auto;
}

/* Notification badge */
.sidebar__link {
    position: relative;
}

.sidebar__link .badge {
    position: absolute;

    top: -7px;
    right: -7px;

    min-width: 20px;
    height: 20px;

    padding: 0 5px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #ef4444;
    color: #ffffff;

    font-size: 10px;
    font-weight: 700;

    line-height: 1;

    z-index: 20;

    box-shadow: 0 2px 8px rgba(239, 68, 68, .35);
}

    .sidebar-collapsed .sidebar__link {
        grid-template-columns: max-content;

        justify-content: center;

        padding-left: 0;

        column-gap: 0;
    }


    .sidebar-collapsed .sidebar__link i {
        font-size: 1.25rem;
    }


    /*=============== MAIN ===============*/

    .main {
        padding-left: 340px;

        padding-top: 8rem;

        transition: padding .4s;
    }


    /*=============== COLLAPSED MAIN ===============*/

    .left-pd {
        padding-left: 114px;
    }
}

/*=============== PROFILE SECTION ===============*/
.profile__container {
  display: flex;
  flex-direction: column;
  row-gap: 2rem;
  padding: 2rem;
  background-color: var(--body-color);
  border-radius: 1rem;
  box-shadow: 0 4px 24px var(--shadow-color);
  transition: background-color .4s;
}

.profile__flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0,0,0,0.03);
  padding: 1rem;
  border-radius: .75rem;
}

.profile__block h3 {
  font-size: 1rem;
  color: var(--title-color);
  margin-bottom: .25rem;
}

.profile__block p {
  font-size: .875rem;
  color: var(--text-color);
}

.profile__edit button {
  padding: .5rem 1rem;
  border-radius: .5rem;
  border: none;
  background-color: var(--first-color);
  color: #fff;
  cursor: pointer;
  font-weight: var(--font-semi-bold);
  transition: background-color .3s;
}

.profile__edit button:hover {
  background-color: hsl(9, 95%, 17%);
}

/*=============== MODAL ===============*/
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.modal-content {
  background-color: var(--body-color);
  margin: 5% auto;
  padding: 2rem;
  border-radius: 1rem;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 24px var(--shadow-color);
  transition: background-color .4s;
}

.modal-content input {
  width: 100%;
  padding: .5rem;
  margin: .5rem 0 1rem 0;
  border-radius: .5rem;
  border: 1px solid hsl(228, 8%, 75%);
}

.updatebtn {
  width: 100%;
  padding: .5rem;
  border: none;
  border-radius: .5rem;
  background-color: var(--first-color);
  color: #fff;
  cursor: pointer;
  font-weight: var(--font-semi-bold);
  transition: background-color .3s;
}

.updatebtn:hover {
  background-color: hsl(9, 95%, 17%);
}

.close {
  float: right;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-color);
  cursor: pointer;
}

.close:hover {
  color: var(--first-color);
}

/*=============== RESPONSIVE ===============*/
@media screen and (max-width: 768px) {
  .profile__flex {
    flex-direction: column;
    align-items: flex-start;
    row-gap: 0.5rem;
  }

  .profile__edit button {
    width: 100%;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
}

@media screen and (min-width: 1150px) {
  .profile__container {
    padding: 2rem 3rem;
  }

  .profile__flex {
    padding: 1.25rem;
  }

  .profile__block h3 {
    font-size: 1.1rem;
  }

  .profile__block p {
    font-size: 1rem;
  }
}

/*=============== DARK THEME ===============*/
body.dark-theme .profile__container,
body.dark-theme .modal-content,
body.dark-theme .profile__flex {
  background-color: hsl(228, 24%, 16%);
}

body.dark-theme .profile__block h3 {
  color: hsl(228, 18%, 96%);
}

body.dark-theme .profile__block p,
body.dark-theme .close {
  color: hsl(228, 12%, 61%);
}

body.dark-theme .profile__edit button,
body.dark-theme .updatebtn {
  background-color: hsl(228, 70%, 63%);
}


/* Payment wallets */
.wallets {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding: 1rem 0;
}

.wallet-card {
    background-color: #fff;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-width: 220px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wallet-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.wallet-balance {
    font-weight: bold;
    margin: 0.5rem 0;
}

.wallet-value {
    color: #555;
}

.wallet-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.send-btn { background-color: #e74c3c; color: #fff; }
.receive-btn { background-color: #2ecc71; color: #fff; }

.send-btn, .receive-btn {
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.send-btn:hover { background-color: #c0392b; }
.receive-btn:hover { background-color: #27ae60; }

/* Wallet history table */
.wallet-history {
    margin-top: 2rem;
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th, .history-table td {
    padding: 0.8rem;
    text-align: left;
}

.history-table thead {
    background-color: #f1f1f1;
}

.deposit { color: #2ecc71; }
.send { color: #e74c3c; }
.completed { color: #27ae60; }
.pending { color: gray; animation: blink 1s infinite; }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Responsive */
@media (max-width: 768px) {
    .wallet-card { min-width: 180px; }
    .wallet-actions { flex-direction: column; gap: 0.5rem; }
}

@media (max-width: 480px) {
    .payment__title { font-size: 1.2rem; }
    .wallet-card { padding: 0.8rem; }
    .history-table th, .history-table td { font-size: 0.8rem; }
}


.history-list { list-style: none; padding: 0; margin: 0; }
.history-item { border-bottom: 1px solid #ddd; padding: 0.8rem 0; }
.history-summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.history-details { display: none; padding-top: 0.5rem; color: #555; font-size: 0.85rem; }
.history-details p { margin: 0.2rem 0; }

.type.deposit { color: #2ecc71; font-weight: bold; }
.type.send { color: #e74c3c; font-weight: bold; }
.type.pending { color: gray; font-weight: bold; animation: blink 1s infinite; }

.amount { font-weight: bold; }
.usd-amount { color: #555; margin-left: 1rem; }

.toggle-details { font-size: 1.2rem; }

.load-more {
    background-color: #3498db;
    color: #fff;
    border: none;
    padding: 0.6rem 1rem;
    margin-top: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.history-details { display: none; padding: 0.5rem 1rem; background: #f9f9f9; border-radius: 6px; margin-top: 0.3rem; }
.toggle-details { cursor: pointer; font-size: 1.2rem; margin-left: 0.5rem; }
.type.deposit { color: #2ecc71; font-weight: bold; }
.type.send { color: #e74c3c; font-weight: bold; }
.type.pending { color: gray; font-weight: bold; animation: blink 1s infinite; }
.amount { font-weight: bold; }
.usd-amount { margin-left: 0.5rem; color: #555; }

