{% if course.enrolled? %}
  <script>
    if (document.referrer.includes("/app/learning_paths")) {
      window.location.replace("{% route course_viewer, course_id: course.id, learning_path_id: params.learning_path_id %}")
    }
  </script>
{% else %}
  <script>
    if (document.referrer.includes("/app/learning_paths")) {
    window.location.replace("{% route course_enrollment, code: course.enrollment_code %}")
     }

  </script>
{% endif %}

{% include "header" %}
<main class="np-main np-max-width np-page-container">
  <div class="np-hidden-mobile" id="course-desktop">
    {% include "course_desktop_view" %}
  </div>
  <div class="np-hidden-desktop" id="course-mobile">
    {% include "course_mobile_view" %}
  </div>
</main>
{% include "section_datasnipper_expert" %}
{% include "footer" %}

<style>
  .np-page-container #course-desktop > .np-card-container {
    border-radius: 12px;
  }

  .np-grid-spacing {
    padding-left: 0;
    padding-right: 5%;
  }

  .course-main-info,
  .np-top-cta {
    background: transparent;
    padding: 0;
    margin-bottom: 32px;
    display: block;
  }

  .course-main-info .np-top-title {
    color: #011638;
    font-size: 36px;
    font-weight: 600;
    line-height: 40px;
    letter-spacing: -0.48px;
    margin-bottom: 12px;
  }

  .course-main-info .progress-wrapper {
    align-items: center;
  }

  .course-main-info .np-progress-bar-container {
    max-width: 400px;
    margin: 24px 0;
    border-radius: 8px;
    background: #E6E8EB;
    height: 12px;
  }

  .course-main-info .np-card-progress-bar {
    border-radius: 8px;
    height: 12px;
  }

  .course-main-info .np-top-cta-progress-text {
    font-size: 16px;
    font-weight: 600;
    margin-left: 12px;
    margin-top: 0;
    color: #5964B7;
  }

  /* OUTLINE STYLES  */
  .np-course-outline {
    margin-top: 16px;
  }

  .np-course-outline-title,
  .np-card-heading {
    opacity: 1;
    font-size: 22px;
    text-transform: none;
    margin-bottom: 24px;
    color: #011638;
    font-weight: 600;
  }

  .np-course-outline-content-section-list {
    margin-bottom: 20px;
  }

  .np-course-outline-content-section-name {
    font-weight: 600;
    border-bottom: none;
    padding-bottom: 0;
  }

  .np-course-outline-content-activity-list {
    border: none;
    padding: 14px 0;
  }

  .np-course-outline-content-activity-list-bar {
    top: 33px;
  }

  .np-content-categories-content-item {
    background-color: #E7E9F5;
    color: #011638;
    margin-bottom: 12px;
  }

  .np-course-outline-content-activity-link {
    color: #011638;
  }

  .np-course-outline-content-activity-link:hover {
    color: #0d21a1;
  }

  .np-flex {
    flex-wrap: wrap;
  }

</style>