
body {
    background-color: rgb(179, 179, 179);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

.containermode {
    display: flex;
    justify-content: start;
    align-items: center;
    font-size: 30px;
    width: 80px;
    height: 30px;
    background-color: antiquewhite;
    padding: 10px;
    border-radius: 20px;
    cursor: pointer;
}


.container {
    padding: 30px;
    width: 30rem;
    height: 40rem;
    border-radius: 15px;
    background-color: black;
    overflow: hidden;
    z-index: 20;
    border: 3px solid rgb(238, 216, 187);
}

.calculator {
    display:grid;
    gap: 15px;
    
}

.result {
    font-size: 40px;
    height: 30px;
    display: flex;
    justify-content: end;
    padding: 20px;
    background-color: antiquewhite;
    border-radius: 20px;
    overflow: hidden;
}

#keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(4px, 2vw, 12px);
    padding: 30px;
}

button {
    font-size: 30px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 0px;
    background-color: antiquewhite;
    cursor: pointer;
}

button:active {
    background-color: rgb(56, 42, 42);
    color: white;
}

button:hover {
    transform: translateY(-2px);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.moon {
    transition: 0.3s ease-out;
    cursor: pointer;
}

.nightmode {
    background-color: black;
    color:antiquewhite;
    transform: translateX(60px);
    transition: 0.3s ease-out;
}




.history {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    background-color: antiquewhite;
    padding: 10px;
    width: 50px;
    border-radius: 20px;
    cursor: pointer;
}
.history:hover {
    background-color:rgb(201, 189, 173);
}
.history:active {
    background-color:rgb(136, 127, 116);
}


.historycontainer {
  padding: 30px;
  width: 27rem;
  height: 40rem;
  border-radius: 30px;
  background-color: rgb(44, 42, 39);
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-40%);
  transition:  all 0.3s ease;
  overflow: auto;
}
.show {
  visibility: visible;
  opacity: 1;
  transform: translateX(-20%);
}



#historyentry {
    float: right;
    display: flex;
    justify-content: end;
    align-items: end;
    width: 9em;
    min-height: 50px;
    flex-direction: column;
    font-size: 40px;
    padding: 15px;
    background-color: rgb(172, 154, 137);
    border-radius: 10px;
    gap: 20px;
}

.clearbtn {
    float: right;
    text-align: center;
    background-color: rgb(255, 238, 222);
    border-radius: 4px;
    width: 10em;
    height: 3em;
    font-size: 15px;
    cursor: pointer;
}

.clearbtn:hover{
    background-color: rgb(199, 186, 170);
}

.clearbtn:active{
    background-color: rgb(207, 196, 182);
}

.confirm-model {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100vw; 
  height: 100vh;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.noContents {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100vw; 
    height: 100vh;
    font-size: 25px;
    background: rgba(0, 0, 0, 0.5); 
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.noContents p {
  background: rgb(255, 215, 215); /* dialog box style */
  padding: 20px 30px;
  border-radius: 8px;
  text-align: center;
}

.noContents button {
    margin: 10px;
    padding: 10px 20px;
    text-align: center;
    background-color: rgb(255, 238, 222);
    border-radius: 4px;
    width: 10em;
    height: 3em;
    font-size: 15px;
    cursor: pointer;
}

.model-content {
  background-color: rgb(44, 42, 39);
  color: antiquewhite;
  padding: 20px 30px;
  border-radius: 8px;
  text-align: center;
}

.model-content p {
    font-size: 25px;
}

.model-content button { 
    background-color: antiquewhite;
    color: black;
    border-radius: 4px;
    width: 8em;
    height: 2em;
    padding: 2x;
    font-size: 20px;
    cursor: pointer;
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
    align-content: center;
    justify-content: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1rem;
    background-color: rgb(192, 179, 166);
  }

  .container {
    padding: 15px;
    width: 15rem;   /* Half of 30rem */
    height: 23rem;  /* Half of 40rem */
    border-radius: 15px;
    flex-direction: column-reverse;
    margin-bottom: 1rem;
  }

  .containermode {
    font-size: 15px;
    width: 40px;
    height: 15px;
    padding: 5px;
  }

  .nightmode {
    background-color: black;
    color:antiquewhite;
    transform: translateX(25px);
    transition: 0.3s ease-out;
}

  .result {
    font-size: 20px; /* Half of 40px */
    padding: 10px;
    height: 15px;
    text-align: center;
  }

  #keys {
    gap: clamp(2px, 1vw, 6px); /* Half the spacing */
    padding: 15px;
  }

  button {
    font-size: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }

  .history {
    font-size: 15px;
    width: 40px;
    height: 15px;
    padding: 5px;
    
  }

  #historyentry {
    font-size: 20px;
    width: 12em;
    padding: 2px;
    gap: 10px;
    margin-top: 2rem;
    border-radius: 5px;
  }

  .clearbtn,
  .noContents button {
    font-size: 10px;
    width: 7em;
    height: 3.5em;
    padding: 5px;
  }

  .historycontainer {
    padding: 15px;
    width: 15rem;
    height: 23rem;
    border-radius: 15px;
    transform: translateX(0) translateY(-100%);

  }

  .show {
    transform: translateX(0) translateY(-5%);
  }

  .model-content p {
    font-size: 15px;
  }

  .model-content button {
    font-size: 15px;
    width: 4em;
    height: 1em;
  }
}



