/* Post Feedback CSS */

.post-feedback {
  background: #f2f6ff;
  padding: 30px;
  margin: 0 0 22px;
  transition: all 0.3s;
  position: relative;

  @media print {
    & {
      display: none;
    }
  }

  h3 {
    font-size: 18px;
    line-height: 1.4;
    font-weight: normal;
    color: #4d4d4d;
    margin: 0 0 10px;
    text-align: center;
  }

  .post-feedback-form {
    .post-feedback-form-wrapper {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 20px;

      h3 {
        font-size: 20px;
        font-weight: 700;
        line-height: 28px;
        margin-bottom: 0;
      }
    }
  }

  .post-feedback-voting {
    .upvote,
    .downvote {
      -webkit-border-radius: 3px;
      -moz-border-radius: 3px;
      -ms-border-radius: 3px;
      border-radius: 3px;
      margin: 0 5px;
      display: inline-block;
      padding: 8px 30px;
      color: #fff;
      font-weight: normal;
      line-height: 1;
      text-align: center;
      text-decoration: none;
      height: 34px;
      background-repeat: no-repeat;
      position: relative;
      cursor: pointer;
      z-index: 999;

      &.checked {
        opacity: 0.8;
      }
    }

    &.disabled a {
      opacity: 0.1;
      cursor: default;
    }

    .upvote {
      background: #22c55e
        url("/wp-content/themes/imagely-edd/images/check-white.svg")
        no-repeat center center;
      background-size: 20px 20px;
    }

    .downvote {
      background: #ef4444
        url("/wp-content/themes/imagely-edd/images/cross.svg") no-repeat
        center center;
      background-size: 20px 20px;
    }

    .waiting {
      background-position: -100% -100%;
    }
  }

  .post-feedback-comment {
    height: 0;
    transition: all 0.3s;
    overflow: hidden;

    textarea,
    input {
      border: 1px solid #ddd;
      color: #444;
      font-size: 16px;
      padding: 12px 15px;
      margin: 10px 0 0 0;
      width: 100%;
      border-radius: 3px;
    }

    fieldset {
      padding: 0;
      border: none;
      margin-top: 10px;

      legend {
        font-size: 18px;
        font-weight: 700;
        line-height: 24px;
        letter-spacing: 0.25px;
        color: #1f2937;
        margin-bottom: 20px;
      }
    }

    .post-feedback-comment-reason {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-bottom: 20px;

      input[type="radio"] {
        transform: scale(1.2);
        width: 20px;
      }
    }

    .post-feedback-comment-email {
      input[type="checkbox"] {
        transform: scale(1.2);
        width: 20px;
      }
    }

    a.button {
      padding: 10px 32px 10px 32px;
      border-radius: 25px;
      font-size: 14px;
      font-weight: 800;
      line-height: 22px;
      letter-spacing: 0.25px;

      margin: 13px 0 0 0;
      position: relative;
      display: block;
      float: right;

      span {
        opacity: 1;
      }
    }

    &.waiting a {
      cursor: default;
    }

    &.waiting a span {
      opacity: 0;
    }

    &.open {
      height: auto;
    }
  }

  .post-feedback-confirm {
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: -30px;

    h3 {
      font-size: 24px;
      font-weight: 700;
      line-height: 36px;
      text-align: center;
    }

    img {
      height: 120px;
    }

    &.invisible {
      height: 0;
      margin-top: 0;
    }
  }

  .lds-ripple {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    opacity: 0;
  }

  .waiting .lds-ripple {
    opacity: 1;
  }

  &.hidden,
  .hidden {
    display: none;
  }

  .invisible {
    opacity: 0;
    transition: all 0.3s;
    height: 30px;
    margin-top: 0;
  }
}

.lds-ripple {
  width: 64px;
  height: 64px;
  transform: translate(-48%, -48%) scale(0.5);
}
.lds-ripple div {
  position: absolute;
  border: 4px solid #fff;
  opacity: 1;
  border-radius: 50%;
  animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.lds-ripple div:nth-child(2) {
  animation-delay: -0.5s;
}
@keyframes lds-ripple {
  0% {
    top: 28px;
    left: 28px;
    width: 0;
    height: 0;
    opacity: 1;
  }
  100% {
    top: -1px;
    left: -1px;
    width: 58px;
    height: 58px;
    opacity: 0;
  }
}
