@import url('https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght@300&display=swap');

* {
  box-sizing: border-box;
}

body {
  font-family: 'Open Sans Condensed', sans-serif;
  background: url(img/bg.svg) center center no-repeat;
  background-size: cover;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0;
  overflow: hidden;
  color: rgb(0, 33, 61);
}

h1 {
  margin: 0 0 8px 0;
}

button {
  cursor: pointer;
}
button:focus,
textarea:focus {
  outline: 0;
}

button.btn {
  border: solid 1px rgb(184, 243, 22);
  background-color: rgb(184, 243, 22);
  box-shadow: 0 6px 14px -8px black;
  height: 33px;
  width: 130px;
  border-radius: 3px;
  transition: 0.4s;
}

button.btn:hover {
  border-color: rgb(0, 33, 61);
  background-color: rgb(255, 254, 254);
  box-shadow: none;
  transition: 0.4s;
}

#close-btn,
.nav-btn {
  border: 0;
  background-color: transparent;
}

#del-btn {
  position: absolute;
  bottom: 40px;
  left: 40px;
}
@media only screen and (max-width: 500px) {
  #del-btn {
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    -webkit-transform: translateX(-50%);
  }
}

/*------------------------------------------*/
.cards-container {
  perspective: 1000px; /*tip*/
  -webkit-perspective: 1000px;
  position: relative;
  height: 300px;
  width: 500px;
  max-width: 80%;
  margin-top: 30px;
}
@media only screen and (max-width: 500px) {
  .cards-container {
    height: 200px;
  }
}

#nav-error {
  position: absolute;
  opacity: 0;
  z-index: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  background-color: rgb(184, 243, 22);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 25px;
  border-radius: 10px;
  transition: 0.4s;
}
#nav-error.show {
  opacity: 1;
  z-index: 20;
  transition: 0.4s;
}

.card {
  position: absolute;
  opacity: 0;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  text-align: center;
  transform: translateX(50%) rotateY(-10deg); /*tip: animate cards when clicking on next or pre*/
  -webkit-transform: translateX(50%) rotateY(-10deg);
  transition: transform 0.4s ease, opacity 0.4s ease; /*tip: animate cards when clicking on next or pre*/
}

.card.active {
  z-index: 5;
  opacity: 1;
  cursor: pointer;
  transform: translateX(0) rotateY(0); /*tip: animate cards when clicking on next or pre*/
  -webkit-transform: translateX(0) rotateY(0);
}

.card.left {
  transform: translateX(-50%) rotateY(10deg); /*tip: animate cards when clicking on next or pre*/
  -webkit-transform: translateX(-50%) rotateY(10deg);
}

.inner-card {
  height: 100%;
  width: 100%;
  transition: 0.3s;
  transform-style: preserve-3d; /*tip: rotate card to switch between question and answer*/
  /*TODO*/
  -webkit-transform-style: preserve-3d;

  transition: transform 0.4s ease; /*tip: rotate card to switch between question and answer*/
}

.card.show-answer .inner-card {
  /*tip: rotate card to switch between question and answer*/
  transform: rotateX(180deg);
  -webkit-transform: rotateX(180deg);
}

.inner-card:hover .inner-card-back::after,
.inner-card:hover .inner-card-front::after {
  color: rgb(157, 214, 0);
}

.inner-card-back,
.inner-card-front {
  backface-visibility: hidden; /*tip: rotate card to switch between question and answer*/
  /*TODO*/
  -webkit-backface-visibility: hidden;

  font-size: 23px;
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background-color: white; /*tip*/
  box-shadow: 0 0 14px -3px black;
  border-radius: 10px;
}

.inner-card-back::after,
.inner-card-front::after {
  content: '\f021'; /*tip*/
  font-family: 'Font Awesome 5 Free', 'Open Sans Condensed', sans-serif; /*tip*/
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 14px;
  font-weight: bold; /*tip*/
  color: rgb(206, 206, 206);
}
.inner-card-back:hover,
.inner-card-front:hover {
  box-shadow: none;
  transition: 0.3s;
}

.inner-card-front {
  /*tip: rotate card to switch between question and answer*/
  transform: rotateX(0deg);
  -webkit-transform: rotateX(0deg);
  z-index: 2;
}
.inner-card-back {
  /*tip: rotate card to switch between question and answer*/
  transform: rotateX(180deg);
  -webkit-transform: rotateX(180deg);
}

/*--------------------------------------------*/
.navigation {
  display: flex;
  margin: 15px 0;
  background-color: white;
  padding: 10px;
}

.nav-btn {
  font-size: 17px;
}
.nav-btn:hover {
  color: rgb(157, 214, 0);
}

.navigation p {
  margin: 0 20px;
}

/*------------------------------------------*/
#new-card-form {
  background-color: rgb(224, 241, 177);
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: -1;
  opacity: 0;
  transition: 0.4s;
}

#new-card-form.show {
  z-index: 3;
  opacity: 1;
}

#new-card-form .form-group {
  width: 500px;
  max-width: 80%;
}

#new-card-form label {
  display: block;
  margin: 10px 0;
  font-weight: 700;
}

#new-card-form #close-btn {
  position: absolute;
  top: 8vh;
  right: 10vw;
  font-size: 25px;
}

#add-btn {
  margin: 20px 0;
}

textarea {
  padding: 15px;
  width: 100%;
}
