@use "sass:math";

@import "~src/styles/variables";

:host {
  display: block;
}

.wallet {
  display: flex;
  gap: math.div($offshift-gap * 3, 2);;

  & &__left {
    width: 100%;
  }

  & &__right {
    width: 100%;
    max-width: 520px;
  }

  & &__composition {
  }
}

.composition {
  background: #1B0D3D;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  border-radius: 8px;
  overflow: hidden;

  & &__header {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 600;
    font-size: 20px;
    line-height: 32px;
    color: #F5F5FF;
  }

  & &__content {
    padding: 24px;
    display: flex;
    gap: math.div($offshift-gap * 3, 2);;
  }

  & &__chart {
    width: 100%;
    max-width: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    align-self: center;
    padding: 12px;
    position: relative;
  }

  & &__chart-total {
    font-weight: 600;
    font-size: 14px;
    line-height: 22px;
    color: #F5F5FF;
    position: absolute;
    top: calc(50% - 11px);
    left: 0;
    right: 0;
    text-align: center;
  }

  & &__data {
    width: 100%;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-weight: 700;
  }

  & &__table {
    tr,
    tr > td,
    tr > th {
      border: 0;
      background: transparent;
    }

    tr > th {
      padding-top: 0;
      padding-bottom: 8px;
    }

    tr > td {
      padding-top: 8px;
      padding-bottom: 8px;
    }

    tr:last-of-type > td {
      padding-bottom: 0;
    }

    tr > td {
      font-weight: 600;
      font-size: 14px;
      line-height: 22px;
      color: #F5F5FF;

      .token-icon {
        width: 40px;
        height: 40px;

        > img {
          width: 100%;
          height: 100%;
        }
      }

      > div:not(.token-icon) {
        display: flex;
        align-items: center;
        gap: 12px;
      }

      .view {
        font-weight: 600;
        font-size: 14px;
        line-height: 22px;
        color: #AA8CFF;
        cursor: pointer;
      }
    }

    tr > th {
      font-weight: 400;
      font-size: 12px;
      line-height: 19px;
      opacity: 0.6;
      color: #FFFFFF;
    }

    tr > th:first-of-type,
    tr > td:first-of-type {
      padding-left: 0;
    }

    tr > th:last-of-type,
    tr > td:last-of-type {
      padding-right: 0;
      white-space: nowrap;
    }

    tr > th:last-of-type,
    tr > td:last-of-type,
    tr > td:last-of-type > div {
      //white-space: nowrap;
      //text-align: right;
      //justify-content: flex-end;
    }

    tr > th:not(:first-of-type):not(:last-of-type) {
      width: 33%;
    }

    tr > td:last-of-type {
      width: auto;
    }

    tr > td:first-of-type {
      width: 40px;
      min-width: 40px;

      > span {
        display: inline-block;
        border-radius: 50%;
        width: 8px;
        height: 8px;
      }
    }
  }
}

.commitments {
  background: #fff;
  overflow: hidden;
  border-radius: 8px;
  display: flex;
  flex-direction: column;

  & &__empty {
    min-height: 160px;
    font-weight: 600;
    font-size: 20px;
    line-height: 32px;
    color: #1B0D3D;
    display: flex;
    align-items: center;
    align-self: center;
    text-align: center;
  }

  & &__wrapper {
    display: flex;
    flex-direction: column;
    padding: 0 24px 24px;
  }

  & &__simplebar {
    max-height: calc(100vh - 340px);
    margin: 0 -24px;
  }

  & &__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 12px 24px;
    background: rgba(88, 0, 176, 0.1);
    font-weight: 600;
    font-size: 20px;
    line-height: 32px;
    color: #1B0D3D;

    > img {
      width: 24px;
      height: 24px;
    }
  }

  & &__zero-balances {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: $offshift-primary-color;
    cursor: pointer;

    > span.pi-check-circle {
      font-size: 12px;
    }

    > span:not(.pi-check-circle) {
      font-weight: 600;
      font-size: 12px;
      line-height: 19px;
    }
  }

  & &__table {
    tr > th > div > span {
      opacity: 0.7;
      color: #1B0D3D;
    }

    tr > th > div > .commitments__zero-balances {
      color: $offshift-primary-color;
      cursor: pointer;
    }

    tr > th > div > span,
    tr > th > div > div {
      font-weight: 600;
      font-size: 12px;
      line-height: 19px;
    }

    tr > th,
    tr > td {
      background-color: #FFFFFF;
      border: 0;
    }

    tr > th:first-of-type,
    tr > td:first-of-type {
      width: 20px;
      padding-right: 0;
      padding-left: 24px;
    }

    tr > th:last-of-type,
    tr > td:last-of-type {
      padding-right: 24px;
      padding-top: 6px;
      padding-bottom: 6px;
    }

    tr > th:last-of-type > div,
    tr > td:last-of-type > div {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    tr > td:last-of-type > div {
      background: rgba(27, 13, 61, 0.05);
      border-radius: 4px;
      padding: 16px;
    }
  }

  & &__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
  }

  & &__text {
    font-weight: 600;
    font-size: 16px;
    line-height: 26px;
    color: #1B0D3D;
  }

  & &__balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  & &__balance-usd {
    font-weight: 600;
    font-size: 12px;
    line-height: 19px;
    color: #1B0D3D;
    opacity: 0.7;
  }

  & &__button {
    width: 100%;
  }
}

.token {
  display: inline-flex;
  align-items: center;
  gap: 4px;

  & &__icon {
    width: 16px;
    height: 16px;

    > img {
      width: 100%;
      height: 100%;
    }
  }

  & &__amount {
    font-weight: 600;
    font-size: 16px;
    line-height: 26px;
    color: #1B0D3D;
  }
}