/* >>>>>> VARIABLES <<<<<< */
:root {
  --calculatorRadius: 20px;
  --contentMargins: 30px;
  --transparentColor: rgb(245, 245, 245, 0.4);
  --solidColor: whitesmoke;
  --accentColor: #e9415d; /*#e9415d*/
}

/* >>>>>> FONTS <<<<<< */
/*Barna Light*/
@font-face {
  src: url(../fonts/Barna-Light.woff);
  font-family: BarnaLight;
}

/*Barna Bold*/
@font-face {
  src: url(../fonts/Barna-Bold.woff);
  font-family: BarnaBold;
}

/* >>>>>> GENERAL <<<<<< */
* {
  padding: 0;
  margin: 0;
  border: 0;
  /* border: 1px solid red; */
}

body {
  /* Lightmode: background */
  background-image: linear-gradient(25deg, #dd005f, #e9415d, #f4635a, #ff7f56);
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* **** CALCULATOR **** */
/* Container */
.calculator-body {
  width: 360px;
  height: 700px;
  background-image: linear-gradient(-25deg, #f9f9f9b6, #f9f9f945);
  border-radius: var(--calculatorRadius);
  display: flex;
  flex-direction: column;
  transition: 0.4s;
  animation: none;
}

/* Close, minimize, maximize calculator */
.window-bar {
  width: calc(inherit-var(--contentMargins));
  background-color: var(--transparentColor);
  height: 40px;
  border-radius: var(--calculatorRadius) var(--calculatorRadius) 0 0;
  display: flex;
  align-items: center;
  justify-content: left;
  padding: 10px var(--contentMargins) 0 var(--contentMargins);
  transition: inherit;
}

.window-icon {
  color: var(--solidColor);
  background-color: var(--transparentColor);
  border-radius: 30px;
  font-family: BarnaLight;
  font-size: 25px;
  width: 25px;
  height: 25px;
  text-align: center;
  margin-right: 10px;
}

.dark-light-button {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
}

/* Display box (top)*/
.display-box {
  background-color: var(--transparentColor);
  height: 110px;
  /* Comprobar otro método */
  width: calc(inherit-var(--contentMargins));
  padding: 10px var(--contentMargins) var(--contentMargins)
    var(--contentMargins);
  display: flex;
  flex-direction: column;
  transition: inherit;
  animation: none;
}

/* Darkmode button + history */
.top-bar {
  display: flex;
  justify-content: space-between;
  width: inherit;
  height: 40px;
}

/* Dark/Light mode button */
.uil {
  font-family: BarnaLight;
  font-size: 25px;
  color: var(--solidColor);
}

/* Historial */
#historial {
  font-family: BarnaLight;
  font-size: 25px;
  width: 300px;
  height: 25px;
  text-align: right;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    rgba(245, 245, 245, 0.009) 5%,
    var(--accentColor) 20%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Calculator output */
#output {
  font-family: BarnaLight;
  font-size: 70px;
  text-align: right;
  vertical-align: bottom;
  flex-grow: 1;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    rgba(245, 245, 245, 0.009) 0%,
    var(--solidColor) 30%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Button box (bottom)*/
.buttons-box {
  /* Comprobar otro método */
  width: calc(inherit-var(--contentMargins));
  flex-grow: 1;
  border-radius: 0 0 var(--calculatorRadius) var(--calculatorRadius);
  display: flex;
  flex-direction: column;
  padding: var(--contentMargins);
  justify-content: space-evenly;
}

/* Buttons rows */
.control-row {
  height: 25px;
  display: flex;
  padding: 5px 0;
}

.row {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
}

.button,
.window-icon,
#output,
#historial {
  transition: 0.2s;

  /* Not selecting text inside buttons */
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none; /* Safari */
  -khtml-user-select: none; /* Konqueror HTML */
  -moz-user-select: none; /* Old versions of Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
  user-select: none; /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */
}

.c-button,
.n-button,
.o-button {
  flex: 1 1;
  border-radius: 32px;
  font-family: BarnaLight;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.4s;
}

.c-button {
  height: 25px;
  /* border: 1px solid whitesmoke; */
  /* color: whitesmoke; */
  margin: 0 5px 5px;
}

.n-button,
.o-button {
  height: 65px;
  font-size: 32px;
  flex-grow: 1;
  margin: 5px;
}

.c-button,
.o-button,
.window-icon {
  background-color: var(--transparentColor);
  color: var(--solidColor);
}

.n-button {
  background-color: var(--solidColor);
  color: var(--accentColor);
}

/* Clicking buttons (general button scale) */
.c-button:active,
.n-button:active,
.o-button:active,
.window-icon:active {
  transform: scale(0.7);
}

/* Clicking control/operator buttons */
.c-button:active,
.o-button:active,
.window-icon:active {
  color: var(--accentColor);
  background-color: var(--solidColor);
}

/* Clicking number buttons */
.n-button:active {
  color: var(--solidColor);
  background-color: var(--transparentColor);
}

#equal {
  flex-grow: 2.1;
  margin: inherit inherit inherit 90px;
}

/* >>>>>> ANIMATIONS <<<<<< */
/* General calculator */
@keyframes closeCalculator {
  0% {
    height: 700px;
    opacity: 100%;
  }
  25% {
    opacity: 0%;
  }
  100% {
    height: 0;
    opacity: 0%;
  }
}

@keyframes minimizeCalculator {
  0% {
    height: 700px;
  }
  100% {
    height: 200px;
  }
}

@keyframes maximizeCalculator {
  0% {
    height: 200px;
  }
  100% {
    height: 700px;
  }
}

/* Display */
@keyframes minimizeDisplay {
  0% {
    border-radius: 0 0 0 0;
  }
  100% {
    border-radius: 0 0 var(--calculatorRadius) var(--calculatorRadius);
  }
}

@keyframes maximizeDisplay {
  0% {
    border-radius: 0 0 var(--calculatorRadius) var(--calculatorRadius);
  }
  100% {
    border-radius: 0 0 0 0;
  }
}

/* Display */
@keyframes minimizeButtons {
  0% {
    opacity: 100%;
  }
  75% {
    opacity: 0%;
  }
  100% {
    opacity: 0%;
  }
}

@keyframes maximizeButtons {
  0% {
    opacity: 0%;
  }
  65% {
    opacity: 0%;
  }
  100% {
    opacity: 100%;
  }
}
