.arrow {
  background: #fff;
  height: 3px;
  width: 30px;
  margin: 0 auto;
  position: relative;
  cursor: pointer;
}
.arrow:before,
.arrow:after {
  content: "";
  background: #fff;
  position: absolute;
  height: 3px;
  width: 15px;
}
.arrow:before {
  right: -3px;
  bottom: -4px;
  transform: rotate(-45deg);
}
.arrow:after {
  right: -3px;
  top: -4px;
  transform: rotate(45deg);
}

#animation1 + label > .arrow:before {
  animation: animation-1-before-reverse 1s ease 0s 1 alternate both;
}
#animation1 + label > .arrow:after {
  animation: animation-1-after-reverse 1s ease 0s 1 alternate both;
}
#animation1:checked + label > .arrow:before {
  animation: animation-1-before 1s ease 0s 1 alternate both;
}
#animation1:checked + label > .arrow:after {
  animation: animation-1-after 1s ease 0s 1 alternate both;
}

@keyframes animation-1-after {
  0% {
    right: -3px;
    top: -4px;
    transform: rotate(45deg);
  }
  50% {
    width: 3px;
    border-radius: 50%;
    top: -20px;
    left: 15px;
  }
  100% {
    left: -3px;
    bottom: -4px;
    transform: rotate(135deg);
    height: 3px;
    width: 15px;
    background: #fff;
  }
}
@keyframes animation-1-before {
  0% {
    right: -3px;
    bottom: -4px;
    transform: rotate(-45deg);
  }
  50% {
    width: 3px;
    border-radius: 50%;
    bottom: -20px;
    left: 15px;
  }
  100% {
    left: -3px;
    bottom: -4px;
    transform: rotate(-135deg);
    height: 3px;
    width: 15px;
    background: #fff;
  }
}
@keyframes animation-1-after-reverse {
  0% {
    left: -3px;
    bottom: -4px;
    transform: rotate(135deg);
    height: 3px;
    width: 15px;
    background: #fff;
  }
  50% {
    width: 3px;
    border-radius: 50%;
    top: -20px;
    left: 15px;
  }
  100% {
    right: -3px;
    top: -4px;
    transform: rotate(45deg);
  }
}
@keyframes animation-1-before-reverse {
  0% {
    left: -3px;
    bottom: -4px;
    transform: rotate(-135deg);
    height: 3px;
    width: 15px;
    background: #fff;
  }
  50% {
    width: 3px;
    border-radius: 50%;
    bottom: -20px;
    left: 15px;
  }
  100% {
    right: -3px;
    bottom: -4px;
    transform: rotate(-45deg);
  }
}

#animation2 + label > .arrow:before {
  animation: animation-2-before-reverse 1s ease 0s 1 alternate both;
}
#animation2 + label > .arrow:after {
  animation: animation-2-after-reverse 1s ease 0s 1 alternate both;
}
#animation2:checked + label > .arrow:before {
  animation: animation-2-before 1s ease 0s 1 alternate both;
}
#animation2:checked + label > .arrow:after {
  animation: animation-2-after 1s ease 0s 1 alternate both;
}

