@import url("../../assets/css/reset.css");
@import url("../../assets/css/global.css");

body {
  background-color: var(--primary-color);
}

body::before {
  content: "";
  background-image: url("../../assets/images/spider-man-background.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  width: 100%;
  height: 100%;
  position: absolute;
  opacity: 0.2;
  transition: background-image 1s ease-in-out, opacity 1s ease-in-out;
}

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 25%;
  position: relative;
}

.s-menu {
  padding-top: 1rem;
  width: 100%;
  text-align: center;
  position: relative;
}

.s-menu__item {
  display: inline-block;
  width: 9rem;
  text-transform: uppercase;
  margin: 0 0.25rem;
}

.s-nemu__item--gt-hidden {
  display: none;
}

.s-menu__icon {
  width: 2.5rem;
  margin: 0 1.25rem;
  vertical-align: middle;
}

.s-menu__icon img {
  max-height: 3.25rem;
}

.s-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 3000px;
}

.s-card {
  border: 0.5rem solid white;
  width: 100%;
  height: 60vh;
  position: absolute;
  margin-top: 9.5vh;
  transition: filter 0.5s ease-in-out;
}

.s-card:nth-child(1) {
  transform: rotateY(0deg) translateZ(50vw);
}

.s-card:nth-child(2) {
  transform: rotateY(120deg) translateZ(50vw);
}

.s-card:nth-child(3) {
  transform: rotateY(240deg) translateZ(50vw);
}

.s-card__background {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  opacity: 1;
  transition: opacity 1s ease-in-out;
}

.s-card__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  transition: 1s ease-in-out;
}

.s-card__title {
  font-size: 2rem;
  text-transform: uppercase;
  text-align: center;
  position: absolute;
  width: 100%;
  bottom: 0;
  transition: bottom 1s ease-in-out;
}

.s-controller {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  bottom: 1.5rem;
  width: 100%;
}

.s-controller__actions {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 50%;
  position: relative;
}

.s-controller__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid white;
  border-radius: 50%;
  background-color: var(--primary-color);
  text-align: center;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 1;
  transition: transform 0.3s ease-in-out;
}

.s-controller__button:hover {
  transform: scale(1.1);
}

.s-controller__button:nth-child(2) {
  margin: 0 3.75rem;
}

.s-controller__button:nth-child(4) {
  margin: 0 3.75rem;
}

.s-controller__button--active {
  background-color: white;
  color: var(--primary-color);
  border: 0.1875rem solid var(--primary-color);
  outline: 0.125rem solid white;
}

.s-controller__line {
  background-color: white;
  width: 100%;
  height: 2px;
  position: absolute;
}

.s-controller__previous-button {
  position: absolute;
  left: -2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 2rem;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1;
  transition: transform 0.3s ease-in-out, border-color 0.3s ease-in-out;
}

.s-controller__previous-button:hover {
  transform: scale(1.1);
  border-color: white;
}

.s-controller__next-button {
  position: absolute;
  right: -2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 2rem;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1;
  transition: transform 0.3s ease-in-out;
}

.s-controller__next-button:hover {
  transform: scale(1.1);
  border-color: white;
}

/* Animation on hover in card */

.s-card--hovered .s-card__background {
  cursor: pointer;
  opacity: 0;
}

.s-card--hovered .s-card__image {
  transform: scale(1.4);
  filter: drop-shadow(30px 10px 4px rgba(0, 0, 0, 0.5));
}

body#spider-man-01-hovered::before {
  background-image: url("../../assets/images/pic-sm-bg-01.jpg");
}

body#spider-man-02-hovered::before {
  background-image: url("../../assets/images/pic-sm-bg-02.jpg");
}

body#spider-man-03-hovered::before {
  background-image: url("../../assets/images/pic-sm-bg-03.jpg");
}

body[id^="spider-man-"]::before {
  opacity: 1;
}

body[id^="spider-man-"] .s-card:not(.s-card--hovered) {
  filter: grayscale(100%);
}

.s-card--hovered .s-card__title {
  bottom: 50%;
}

.s-card-carousel {
  display: flex;
  justify-content: center;
  width: calc(100vw / 3 - 10%);
  transform-style: preserve-3d;
  transition: transform 0.4s ease-in;
}

@media screen and (max-width: 600px) {
  .s-nemu__item--lt-hidden {
    display: none;
  }

  .s-nemu__item--gt-hidden {
    display: inline-block;
  }

  .s-controller__button:nth-child(2) {
    margin: 0 2rem;
  }

  .s-controller__button:nth-child(4) {
    margin: 0 2rem;
  }
}

@media screen and (max-width: 768px) {
  .s-menu__item {
    width: 6rem;
  }

  .s-card {
    width: 72vw;
    margin-top: 7vh;
  }

  .s-card:nth-child(1) {
    transform: rotateY(0deg) translateZ(30vw);
  }

  .s-card:nth-child(2) {
    transform: rotateY(120deg) translateZ(30vw);
  }

  .s-card:nth-child(3) {
    transform: rotateY(240deg) translateZ(30vw);
  }

  .s-card__title {
    font-size: 1.5rem;
  }

  .s-card--hovered .s-card__background {
    opacity: 1;
  }

  body#spider-man-01-hovered::before {
    background-image: url("../../assets/images/spider-man-background.jpg");
  }

  body#spider-man-02-hovered::before {
    background-image: url("../../assets/images/spider-man-background.jpg");
  }

  body#spider-man-03-hovered::before {
    background-image: url("../../assets/images/spider-man-background.jpg");
  }

  body[id^="spider-man-"]::before {
    opacity: 1;
  }

  .s-controller__actions {
    width: 72%;
  }
}

@media screen and (max-height: 600px) {
  .s-menu {
    padding-top: 0.125rem;
  }

  .s-container {
    perspective: 2000px;
  }

  .s-card {
    margin-top: 0;
  }

  .s-card__title {
    font-size: 1.5rem;
  }

  .s-controller {
    bottom: 0.5rem;
  }
}
