// Quiz popup
body.admin-bar .#{$prefix}-popup-course {
  top: 2rem;
}
body.#{$prefix}-sidebar-toggle__close .#{$prefix}-popup-header {
  left: 0;
}
body.#{$prefix}-sidebar-toggle__close .#{$prefix}-sidebar-toggle::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(255, 255, 255, 1)'%3E%3Cpath d='M16 12L10 18V6L16 12Z'%3E%3C/path%3E%3C/svg%3E") !important;
}
body.#{$prefix}-sidebar-toggle__close #popup-sidebar {
  // flex: 0;
  transform: translateX(-101%);
}
// body.#{$prefix}-sidebar-toggle__close #popup-header,
// body.#{$prefix}-sidebar-toggle__close #popup-footer {
//   left: 0;
// }
body.#{$prefix}-sidebar-toggle__close .#{$prefix}-popup-wrap {
  padding-left: 0;
}
.#{$prefix}-popup-course {
  display: flex;
  position: fixed;
  z-index: 99999;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgb(var(--wpt-lms-white));
  .#{$prefix}-popup-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: fixed;
    box-shadow:
      0 1px 4px rgba(58, 58, 87, 0.082),
      0 1px 0 rgba(44, 44, 64, 0.063);
    // flex: 0 0 400px;
    width: 400px;
    height: 100svh;
    transform: translateX(0);
    transition: all 0.2s ease-in-out;
    background-color: rgb(var(--wpt-lms-white));
    border-right: 1px solid rgba(var(--wpt-lms-box-border), 0.5);
    z-index: 9;
    .#{$prefix}-form {
      display: flex;
      position: relative;
      padding: 1rem;
      box-shadow: none;
      border-radius: 0;
      border: 0;
      border-bottom: 1px solid rgba(var(--wpt-lms-box-border), 0.5);
      width: 100%;
      input {
        width: 100%;
        // border: 0;
        &:focus {
          box-shadow: none !important;
        }
        &:hover {
          box-shadow: none !important;
        }
      }
      button {
        position: absolute;
        top: 0;
        right: 0.625rem;
        height: 4.375rem;
        padding: 0 0.625rem;
        border: 0;
        background: transparent;
        line-height: 0.063rem;
        &::before {
          background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='18' height='18' fill='rgba(153,153,153,1)'%3E%3Cpath d='M11 2C15.968 2 20 6.032 20 11C20 15.968 15.968 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2ZM11 18C14.8675 18 18 14.8675 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18ZM19.4853 18.0711L22.3137 20.8995L20.8995 22.3137L18.0711 19.4853L19.4853 18.0711Z'%3E%3C/path%3E%3C/svg%3E");
          width: 1.125rem;
          height: 1.125rem;
          content: "";
          position: absolute;
          top: 0;
          bottom: 0;
          right: 1.25rem;
          margin: auto;
        }
        &:focus {
          outline: none;
        }
        &.clear {
          display: none;
          &::before {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='18' height='18' fill='rgba(153,153,153,1)'%3E%3Cpath d='M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z'%3E%3C/path%3E%3C/svg%3E") !important;
            width: 1.125rem;
            height: 1.125rem;
            content: "";
            position: absolute;
            top: 0;
            bottom: 0;
            right: 1.25rem;
            margin: auto;
          }
        }
      }
      &.searching {
        button {
          display: none;
        }
        .clear {
          display: block;
        }
      }
    }
    .#{$prefix}-course-curriculum {
      flex-grow: 1;
      overflow-y: auto;
      padding: 1rem;
      .#{$prefix}-curriculum-sections {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        li.section {
          background-color: rgba(var(--wpt-lms-gray), 0.05);
          border-radius: .5rem;
          padding: 1rem;
          display: flex;
          flex-direction: column;
          gap: 1rem;
        }
      }
    }
  }
  .#{$prefix}-popup-wrap {
    padding-left: 400px;
    transition: all 0.2s ease-in-out;
    width: 100%;
    height: 100svh;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    // z-index: 8;
    .#{$prefix}-popup-header {
      display: flex;
      justify-content: space-between;
      gap: 1.25rem;
      position: relative;
      z-index: 100;
      // right: 0;
      // left: 400px;
      padding: 1rem;
      transition: all 0.2s ease-in-out;
      background-image: linear-gradient(to right,
          rgba(var(--wpt-lms-primary-950), 1),
          rgba(var(--wpt-lms-primary-700), 1));
      .#{$prefix}-sidebar-toggle {
        width: 2rem;
        height: 2rem;
        border-radius: 0.5rem;
        background-color: rgb(var(--wpt-lms-primary-700));
        color: rgba(var(--wpt-lms-white));
        display: flex;
        flex-wrap: wrap;
        place-content: center;
        font-size: 1.225em;
        cursor: pointer;
        transition: 0.25s;
        border: 0;
        text-align: center;
        -webkit-appearance: none;
        &::before {
          position: absolute !important;
          width: 1.875rem !important;
          height: 1.875rem !important;
          top: 0 !important;
          content: "" !important;
          background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(255,255,255,1)'%3E%3Cpath d='M8 12L14 6V18L8 12Z'%3E%3C/path%3E%3C/svg%3E");
          bottom: 0 !important;
          margin: auto !important;
          background-repeat: no-repeat;
        }
      }
      // input[type="checkbox"]:checked {
      //   background-color: rgba(var(--wpt-lms-white));
      // }
      &-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex: 1;
        h1 {
          font-size: clamp(1.1rem, 1.1rem + ((1vw - 0.2rem) * 0.767), 1.5rem);
          font-weight: 500;
          a {
            color: rgb(var(--wpt-lms-white));
          }
        }
        .#{$prefix}-progress {
          display: flex;
          justify-content: center;
          gap: 0.1255rem;
          flex-wrap: wrap;
          flex-direction: column;
          .number {
            color: rgb(var(--wpt-lms-white));
            font-size: 0.8rem;
          }
          .#{$prefix}-progress-bar {
            // margin-top: 0.313rem;
            overflow: hidden;
            position: relative;
            width: 5rem;
            height: 0.375rem;
            border-radius: 0.188rem;
            &::before {
              display: block;
              position: absolute;
              z-index: 0;
              top: 0;
              width: 100%;
              height: 100%;
              background: rgb(var(--wpt-lms-white));
              content: "";
              border-radius: 0.188rem;
            }
            .#{$prefix}-progress-active {
              width: 100%;
              height: 100%;
              border-radius: 0.188rem;
              background: #059601;
              position: absolute;
              z-index: 1;
            }
          }
        }
      }
      .#{$prefix}-popup-back {
        width: 2rem;
        height: 2rem;
        border-radius: 0.5rem;
        background-color: rgba(var(--wpt-lms-white), 0.25);
        color: rgba(var(--wpt-lms-white));
        display: flex;
        flex-wrap: wrap;
        place-content: center;
        i::before {
          font-size: 1.225rem;
        }
      }
    }
    .#{$prefix}-popup-content {
      overflow-y: auto;
      // margin: 4.375rem 0 3.125rem 0;
      // margin-bottom: 3.125rem;
      flex: 1;
      padding: 1rem;
      transition: all 0.2s ease-in-out;
      // position: relative;
      .#{$prefix}-popup-top {
        .content-item-summary {
          display: flex;
          flex-direction: column;
          gap: 1.25rem;
          align-items: flex-start;
          width: 100%;
          h2 {
            color: rgba(var(--wpt-lms-black));
            font-size: clamp(1.125rem, 1.1rem + 0.125vw, 1.25rem);
            font-weight: 500;
          }
          .#{$prefix}-quiz-content {
            figure {
              figcaption {
                display: none;
              }
            }
            display: flex;
            flex-direction: column;
            gap: 0.625rem;
            ul {
              padding: 0 18px;
              li {
                list-style: disc;
                &::marker {
                  color: rgba(var(--wpt-lms-primary-700));
                }
              }
            }
            ol {
              padding: 0 18px;
              margin: 0;
              li {
                &::marker {
                  color: rgba(var(--wpt-lms-primary-700));
                }
              }
            }
            // img {
            //   width: 100%;
            // }
          }
          .#{$prefix}-summary-wrap {
            width: 100%;
            &-content {
              display: flex;
              flex-direction: column;
              gap: 1.25rem;
              .#{$prefix}-quiz-intro {
                display: flex;
                flex-wrap: wrap;
                gap: 0.625rem;
                align-items: center;
                li {
                  display: flex;
                  align-items: center;
                  gap: 0.625rem;
                  &::before {
                    padding: .325rem;
                    background-color: rgb(var(--wpt-lms-primary-100));
                    border-radius: .25rem;
                    display: flex;
                    width: 32px;
                    height: 32px;
                    flex-wrap: wrap;
                    place-content: center;
                  }
                  .#{$prefix}-item-title {
                    font-weight: 500;
                  }
                }
                .#{$prefix}-duration {
                  order: 3;
                  &::before {
                    content: "\F20F";
                    font-family: "remixicon";
                    color: rgba(var(--wpt-lms-primary-700));
                  }
                }
                .#{$prefix}-passing-grade {
                  order: 2;
                  &::before {
                    content: "\EA9E";
                    font-family: "remixicon";
                    color: rgba(var(--wpt-lms-primary-700));
                  }
                }
                .#{$prefix}-questions-count {
                  order: 1;
                  &::before {
                    content: "\F452";
                    font-family: "remixicon";
                    color: rgba(var(--wpt-lms-primary-700));
                  }
                }
              }
              .#{$prefix}-quiz-status {
                display: flex;
                justify-content: flex-end;
                flex-wrap: wrap;
                align-items: center;
                .#{$prefix}-questions-index,
                .#{$prefix}-current-point {
                  color: rgb(var(--wpt-lms-black));
                  font-weight: 500;
                  span {
                    color: rgb(var(--wpt-lms-black));
                    font-weight: 400;
                  }
                }
                .#{$prefix}-current-point {
                  display: none;
                }
                .#{$prefix}-quize-time {
                  display: flex;
                  gap: 0.625rem;
                  align-items: center;
                  .#{$prefix}-submit-quiz {
                    order: 2;
                  }
                  .#{$prefix}-countdown {
                    order: 1;
                    display: flex;
                    gap: 0.625rem;
                    align-items: center;
                    span {
                      color: rgb(var(--wpt-lms-black));
                      position: relative;
                      margin-left: 1.875rem;
                      &::before {
                        position: absolute;
                        content: "\F215";
                        font-family: "remixicon";
                        font-size: 1.25rem;
                        color: rgb(var(--wpt-lms-primary-700));
                        left: -1.438rem;
                        bottom: -0.25rem;
                      }
                    }
                  }
                }
              }
              .#{$prefix}-quiz-questions {
                display: flex;
                flex-direction: column;
                gap: 1.563rem;
                .question {
                  display: flex;
                  flex-direction: column;
                  gap: 1.5rem;
                  .#{$prefix}-question-head {
                    display: flex;
                    gap: 0.625rem;
                    align-items: center;
                    flex-flow: wrap;
                    .#{$prefix}-question-title {
                      display: flex;
                      align-items: flex-start;
                      font-size: clamp(1.125rem, 1.1rem + 0.125vw, 1.25rem);
                      gap: 0.625rem;
                    }
                    .#{$prefix}-question-hint-edit {
                      gap: 0.313rem;
                      display: flex;
                      align-items: center;
                      .btn-show-hint {
                        height: 1.563rem;
                        padding: 0.25rem 0.5rem;
                        border-radius: 0.2rem;
                        font-size: 0.75rem;
                      }
                      .#{$prefix}-edit-link {
                        height: 1.563rem;
                        display: flex;
                        .button {
                          height: 1.563rem;
                        }
                      }
                    }
                  }
                  .question-content {
                    margin: 0;
                    display: none;
                  }
                  .#{$prefix}-fib-content {
                    &-inner {
                      display: flex;
                      flex-direction: row;
                      flex-wrap: wrap;
                      align-items: center;
                      gap: 0.313rem;
                    }
                    .#{$prefix}-fib-answered {
                      &.fail {
                        border: 0.125rem solid #d85554;
                        padding: 0 0.313rem;
                        background-color: rgba(var(--wpt-lms-primary-50), 0.7);
                      }
                      &.correct {
                        border: 0.125rem solid #00adff;
                        padding: 0 0.313rem;
                        background-color: rgba(var(--wpt-lms-primary-50), 0.7);
                      }
                    }
                  }
                  .#{$prefix}-question-answers {
                    .#{$prefix}-answer-options {
                      display: flex;
                      flex-direction: column;
                      gap: 0.5rem;
                      .#{$prefix}-answer-option {
                        display: flex;
                        align-items: center;
                        gap: 0.5rem;
                        padding: 0.625rem;
                        background: rgb(var(--wpt-lms-primary-50));
                        border-radius: 0.5rem;
                        label {
                          width: 100%;
                          color: rgb(var(--wpt-lms-black));
                        }
                      }
                    }
                    .#{$prefix}-question-response {
                      display: flex;
                      align-items: center;
                      justify-content: flex-start;
                      gap: 0.625rem;
                      margin-top: 1.25rem;
                      .label {
                        display: flex;
                        align-items: center;
                        padding: 0.313rem 0.625rem;
                        border-radius: 0.25rem;
                        color: rgba(var(--wpt-lms-white));
                        gap: 0.625rem;
                      }
                      &.correct .label {
                        background: #4caf50;
                      }
                      &.incorrect .label {
                        background: #ff6423;
                      }
                    }
                  }
                  .#{$prefix}-hint,
                  .#{$prefix}-explanation {
                    padding: 0.25rem 0.5rem;
                    background: rgba(var(--wpt-lms-primary-700), 5%);
                  }
                  .#{$prefix}-question-response {
                    display: flex;
                    align-items: center;
                    justify-content: flex-start;
                    gap: 0.625rem;
                    margin-top: 1.25rem;
                    .label {
                      display: flex;
                      align-items: center;
                      padding: 0.313rem 0.625rem;
                      border-radius: 0.25rem;
                      color: rgba(var(--wpt-lms-white));
                      gap: 0.625rem;
                      background-color: #4caf50;
                    }
                    .#{$prefix}-fib-note {
                      display: flex;
                      align-items: center;
                      gap: 0.625rem;
                      span {
                        width: 1.25rem;
                        height: 1.25rem;
                        display: inline-block;
                      }
                    }
                  }
                }
              }
              .button-left {
                margin-left: 0 !important;
                width: max-content !important;
                .#{$prefix}-pagination {
                  margin: 0;
                }
              }
              .#{$prefix}-quiz-questions {
                .instant-check {
                  justify-content: center;
                  margin: 0 auto;
                }
              }
            }
          }
        }
      }
      .#{$prefix}-comments {
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
        margin-top: 1.25rem;
        width: 100%;
        .navigation {
          display: none;
        }
        h3 {
          font-weight: 500;
          color: rgb(var(--wpt-lms-black));
        }
        .commentlist {
          display: flex;
          flex-direction: column;
          gap: 1.25rem;
          padding: 0;
          li {
            display: flex;
            flex-direction: column;
            gap: 0.625rem;
            .#{$prefix}-comment-meta {
              display: flex;
              gap: 0.938rem;
              .#{$prefix}-comment-content {
                display: flex;
                flex-direction: column;
                gap: 0.313rem;
                .#{$prefix}-author {
                  font-size: 1.25rem;
                  font-weight: 500;
                  color: rgba(var(--wpt-lms-black));
                  text-transform: capitalize;
                }
                .#{$prefix}-comment-time {
                  display: flex;
                  gap: 0.625rem;
                  time {
                    color: rgba(var(--wpt-lms-black));
                  }
                  .comment-edit-link {
                    text-decoration: underline;
                  }
                }
                p {
                  word-break: break-word;
                }
                .#{$prefix}-reply {
                  color: rgb(var(--wpt-lms-primary-800));
                  font-weight: 700;
                }
              }
            }
          }
        }
        .comment-respond {
          display: flex;
          flex-direction: column;
          gap: 0.625rem;
          .#{$prefix}-form {
            border: 0;
            box-shadow: none;
            padding: 0;
            width: 50%;
            margin: 0;
            display: flex;
            flex-direction: column;
            gap: 0.625rem;
            .logged-in-as {
              // display: flex;
              // gap: 0.313rem;
              a {
                font-weight: 500;
              }
            }
            .#{$prefix}-comment-form {
              display: flex;
              flex-direction: column;
              gap: 0.313rem;
              textarea {
                width: 100%;
              }
            }
            .#{$prefix}-comment-form-cookies {
              display: flex;
              gap: 0.313rem;
              align-items: center;
            }
            input[type="email"],
            input[type="text"],
            input[type="url"] {
              width: 100%;
            }
          }
        }
      }
    }
    .#{$prefix}-spotlight {
      margin-top: 0;
    }
    .#{$prefix}-popup-footer {
      margin: 0 auto;
      width: 100%;
      // margin: 3.125rem auto 0 auto;
      border-top: 0.063rem solid rgb(var(--wpt-lms-primary-100));
      box-shadow: 0 0.063rem 0 rgba(var(--wpt-lms-primary-950), 0.06);
      transition: all 0.2s ease-in-out;
      padding: 1rem;
      .#{$prefix}-nav {
        justify-content: space-between;
        display: flex;
        & .next, .prev {
          display: flex;
          flex-direction: row-reverse;
          a {
            display: flex;
            color: rgba(var(--wpt-lms-primary-800));
            font-size: 1rem;
            line-height: 1;
            font-weight: 500;
            flex-direction: row-reverse;
            padding: 0.5rem 0.75rem;
            border-radius: 0.25rem;
            background-color: rgb(var(--wpt-lms-primary-100));
            transition: all 0.15s ease-in-out;
            &:hover {
              background-color: rgb(var(--wpt-lms-primary-700));
              color: rgb(var(--wpt-lms-white));
              .#{$prefix}-course-nav-name {
                display: block;
              }
            }
          }
          // & .prev {
          //   display: flex;
          //   a {
          //     display: flex;
          //     color: rgba(var(--wpt-lms-primary-800));
          //     font-size: 1rem;
          //     line-height: 1;
          //     font-weight: 500;
          //     align-items: center;
          //     padding: 0.5rem 0.75rem;
          //     border-radius: 0.25rem;
          //     background-color: rgb(var(--wpt-lms-primary-50));
          //   }
          // }
          .#{$prefix}-course-nav-name {
            right: auto;
            left: -30px;
            &::before {
              right: auto;
              left: 5px;
            }
          }
          &:hover .#{$prefix}-course-nav-name {
            display: block;
          }
        }
      }
      .#{$prefix}-nav[data-nav="next"] {
        justify-content: flex-end;
      }
      .#{$prefix}-course-nav-name {
        display: none;
        position: absolute;
        top: -20px;
        right: -30px;
        width: auto;
        padding: 10px 15px;
        color: rgba(var(--wpt-lms-white));
        background: rgba(var(--wpt-lms-primary-800));
        line-height: 1;
        font-weight: 600;
      }
    }
  }
}
:where(.wp-site-blocks *:focus) {
  outline-width: 0;
}
// Responsive
@media screen and (max-width: 1280px) {
  #popup-sidebar {
    flex-basis: 300px;
  }
  #popup-header,
  #popup-footer {
    left: 300px;
  }
}
@media (max-width: 992px) {
  .#{$prefix}-comments {
    .#{$prefix}-comment-respond {
      .#{$prefix}-form {
        width: 100% !important;
      }
    }
  }
  .#{$prefix}-quiz-questions {
    .instant-check {
      flex-direction: column;
      padding: 0 0.75rem 0.75rem 0.75rem;
      height: max-content;
      width: unset;
    }
  }
  #popup-sidebar {
    flex-basis: 0;
  }
  #popup-header {
    left: 0;
  }
  body.#{$prefix}-sidebar-toggle__open {
    #popup-sidebar {
      flex-basis: 300px;
    }
    #popup-header {
      left: 300px;
    }
  }
}
@media screen and (max-width: 782px) {
  #popup-sidebar {
    flex-basis: 300px;
  }
  #popup-header,
  #popup-footer {
    left: 300px;
  }
  .#{$prefix}-popup-course {
    .#{$prefix}-popup-content {
      .#{$prefix}-comments {
        .comment-respond {
          .#{$prefix}-form {
            width: 100% !important;
          }
        }
      }
    }
  }
}
@media (max-width: 1024px) {
  #popup-footer {
    width: auto;
    padding: 0 15px;
    .#{$prefix}-course-nav-name {
      top: -25px;
      right: 15px;
      left: auto;
    }
    .prev .#{$prefix}-course-nav-name {
      left: 15px;
    }
  }
}