@import url('https://fonts.googleapis.com/css?family=Lato&display=swap');

:root {
  --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --body-bg-color: #f7f7f7;
  --white: #fff;
  --list-color: #333;
  --color: #000;
}

* {
  box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
  body {
    --body-bg-color: #0a0a0a;
    --white: rgb(63, 63, 63);
    --list-color: rgb(219, 219, 219);
    --color: #f4f4f4bd;
  }
}

body {
  background-color: var(--body-bg-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 0.5rem;
  font-family: 'Lato', sans-serif;
  color: var(--color);
  transition: all 0.5s ease-in-out;
  position: relative;
}

.container {
  margin: 30px auto;
  width: 300px;
  width: 100%;
  max-width: 450px;
}

h1 {
  letter-spacing: 1px;
  margin: 0;
  word-wrap: break-word;
}

h3 {
  border-bottom: 1px solid #bbb;
  padding-bottom: 10px;
  margin: 40px 0 10px;
}

h4 {
  margin: 0;
  text-transform: uppercase;
}

.inc-exp-container {
  background-color: var(--white);
  box-shadow: var(--box-shadow);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
}

.inc-exp-container > div {
  flex: 1;
  text-align: center;
  max-width: 50%;
}

.inc-exp-container > div:first-of-type {
  border-right: 1px solid #dedede;
}

.money {
  font-size: 20px;
  letter-spacing: 1px;
  margin: 5px 0;
  overflow-x: auto;
}

.money.plus {
  color: #2ecc71;
}

.money.minus {
  color: #c0392b;
}

label {
  display: inline-block;
  margin: 10px 0;
}

input[type='text'],
input[type='number'] {
  border: 1px solid #dedede;
  border-radius: 2px;
  display: block;
  font-size: 16px;
  padding: 10px;
  width: 100%;
}

.btn {
  cursor: pointer;
  background-color: #9caaff;
  box-shadow: var(--box-shadow);
  color: #fff;
  border: 0;
  display: block;
  font-size: 16px;
  margin: 10px 0 30px;
  padding: 10px;
  width: 100%;
}

.btn:focus,
.delete-btn:focus {
  outline: 0;
}

.list {
  list-style-type: none;
  padding: 0;
  margin-bottom: 40px;
}

.list li {
  background-color: var(--white);
  box-shadow: var(--box-shadow);
  color: var(--list-color);
  display: flex;
  justify-content: space-between;
  position: relative;
  padding: 10px 24px 10px 10px;
  margin: 10px 0;
}

.list li.plus {
  border-right: 5px solid #2ecc71;
}

.list li.minus {
  border-right: 5px solid #c0392b;
}

.list span {
  display: flex;
  min-height: 100%;
  height: max-content;
  min-width: 4rem;
  max-width: 30%;
  justify-content: flex-end;
  align-items: center;
  align-self: center;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-all;
}

.delete-btn {
  cursor: pointer;
  background-color: #e74c3c;
  border: 0;
  color: #fff;
  font-size: 20px;
  line-height: 20px;
  padding: 2px 5px;
  position: absolute;
  top: 50%;
  right: 0;
  transform: translate(0%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.list li:hover .delete-btn {
  opacity: 1;
}
