body {
  background-image: url("./assets/background.svg");
  font-family: "Comic Sans MS";
}

/* For the initial helping hint */

.subtitle {
  border-radius: 5px;
  background-color: #8c8c8c;
  margin-bottom: 10px;
}

.subtitle > * {
  opacity: 80%;
  display: block;
  color: red;
  text-align: center;
  font-size: 24px;
  padding: 5px;
  text-transform: uppercase;
}

/* The vending machine */

#vending-body {
  
  outline: solid black 2px;
  border-radius: 5px 5px 0 0;
  padding: 5em;
  padding-top: 0;
  width: max-content;
  background: radial-gradient(ellipse at top left, #eee 30%, rgb(87, 196, 236), rgb(230, 225, 255));
  
  clip-path: polygon(
    0 0,
    100% 0,
    100% 100%,
    95% 100%,
    90% 99%,
    10% 99%,
    5% 100%,
    0 100%
  );
}

#vending-wrap {
  box-shadow: 2px 1px 20px 5px;
  width: max-content;
  background: black;
  position: relative;
  
}

.hint {
  position: absolute;
  width: 40%;
  font-size: 26px;
  text-align: center;
  height: 18%;
  left: 120%;
  z-index: 999;
  top: 25%;
  outline: solid rgb(32, 111, 246) 300px;
  padding: 1em;
  background-color: rgb(32, 111, 246);
  clip-path: polygon(
    0 0,
    100% 0,
    100% 75%,
    25% 75%,
    -100% 200%,
    15% 75%,
    0 75%
  );
}

/* For showing the flavor profile */
#popup {
  outline: solid black 2px;
  position: absolute;
  width: 80%;
  left: 110%;
  top: 10%;
  height: 80%;
  background-color: white;
  z-index: 9;
  
}

#popup > div {
  padding: 5em;
}

#popup img {
  margin: 0 auto;
  display: block;
  margin-bottom: 5em;
}

#popup * {
  font-family: inherit;
}

.rating {
  margin-top: 5px;
  margin-bottom: 0;
}

#popup ul {
  list-style: none;
  margin: 0;
  display: flex;
  justify-content: center;
  font-size: 42px; 
  padding: 1em;
  gap: .5em;
  margin-bottom: 5px;
}

#popup li {
  line-height: 0;
}

#popup li::after {
  content: "⭐";
  line-height: 0;
  text-shadow: 2px 2px 3px;
}

#popup button {
  outline: none;
  border: solid black 5px;
  padding: 5px;
  box-sizing: border-box;
  background-color: transparent;
  font-size: 24px;
  display: block;
  margin: 0 auto;
  position: relative;
}

#popup button:hover {
  background-color: dodgerblue;
  color: white;
}

#popup p {
  font-size: 18px;
}

.hidden {
  display: none;
}

.jp-text {
  font-family: "Rampart One", sans-serif;
  font-weight: 700;
  text-align: center;
  font-style: normal;
  font-size: 64px;
}

/* Vending Top */
  
/* To showcase the drinks */
.window {
  padding: 1em;
  filter: brightness(90%);
  outline: solid black 1px;
  border-radius: 5px;
}

.window, .selections {
  display: flex;
  justify-content: space-evenly;
  gap: 2em;
  background-color: white;
  
}

.window img {
  width: 25%;
  max-width: 70px;
  border-bottom: 1px solid black;
  
}

/* To 'order' the drinks */
.selections {
  background-color: transparent;
  padding: .5em 1em;
}



.selections button {
  width: 25%;
  background-color: #222;
  border-radius: 20px;
  outline: none;
  border: none;
  padding-top: 5px;
  padding-bottom: 5px;
  padding-right: 30px;
  max-width: 70px;
}

button:enabled:hover {
  cursor: pointer;
}

.blink { 
  display: block;
  height: 20px;
  border-radius: 20px;
  background-color: #d3d3d3;
}

/* Blinks the options when ready */
.on {
  animation: 1.5s flash reverse infinite steps(1, end);
}

@keyframes flash {
  0% {
    background-color: #d3d3d3;
  }

  50% {
    background-color: rgb(234, 56, 56);
  }
}




/* Vending Middle */
/* For the logo panel and currency interaction */
#vending-middle {
  display: flex;
  flex-direction: row;
  padding: 2em 0em;
  gap: 2em;
  justify-content: space-between;
  align-items: center;
}

#logo-panel {
  background-color: #fff;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: solid black 1px;
  border-radius: 5px;
  padding-left: 1em;
  padding-right: 1em;
}

#logo-space {
  display: block;
  margin: none;
  max-width: 125px;
  object-fit: contain;
}

#currency-panel {
  display: flex;
}

#bill-panel {
  border: solid black 1px;
  border-right: none;
  box-sizing: border-box;
  background-color: #d3d3d3;
  width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-radius: 5px 0px 0px 5px;
  text-align: center;
  font-size: 14px;
}

#bill-feed {
  width: 80%;
  height: 20px;
  background-color: #000;
  border: #777 solid 4px;
  border-top: #ddd 4px solid;
  box-sizing: border-box;
}

#coin-panel {
  box-sizing: border-box;
  border: solid black 1px;
  border-left: none;
  background-color: #d3d3d3;
  padding: 1em;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border-radius: 0px 5px 5px 0px;
  gap: 10px;
}
#coin-interface {
  display: flex;
  justify-content: space-between;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  
}
#coin-feed {
  background-color: black;
  border: none;
  width: 2px;
  height: 40px;
}

#change-button {
  outline:black solid 1px;
  aspect-ratio: 1/1;
  width: 30px;
  border-radius: 500px;
  background: radial-gradient(white, black 400%);
  border: none;
}

#coin-return {
  outline:solid black 1px;
  width: 30px;
  aspect-ratio: 1/1;
  background: linear-gradient(grey 90%, black);
}

/* Vending lower */
/* For the dispensing of the drink */
#drink-dispenser {
  outline: solid black 1px;
  background-color: white;
  position: relative;
}

#dispenser-door {
  background-color: #6a6161;
  height: 80px;
  opacity: 70%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 30px;
  line-height: 0;
  letter-spacing: 1rem;
  flex-direction: column;
  gap: 1em;
  transform-origin: top;
  z-index: 1; 
  font-weight: 900;
}

.open {
  animation: openDoor linear 1s forwards;
}

.close {
  animation: openDoor linear 1s reverse;
}

@keyframes openDoor {
  0%{
    transform: rotateX(0deg);
  }
  100%{
    transform: rotateX(85deg);
  }
}

#dispenser-door > div {
  outline:solid black 2px;
  height: 1px;
  width: 80%;
}

#drink {
  /* outline: solid red 2px */
  border: none;
  position: absolute;
  left: 40%;
  top: -100px;
  width: 55px;
  height: 100px;
  background-image: var(--can-image);
  background-size:contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: rotate(90deg);
  z-index: 0;
  opacity: 0%;
  cursor: unset;
}

.drop {
  animation: dropCan forwards 1s;
}

.drop:hover {
  outline:yellow solid 2px;
  cursor: pointer;
}

@keyframes dropCan {
  0%{
    top: -100px;
    opacity: 0%;
  }

  20%{
    top: 0px;
    opacity: 100%;
  }

  40% {
    top: -10px;
  }

  52%{
    top:-2px;
  }

  65% {
    top: 1px;
  }

  70% {
    top:3px;
  }

  100% {
    top:3px;
    opacity: 100%;
  }
}
