/* CSS Properties Template
  1) Display stuff
  2) Positioning stuff
  3) Box model stuff
  4) Typography
  5) Manipulation
  6) Misc.
*/

:root {
  --calc-clr: #2f2e3f;
  --calc-shdw: #1d1d2562;
  --disp-clr: #fefefe;
  --mem-btn-clr: #4d88bc;
  --mem-btn-actv: #355e83;
  --mem-btn-shdw: #355d80;
  --num-btn-clr: #999db3;
  --num-btn-actv: #727585;
  --num-btn-shdw: #686b79;
  --func-btn-clr: #f0e7e7;
  --func-btn-actv: #ddd4d4;
  --func-btn-txt: #302f2f;
  --func-btn-shdw: #bdb6b6;
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
  font-family: "Ubuntu", monospace;
  font-weight: 700;
  color: white;
  height: 100vh;
}

.calculator {
  display: grid;
  grid-template-columns: 0.5em repeat(5, 1fr) 0.5em;
  grid-template-rows: 0.5em 2.5em repeat(5, 3em) 0.5em;
  gap: 0.5em;
  grid-template-areas:
    ". . . . . . ."
    ". display display display display display ."
    ". memory-add memory-sub memory-recall memory-clear clear-display ."
    ". seven eight nine division multiplication ."
    ". four five six sqrt percent ."
    ". one two three minus pos-neg ."
    ". zero dbl-zero decimal plus equals ."
    ". . . . . . .";
  /* background-color: var(--calc-clr); */
  background-image: linear-gradient(135deg, rgb(99, 7, 99), rgb(66, 6, 66));
  border-radius: 10px;
  box-shadow: 0 3px 4px 3px var(--calc-shdw);
}

#display {
  grid-area: display;
  margin-bottom: 0.5em;
  text-align: right;
  background-color: var(--disp-clr);
  /* font-family: ; */
  color: #090909;
}

#memory-add {
  grid-area: memory-add;
}

#memory-sub {
  grid-area: memory-sub;
}

#memory-recall {
  grid-area: memory-recall;
}

#memory-clear {
  grid-area: memory-clear;
}

#clear-display {
  grid-area: clear-display;
}

#seven {
  grid-area: seven;
}

#eight {
  grid-area: eight;
}

#nine {
  grid-area: nine;
}

#division {
  grid-area: division;
}

#multiplication {
  grid-area: multiplication;
  font-size: 1.75rem;
}

#four {
  grid-area: four;
}

#five {
  grid-area: five;
}

#six {
  grid-area: six;
}

#sqrt {
  grid-area: sqrt;
}

#percent {
  grid-area: percent;
}

#one {
  grid-area: one;
}

#two {
  grid-area: two;
}

#three {
  grid-area: three;
}

#minus {
  grid-area: minus;
  font-size: 1.5rem;
}

#pos-neg {
  grid-area: pos-neg;
}

#zero {
  grid-area: zero;
}

#dbl-zero {
  grid-area: dbl-zero;
}

#decimal {
  grid-area: decimal;
}

#plus {
  grid-area: plus;
  font-size: 1.5rem;
}

#equals {
  grid-area: equals;
}

/*============*/
/* Components */
/*============*/

.btn {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
}

.btn--number {
  background-color: var(--num-btn-clr);
  box-shadow: 0 3px 1px 1px var(--num-btn-shdw);
}

.btn--number:active {
  background-color: var(--num-btn-actv);
}

.btn--memory {
  background-color: var(--mem-btn-clr);
  font-size: 0.875rem;
  box-shadow: 0 3px 1px 1px var(--mem-btn-shdw);
}

.btn--memory:active {
  background-color: var(--mem-btn-actv);
}

.btn--function {
  background-color: var(--func-btn-clr);
  color: var(--func-btn-txt);
  font-size: 1.25rem;
  box-shadow: 0 3px 1px 1px var(--func-btn-shdw);
}

.btn--function:active {
  background-color: var(--func-btn-actv);
}

@media screen and (min-width: 500px) {
  .calculator {
    grid-template-columns: 0.5em repeat(5, 2em) 0.5em;
    grid-template-rows: 0.5em 2.5em repeat(5, 2em) 0.5em;
    gap: 0.5em;
  }
}
