* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font: bold 14px Arial, sans-serif;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background-color: rgb(215, 202, 202);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(#b7b3c1, #478dad);
  border-radius: 15px;
}

html {
  height: 100%;
  background: white;
  background: radial-gradient(circle, #fff 20%, #ccc);
  background-size: cover;
}

/* Using box shadows to create 3D effects */
#calculator {
  /* display: flex; */
  width: 100%;
  height: 100vh;
  padding: 20px 20px 9px;
  background: #9dd2ea;
  background: linear-gradient(#9dd2ea, #8bceec);
  border-radius: 3px;
  box-shadow: 0px 4px #009de4, 0px 10px 15px rgba(0, 0, 0, 0.2);
  display: grid;
  grid-template-columns: 75% 25%;
  grid-template-rows: 30% 69%;
}

/* Top portion */
.top .keys .clear {
  float: left;
}

.top .screen {
  height: 65px;
  float: right;
  padding: 0 10px;
  background-color: transparent;
  font-size: 28px;
  line-height: 40px;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  text-align: right;
  letter-spacing: 1px;
}

.keys,
.top {
  overflow: hidden;
}

.keys .btn,
.keys .clear {
  float: left;
  position: relative;
  top: 0;
  cursor: pointer;
  width: 120px;
  height: 50px;
  background: white;
  border-radius: 3px;
  box-shadow: 0px 4px rgba(0, 0, 0, 0.2);
  margin: 0 7px 11px 0;
  color: #888;
  line-height: 36px;
  text-align: center;
  user-select: none;
  transition: all 0.2s ease;
}


.keys .btn.operator {
  background: #fff0f5;
  margin-right: 0;
}

.keys .btn.eval {
  background: #f1ff92;
  box-shadow: 0px 4px #9da853;
  color: #888e5f;
}

.keys .clear {
  background: #ff9fa8;
  box-shadow: 0px 4px #ff7c87;
  color: white;
}

.keys .btn:hover {
  background: #9c89f6;
  box-shadow: 0px 4px #6b54d3;
  color: white;
}

.keys .btn.eval:hover {
  background: #abb850;
  box-shadow: 0px 4px #717a33;
  color: #ffffff;
}

.keys .clear:hover {
  background: #f68991;
  box-shadow: 0px 4px #d3545d;
  color: white;
}

.keys .btn:active {
  box-shadow: 0px 0px #6b54d3;
  top: 4px;
}

.keys .btn.eval:active {
  box-shadow: 0px 0px #717a33;
  top: 4px;
}

.keys .clear:active {
  top: 4px;
  box-shadow: 0px 0px #d3545d;
}



.history {
  grid-area: 1/2/-1/-1;
  position: relative;
  padding: 20px 20px;
  border-radius: 10px;
  background-color: #f0f0f0;
}

.history_head {
  width: 100%;
  padding: 3px 0;
  margin: 10px 0;
  display: inline-block;
  font-weight: 700;
  text-align: right !important;
}

.clear_history {
  position: absolute;
  bottom: 16px;
  right: 20px;
  padding: 9px 15px;
  font-size: 1rem;
  font-weight: 600;
}

.clear_history:active {
  background-color: rgb(209, 209, 209);
}

.buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-gap: 2px;
  place-items: center;
}

.i_o {
  display: flex;
  padding: 0 30px;
  flex-direction: column;
  background: transparent;
}

.i_o>input {
  width: 100%;
  /* background-color: rgb(48, 48, 48); */
  font-family: monospace;
  border: none;
  outline: none;
}

.all_inputs {
  border-radius: 3px 3px 0 0;
}

.input {
  border-radius: 0 0 3px 3px;
}

.all_inputs,
.live_result {
  padding: 10px;
  font-size: 1rem;
  text-align: right;
  color: rgb(235, 235, 235);
}

.input {
  color: rgb(235, 235, 235);
  padding: 20px;
  text-align: right;
  font-size: 3.5rem;
}

.ul_his li {
  padding: 10px 15px;
  list-style: none;
  text-align: right;
  transition: all 0.3s;
}


@media only screen and (max-width: 1000px) {
  .history {
    display: none;
  }

  .i_o {
    grid-area: 1/1/2/-1;
  }

  .buttons {
    grid-area: 2/1/-1/-1;
  }

  button {
    font-size: 0.8rem;
  }
}

@media only screen and (min-width:345px) and (max-width:485px) {

  .keys .btn,
  .keys .clear {
    width: 46px;
  }

  #calculator {
    grid-template-rows: 36% 60%;
  }

  .top .screen {
    height: 78px;
  }

  .i_o {
    padding: 0 4px;
  }
}

@media screen and (min-width:485px) and (max-width:768px) {

  .keys .btn,
  .keys .clear {
    width: 80px;
  }

  #calculator {
    grid-template-rows: 35% 65%;
  }

  .top .screen {
    height: 78px;
  }

  .i_o {
    padding: 0 13px;
  }
}

.ul_his {
  max-height: 82%;
  /* Set the maximum height */
  overflow-y: auto;
  /* Enable vertical scrolling */
}
