@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);
}

*{
      box-sizing: border-box;
}

body{
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      margin: 0;
      min-height: 100vh;
      background: #f5f4f4;
      color: rgb(37, 36, 36);
      font-family: 'Lato', sans-serif;
}

.container{
      width: 350px;
      margin: 30px auto;
}

h1{
      letter-spacing: 2px;
      margin: 0;
}

h3{
      border-bottom: 1px solid #706c6c;
      padding-bottom: 10px;
}

.inc-exp-container{
      background: #fff;
      box-shadow: var(--box-shadow);
      padding: 20px;
      display: flex;
      justify-content: space-between;
      margin: 20px 0;
}

.inc-exp-container > div{   /*child divs*/
      flex: 1;
      text-align: center;
}

.inc-exp-container > div:first-of-type{   /*:first-of-type - to target the first occurence of an element within its container*/
      border-right: 1px solid #c3bfbf;
}

.money{
      font-size: 20px;
      letter-spacing: 1px;
      margin: 5px 0;
}

.money.plus{
      color: #2ecc71;
}

.money.minus{
      color: rgba(223, 11, 18, 0.426);
}

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: #9c88ff;
      box-shadow: var(--box-shadow);
      width: 100%;
      font-size: 16px;
      color: #fff;
      border: 0;
      display: block;
      margin: 15px 0 30px;
      padding: 10px;
}

.btn:focus,
.delete-btn:focus{
      outline: 0;
}

.list{
      list-style: none;
      padding: 0;
      margin-bottom: 40px;
}

.list li{
      background-color: #fff;
      box-shadow: var(--box-shadow);
      color: #333;
      display: flex;
      justify-content: space-between;
      position: relative;
      padding: 10px;
      margin: 10px 0;
}

.list li.plus {
      border-right: 5px solid #2ecc71;
}
    
.list li.minus {
      border-right: 5px solid #c0392b;
 }

 .delete-btn {
      cursor: pointer;
      background-color: #e74c3c;
      border: 0;
      color: #fff;
      font-size: 20px;
      line-height: 20px;
      padding: 2px 5px;
      position: absolute;
      top: 50%;
      left: 0;
      transform: translate(-100%, -50%);
      opacity: 0;
      transition: opacity 0.3s ease;
}
    
.list li:hover .delete-btn {
      opacity: 1;
}

@media (max-width : 450px){
      .list li:hover{
            padding-left: 40px;
      }
      .list li:hover .delete-btn {
            opacity: 1;
            left: 10%;
      }
}