@keyframes animation-2-after {
  0% {
    right: -3px;
    top: -4px;
    transform: rotate(45deg);
    background: blue;
  }
  50% {
    width: 3px;
    border-radius: 50%;
    top: 20px;
    left: 15px;
  }
  100% {
    left: -3px;
    bottom: -4px;
    transform: rotate(135deg);
    height: 3px;
    width: 15px;
    background: #fff;
  }
}
@keyframes animation-2-before {
  0% {
    right: -3px;
    bottom: -4px;
    transform: rotate(-45deg);
    background: red;
  }
  50% {
    width: 3px;
    border-radius: 50%;
    bottom: 20px;
    left: 15px;
  }
  100% {
    left: -3px;
    bottom: -4px;
    transform: rotate(-135deg);
    height: 3px;
    width: 15px;
    background: #fff;
  }
}
@keyframes animation-2-after-reverse {
  0% {
    left: -3px;
    bottom: -4px;
    transform: rotate(135deg);
    height: 3px;
    width: 15px;
    background: #fff;
  }
  50% {
    width: 3px;
    border-radius: 50%;
    top: 20px;
    left: 15px;
    background: red;
  }
  100% {
    right: -3px;
    top: -4px;
    transform: rotate(45deg);
    background: #fff;
  }
}
@keyframes animation-2-before-reverse {
  0% {
    left: -3px;
    bottom: -4px;
    transform: rotate(-135deg);
    height: 3px;
    width: 15px;
    background: #fff;
  }
  50% {
    width: 3px;
    border-radius: 50%;
    bottom: 20px;
    left: 15px;
    background: blue;
  }
  100% {
    right: -3px;
    bottom: -4px;
    transform: rotate(-45deg);
    background: #fff;
  }
}

#animation3 + label > .arrow:before {
  animation: animation-3-before-reverse 1s ease 0s 1 alternate both;
}
#animation3 + label > .arrow:after {
  animation: animation-3-after-reverse 1s ease 0s 1 alternate both;
}
#animation3:checked + label > .arrow:before {
  animation: animation-3-before 1s ease 0s 1 alternate both;
}
#animation3:checked + label > .arrow:after {
  animation: animation-3-after 1s ease 0s 1 alternate both;
}

@keyframes animation-3-after {
  0% {
    right: -3px;
    top: -4px;
    transform: rotate(45deg);
    background: blue;
  }
  25% {
    width: 3px;
    border-radius: 50%;
    top: 20px;
    left: 15px;
  }
  75% {
    width: 3px;
    border-radius: 50%;
    top: -20px;
    left: 15px;
  }
  100% {
    left: -3px;
    bottom: -4px;
    transform: rotate(135deg);
    height: 3px;
    width: 15px;
    background: #fff;
  }
}
@keyframes animation-3-before {
  0% {
    right: -3px;
    top: -4px;
    transform: rotate(45deg);
    background: red;
  }
  25% {
    width: 3px;
    border-radius: 50%;
    top: -20px;
    left: 15px;
  }
  75% {
    width: 3px;
    border-radius: 50%;
    top: 20px;
    left: 15px;
  }
  100% {
    left: -3px;
    bottom: -4px;
    transform: rotate(-135deg);
    height: 3px;
    width: 15px;
    background: #fff;
  }
}
@keyframes animation-3-after-reverse {
  0% {
    left: -3px;
    bottom: -4px;
    transform: rotate(135deg);
    height: 3px;
    width: 15px;
    background: #fff;
  }
  50% {
    width: 3px;
    border-radius: 50%;
    top: -20px;
    left: 15px;
  }
  100% {
    right: -3px;
    top: -4px;
    transform: rotate(45deg);
  }
}
@keyframes animation-3-before-reverse {
  0% {
    left: -3px;
    bottom: -4px;
    transform: rotate(-135deg);
    height: 3px;
    width: 15px;
    background: #fff;
  }
  50% {
    width: 3px;
    border-radius: 50%;
    bottom: -20px;
    left: 15px;
  }
  100% {
    right: -3px;
    bottom: -4px;
    transform: rotate(-45deg);
  }
}

/* Arrow animation specific styles - scoped to avoid affecting global elements */
.arrow-demo {
  background: #000;
  color: #fff;
}
.arrow-demo .text-center {
  text-align: center;
}
.arrow-demo hr {
  border: none;
  height: 1px;
  width: 20%;
  background: #fff;
}
/* Arrow animation checkbox inputs only */
input#animation1,
input#animation2,
input#animation3 {
  display: none;
}
/* Arrow animation labels only */
label[for="animation1"],
label[for="animation2"],
label[for="animation3"] {
  margin-bottom: 100px;
  display: block;
}
