@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");

:root {
  --bg-color: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  --text-color: #1d1f27;
  --main-color: linear-gradient(to top, #30cfd0 0%, #330867 100%);
}

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

body {
  height: 100vh;
  width: 100%;
  padding: 2rem;
  font-family: "Poppins", sans-serif;
  background-image: var(--bg-color);
  color: var(--text-color);
  
}

h1 {
  text-align: center;
  font-size: 2.8rem;
}

h3,
header,
ul {
  margin-bottom: 0.5rem;
}

main {
  max-width: 400px;
  margin: 1rem auto;
  background-color: #fff;
  padding: 1rem;
  box-shadow: 0 3px 5px #c3f1f579;
  border-radius: 10px;
}

header {
  background-image: 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: 50%;
  font-size: 1.25rem;
  font-weight: 500;
}

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 #c3f1f5;
  border-radius: 5px;
  margin-bottom: 5px;
  height: 42px;
  font-family: "Poppins", sans-serif;
  font-size: 1rem;
}

form button {
  background-image: linear-gradient(to top, #48c6ef 0%, #6f86d6 100%);;
  color: #fff;
  font-size: 0.8rem;
  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: #c3f1f5;
  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: #c3f1f570;
}

.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: rgb(133, 205, 50);
}

.amount.expense {
  color: rgb(255, 48, 48);
}

.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;
}

#status {
  text-align: center;
  margin-bottom: 0.5rem;
}
