* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* body {
  background-color: rgb(224, 223, 223);
} */

html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  background-color: rgb(224, 223, 223);
}

header {
  background-color: rgb(46, 46, 46);
  color: #f3a532;
  padding: 20px;
  text-align: center;
}

footer {
  background-color: rgb(46, 46, 46);
  color: #f3a532;
  padding: 20px 0;
  text-align: center;
  margin-top: auto;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 4rem;
  padding: 2rem;
}

.calculator {
  width: 350px ;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 8px;
  padding: 15px;
  background: #222;
  border-radius: 12px;
  color: white;
}

#display {
  grid-column: 1 / -1;
  background: #000;
  color: rgb(224, 223, 223);
  text-align: right;
  font-size: 2rem;
  padding: 10px;
  border-radius: 8px;
}

.controls {
  grid-column: span 4;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  background: #222;
  color: #fff;
}

#chainBtn {
  padding: 5px;
  border: none;
  border-radius: 8px;
  background: #222;
  color: #fff;
}

#chainBtn:hover {
  background-color: #222;
  color: grey;
}

.history-btn {
  border: none;
  border-radius: 8px;
  background: #222;
  color: #fff;
}

.history-btn:hover{
  background-color: #222;
  color: grey;
}

.btn {
  font-size: 1.2rem;
  padding: 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: #444;
  color: #fff;
}

.btn:hover {
  background-color: white;
  color: #444;
}

.operator { 
    background: #ff9800; 
}
.clear {
  background: rgb(244, 34, 34);
}
.delete {background: gray;}
.equals {background: green;}

.history-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  width: 400px;
  border-radius: 10px;
  margin-top: 50px;
  margin-bottom: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.history-box {
  background: whitesmoke;
  color: #1e1e1e;
  border: grey solid;
  width: 300px;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 4px 10px rgba(0,0,0,.3);
}

.history-header {
  background-color: whitesmoke;
  display: flex;
  align-items: center;
  gap: .5rem;
  border-bottom: 1px solid #444;
  padding-bottom: .5rem;
  margin-bottom: .5rem;
  border: none;
}

.history-header:hover{
  background-color: whitesmoke;
  color: grey;
}

#history-box {
  display: none;
  max-height: 200px;
  overflow-y: auto;
  padding: 0px;
  margin-top: 5px;
  list-style: none;
}

#history-box.show {
  display: block;
}

.history-box li {
  padding: .4rem 0;
  border-bottom: 1px solid #333;
  font-size: .9rem;
}

.history-box li:last-child {
  border-bottom: none;
}

@media (max-width: 700px) {
    .hero{
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
}