{% include "header" %}
{% include "course_version_outdated_alert", courses: courses.in_catalog %}
{% include "sub_navigation" %}
<main class="np-main np-catalog np-subpage-container np-max-width">
  <div class="np-catalog-header-wrapper">
    <header class="filtters-wrapper">
      <div class="header-container">
        <div class="heading">
          Swift Skin and Wound Training Resources 
        </div>
        <div class="sub-heading">
          Explore key courses and content to learn the basic features within Swift Skin and Wound. Have a problem or a question? Explore the Swift Resources for a quick answer. 
        </div>
        <div class="cta-filters default-swapper">
          <div class="cta-courses" onclick="filterCarousel('onboarding')">
              <div class="cta-courses-text">Onboarding Courses</div>
          </div>
          <div class="cta-resources" onclick="filterCarousel('resources')">
            <div class="cta-resources-text">Swift Resources</div>
          </div>
        </div>

        <div class="cta-filters mobile-swapper">
          <div class="cta-courses cta-courses-mobile" onclick="filterCarousel('onboarding')">
              <div class="cta-courses-text cta-courses-text-mobile">Onboarding Courses</div>
          </div>
          <div class="cta-resources cta-resources-mobile" onclick="filterCarousel('resources')">
            <div class="cta-resources-text cta-resources-text-mobile">Swift Resources</div>
          </div>
        </div>
      </div>
    </header>
    {% capture label %}{% t shared.filters.by_category %}{% endcapture %}
  </div>

  <div class="carousel-container col-xs-12">
    <div class="catalog-carousel-wrapper" id="carousel-courses-onboarding">
      {% assign is_onboarding = false %}
      {% if courses.in_catalog.any? %}
        <div class="catalog-carousel row">
          {% for course in courses.in_catalog %}
              {% assign categories_name = course.categories | map: 'name'| join: ' '%}
              {% if categories_name contains 'Onboarding' %}
                {% assign is_onboarding = true %}
                {% include "cards_course" with course %}
              {% endif %}
          {% endfor %}
        </div>

      {% endif %}
    </div>
  </div>
  
  <div class="carousel-container">
    <div class="catalog-carousel-wrapper np-hidden" id="carousel-courses-resources">
      {% assign is_resources = false %}
      {% if courses.in_catalog.any? %}
        <div class="catalog-carousel row">
          {% for course in courses.in_catalog %}
              {% assign categories_name = course.categories | map: 'name'| join: ' ' %}
              {% if categories_name contains 'Resources' %}
                {% assign is_resources = true %}
                {% include "cards_course" with course %}
              {% endif %}
          {% endfor %}
        </div>

      {% endif %}
    </div>
  </div>

  {% 
    include 'catalog_carousel',
    heading: "Open Access Courses",
    sub_heading: "Explore key features found in Swift Skin and Wound",
    category_name: "open access",
    class_name: "open-access"
  %}

  {% 
    include 'catalog_carousel',
    heading: "Swift Features - Mini Courses",
    sub_heading: "Explore key features found in Swift Skin and Wound",
    category_name: "swift features",
    class_name: "swift-features"
  %}

  {% 
    include 'catalog_carousel',
    heading: "Device Specific Courses",
    sub_heading: "Looking for content that only includes iOS or Android? Explore the courses below.",
    category_name: "device specific",
    class_name: "device-specific"
  %}

</main>

{% include "footer" %}

<style>
  .rounded {
    border-radius: 5px;
    margin-top: 4rem;
    margin-bottom: 4rem;
    height: 5px;
    border: none;
    background: #00000021;
  }

  .heading {
    font-size: 24px;
    line-height: 28px;
    font-weight: 700;
    color: #000;
    margin-bottom: 15px;
  }

  .sub-heading {
    font-weight: 400;
    font-size: 18px;
    line-height: 22px;
    color: #000;
    margin-bottom: 56px;
  }

  .cta-courses-text {
    color: #FFFFFF;
  }
  .cta-resources-text {
    color: #000000;
  }

  .cta-filters {
    margin-bottom: 60px;
  }

  .tns-item {
    flex-basis: auto;
  }

  @media screen and (min-width: 550px){
    .heading {
      font-size: 30px;
      line-height: 34px;
      margin-bottom: 20px;
    }

    .sub-heading {
      font-size: 22px;
      line-height: 24px;
    }
  }

  @media screen and (min-width: 565px){
    .default-swapper {
      display: flex;
    }

    .mobile-swapper {
      display: none;
    }

    .cta-courses {
      border-radius: 9px 0 0 9px;
    }

    .cta-filters {
      margin-bottom: 42px;
    }

    .cta-resources {
      border-radius: 0px 9px 9px 0px;
    }
  }

  @media screen and (min-width: 768px){
    .heading {
      font-size: 40px;
      line-height: 47px;
      margin-bottom: 30px;
    }

    .sub-heading {
      font-size: 24px;
      line-height: 28px;
    }
  }
</style>


<script>
  function filterCarousel(x) {
    document.querySelectorAll(".catalog-carousel-wrapper").forEach(y => {
      if (y.id.includes(x)) {
        y.classList.remove('np-hidden');
        backgroundColor();
      }  
        else {
          y.classList.add('np-hidden'); 
          removeBackgroundColor();
        }
        
    })

  }

  function backgroundColor() {
    document.querySelector('.cta-courses').style.backgroundColor = '#fff'
    document.querySelector('.cta-courses-mobile').style.backgroundColor = '#fff'  
    document.querySelector('.cta-courses-text').style.color = '#000'
    document.querySelector('.cta-courses-text-mobile').style.color = '#000'

    

    document.querySelector('.cta-resources').style.backgroundColor = '#2356B2' 
    document.querySelector('.cta-resources-mobile').style.backgroundColor = '#2356B2' 
    document.querySelector('.cta-resources-text').style.color = '#fff'
    document.querySelector('.cta-resources-text-mobile').style.color = '#fff'
  }
  function removeBackgroundColor() {
    document.querySelector('.cta-courses').style.backgroundColor = '#2356B2' 
     document.querySelector('.cta-courses-mobile').style.backgroundColor = '#2356B2' 
    document.querySelector('.cta-courses-text').style.color = '#fff'
    document.querySelector('.cta-courses-text-mobile').style.color = '#fff'

    document.querySelector('.cta-resources').style.backgroundColor = '#fff' 
    document.querySelector('.cta-resources-mobile').style.backgroundColor = '#fff'
    document.querySelector('.cta-resources-text').style.color = '#000'
    document.querySelector('.cta-resources-text-mobile').style.color = '#000'
  }


</script>