* {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0;
  font-family: 'Share Tech Mono', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  min-height: 100vh;
  background-color: #1f2937;
  -webkit-font-smoothing: antialiased;
}

header {
  font-family: 'Share Tech Mono', sans-serif;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  width: 100%;
  border-bottom: 1px solid #e0ad6c30;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  font-weight: bold;
  color: #e0ad6c;
  box-shadow: rgb(28, 27, 28) 0px 7px 15px 7px;
}

.calculator {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 350px;
  height: 550px;
  border: 3px solid rgb(28, 27, 28);
  border-radius: 20px;
  background-color: #2b313b;
  box-shadow: rgb(28, 27, 28) 0px 6px;
  padding: 14px;
  margin: auto;
}


.calc-header {
  font-weight: bold;
  text-align: end;
  padding: 10px;
  color: #1c121a;
  border: #1c121a 3px solid;
  border-radius: 10px;
  background-color: #e0ad6c;
}

.calc-model {
  font-size: 20px;
  text-align: end;
  color: #1c121a;
  border-bottom: 0.5px #1c121a solid;
  margin: 6px 0px 10px;
}

.display {
  height: 100px;
  border: 2px solid rgb(28, 27, 28);
  border-radius: 8px;
  background-color: #A4B4CD;
  box-shadow: inset 0px 2px 3px 2px;
  transition: background-color 0.3s ease;
}

.display.error {
  background-color: #c43f24;
}

.upper-display {
  height: 30px;
  font-size: 20px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.main-display {
  height: 70px;
  font-size: 40px;
}

.upper-display,
.main-display {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  color: #1c121a;
}

.button-container {
  display: flex;
  justify-content: space-between;
  height: 350px;
  gap: 6px;
  margin: 10px 0px 5px;
}

.button-column {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.calc-button {
  flex: 1; 
  border: 2px solid #1C121A;
  border-radius: 8px;
  font-weight: bold;
  font-size: 40px;
  box-shadow: rgb(28, 27, 28) 0px 6px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  background-color: #e5e7eb;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out, background-color 0.2s;
  color: #1c121a;
  -webkit-appearance: none;
  appearance: none;
}

.calc-button:active {
  transform: translateY(3px) scale(0.95) !important;
  box-shadow: 1px 1px 2px rgba(65, 62, 62, 0.6);
  transition: transform 0s;
  background-color: #cacad7ce !important;
}

.calc-button.operator:active,
.calc-button.percent:active {
  background-color: #4a93f297 !important;
}

.calc-button.equals:active,
.calc-button.backspace:active {
  background-color: #e0ae6ca4!important;
}

.calc-button.operator,
.percent{
  background-color: #4a93f2;
}

.calc-button.equals,
.calc-button.backspace {
  background-color: #e0ad6c;
}

.calc-button.clear {
  background-color: #c43f24f1;
}

.calc-button.clear:active {
  background-color: #c43f2497!important;
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  font-size: 20px;
  color: #e5e7eb;
}

footer a {
  color: #3882f6;
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: #21a1f1;
  text-decoration: underline;
}



/* Tablet */
@media (max-width: 768px) {
  .calculator {
    width: 75vw;
    height: auto;
  }

  .button-container {
    height: 55vw;
  }

  .calc-button {
    font-size: 5vw;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, background-color 0.2s;
  }

  .main-display {
    font-size: 5vw;
  }

  .upper-display {
    font-size: 2.5vw;
  }

  .calc-model {
    font-size: 2.5vw;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .calculator {
    width: 85vw;
    height: auto;
  }

  .button-container {
    height: 65vw;
  }

  .calc-button {
    font-size: 8vw;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, background-color 0.2s;
  }

  .main-display {
    font-size: 10vw;
  }

  .upper-display {
    font-size: 3.5vw;
  }

  .calc-model {
    font-size: 3.5vw;
  }

  footer {
  font-size: 14px;
}
}