@import 'src/styles/variables';

.quiz_answer {
  position: relative;
  width: 160px;
  padding-bottom: var(--space-m);

  cursor: pointer;
  border: none;
  box-shadow: none;
  outline-color: transparent;
  transition: width 0.5s;

  &_wrapper {
    display: inline-block;
    padding: 0;

    vertical-align: bottom;
    transition: padding 0.5s;

    &_small {
      padding: var(--space-s) var(--space-l);
    }
  }

  &_small {
    width: 128px;
  }

  &_icon {
    display: block;
    width: 100%;
    margin: 0 auto var(--space-l);

    background-position: center center;
    background-size: auto 100%;
    background-repeat: no-repeat;
    transition: background-size 0.5s;

    &:hover {
      background-size: auto 105%;
    }
  }

  &_text {
    --temp-bg: var(--color-white);
    --temp-text: var(--color-black);

    &_selected {
      --temp-bg: #5F9C92;
      --temp-text: var(--color-white);
    }

    &_correct {
      --temp-bg: #267A05;
      --temp-text: var(--color-white);
    }

    &_error {
      --temp-bg: #DD5F00;
      --temp-text: var(--color-white);
    }

    font-size: var(--font-m);
    font-weight: 100;
    position: relative;

    display: flex;
    justify-content: center;
    align-items: center;
    width: 80%;
    height: 40px;
    margin: var(--space-xxs) auto 0;

    text-align: center;
    border: 2px solid #6E605E;
    border-radius: var(--border-radius-m);
    color: var(--temp-text);
    background-color: var(--temp-bg);

    &:before {
      content: ' ';

      position: absolute;
      top: -8px;
      left: 43%;

      display: block;
      transform: rotate(45deg);

      border: 8px solid #6E605E;
      border-bottom-color: transparent;
      border-right-color: transparent;
    }
  }
}

.quiz_answer_wrapper + .quiz_answer_wrapper {
  margin-left: 64px;
}

.quiz_answer_wrapper_small {
  padding: var(--space-s) var(--space-l);

  & .quiz_answer {
    width: 128px;

    animation-delay: 1s;
    animation-duration: 2s;
    animation-iteration-count: infinite;
    animation-fill-mode: both;
    animation-name: quiz_answer;
  }

  & .quiz_answer_text {
    font-size: var(--font-s);
  }
}

@keyframes quiz_answer {
  from {
    top: 0;
    opacity: 1;
  }
  30% {
    opacity: 0.3;
  }
  to {
    top: 800px;
    opacity: 0.3;
  }
}

@media (max-width: 900px) {
  .quiz_answer {
    width: 100px;
    &_small {
      width: 68px;
    }
    &_text {
      font-size: var(--font-s);
      &:before {
        left: 39%;
      }
    }
  }
  .quiz_answer_wrapper_small .quiz_answer {
    width: 68px;
  }
  .quiz_answer_wrapper + .quiz_answer_wrapper {
    margin-left: var(--space-l);
  }
}
