@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");

:root {
  --bg-color: #f6f8fa;
  --text-color: #1d1f27;
  --main-color: #3a3471;
  --income-color: #9cce36;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  padding: 2rem;
  font-family: "Poppins", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
}

h1 {
  text-align: center;
  font-size: 1.5rem;
}

h1 span{
    background-color: var(--main-color);
    color: #fff;
    padding: 0.5rem;
    border-radius: 0.25rem;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
    position: relative;
}

h1 span::before{
    content: '';
    position: absolute;
    width: 0.25rem;
    height: 0.55rem;
    background-color: #3a3dbe;
    left: 50%;
    bottom: -0.55rem;
}

h3,
header,
ul {
  margin-bottom: 0.5rem;
}

main {
  max-width: 600px;
  margin: 1rem auto;
  background-color: #fff;
  padding: 1rem;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}

header {
  background-color: var(--main-color);
  color: #fff;
  padding: 1rem;
  text-align: center;
  border-radius: 5px;
  display: flex;
  flex-wrap: wrap;
}

header div {
  padding: 5px;
}

header div:first-child {
  flex-basis: 100%;
  font-size: 2.25rem;
  font-weight: 600;
}

header div:nth-child(n + 2) {
  flex-basis: 48%;
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0.21rem;
}

#balance-section{
  position: relative;
}

#balance-section::after{
  content: '';
  position: absolute;
  background-image: url(assets/wallet.png);
  background-size: 3.5rem 3.5rem;
  z-index: 1;
  width: 4rem;
  height: 4rem;
  background-repeat: no-repeat;
  top: 0.5rem;
  right: 16%;
}

#income-section{
    background-color: var(--income-color) ;
    border-radius: 0.25rem;
    position: relative;
}

#income-section::after{
  content: '';
  position: absolute;
  background-image: url(assets/fundscontent.png);
  background-size: 4rem 4rem;
  z-index: 1;
  width: 4rem;
  height: 4rem;
  background-repeat: no-repeat;
  top: -0.25rem;
}

#expense-section{
    background-color: #f00;
    border-radius: 0.25rem;
    position: relative;
}

#expense-section::after{
  content: '';
  position: absolute;
  background-image: url(assets/report.png);
  background-size: 3rem 3rem;
  z-index: 1;
  width: 4rem;
  height: 4rem;
  background-repeat: no-repeat;
  top: 0.25rem;
}

header h5 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

form input:not(#type),
form button {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  margin-bottom: 5px;
  height: 42px;
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
}

form button {
  background-color: var(--main-color);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
}

form label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

form div:nth-child(-n + 2) {
  flex-basis: 100%;
}

form div:nth-child(n + 3) {
  flex-basis: calc(50% - 5px);
}

input#type {
  appearance: none;
  position: absolute;
}

.option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: #eee;
  border-radius: 5px;
  position: relative;
}

.option span {
  width: 50%;
  text-align: center;
  cursor: pointer;
  z-index: 2;
}

.option::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  background-color: #fff;
  height: calc(100% - 10px);
  width: calc(50% - 10px);
  transform: translateX(5px);
  border-radius: inherit;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
  transition: all 200ms;
}

input#type:checked ~ .option::before {
  left: 50%;
}

ul {
  list-style-type: none;
}

ul li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 5px 10px;
  position: relative;
}

ul li:hover {
  background: rgba(0, 0, 0, 0.1);
}

.name {
  flex: 1;
}

.name h4 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: capitalize;
}

.name p {
  font-size: 0.8rem;
  color: #555;
}

.amount {
  font-weight: 600;
}

.amount.income {
  color: yellowgreen;
}

.amount.expense {
  color: indianred;
}

.action {
  position: absolute;
  top: 0;
  right: 0;
  background-color: #f00;
  color: #fff;
  height: 100%;
  width: 50px;
  display: grid;
  place-items: center;
  transform: scaleX(0);
  transform-origin: right;
  transition: all 300ms;
}

ul li:hover .action {
  transform: scaleX(1);
}

.action svg {
  width: 36px;
  height: 36px;
  cursor: pointer;
}

#transaction{
  border: 0.1rem solid var(--main-color);
  padding: 0.5rem;
  margin-top: 0.5rem;
  border-radius: 0.2rem;
  max-height: 20rem;
  overflow-y: scroll;
}

#transaction h3{
  text-align: center;
}

#transactionList li:first-child{
  border-top: 0.1rem dotted var(--main-color);
}

#transactionList li{
  border-bottom: 0.1rem dotted var(--main-color);
}

#status {
  text-align: center;
  margin-bottom: 0.5rem;
}

@media  screen and (max-width: 630px) {
    header div:nth-child(n + 2) {
        flex-basis: 100%;
      }
    #balance-section::after{
      right: auto;
      background-size: 2rem 2rem;
      top: 2rem;
    }
}