<div class="dashboard-categories">
  <div class="dashboard-categories-header">
    <div class="dashboard-categories-title">
      Top Categories
    </div>
    <div class="dashboard-categories-subtitle">
      Lorem ipsum dolor sit amet, consectur.
    </div>
  </div>
  <div class="categories-carousel">
    {% for category in categories.enrolled %}
      <div class="category-card-wrapper">
        <a class="category-card" href="">
          <div class="category-card-name">
            {{ category.name }}
          </div>
        </a>
    </div>
    {% endfor %}
  </div>
  <div class="categories-carousel-control"></div>
</div>

<style>
  .dashboard-categories {
    padding: 60px 16px;
    max-width: 1320px;
    margin: auto;
  }
  .dashboard-categories-header {
    margin: 0 auto 32px;
    text-align: center;
  }
  .dashboard-categories-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: #563150;
    margin-bottom: 6px;
  }
  .dashboard-categories-subtitle {
    
  }

  .categories-carousel.tns-slider {
    display:flex;
  }
  .category-card-wrapper {
    padding: 0 10px;
  }
  .category-card {
    background: #EEF2F6;
    height: 100%;
    width: 100%;
    display: block;
    padding: 26px 24px;
    border-radius: 8px;
    text-align:center;
    transition: all 0.1s;
    /*min-height: 104px; */
  }
  .category-card:hover {
    background: #563150;
  }
  .category-card:hover .category-card-name {
    color: #fff;
  }
  .category-card-name {
    text-align: center;
    font-size: 17px;
    font-weight: 500;
    line-height: 26px;
    color: #563150;
  }

  .dashboard-categories .tns-nav {
    text-align: center;
    max-width: 230px;
    margin: 20px auto 0;
  }

  .dashboard-categories .tns-nav button {
    border-radius: 50%;
    height: 10px;
    width: 10px;
    padding: 0;
    border: 0;
    margin: 0 8px;
  }

  .dashboard-categories .tns-controls {
    text-align: center;
    display: flex;
    justify-content: space-between;
    max-width: 275px;
    margin: auto;
    margin-top:-30px;
  }

  .dashboard-categories .tns-controls button {
    border: none;
    background: none;
    font-size: 25px;
  }

  .dashboard-categories .tns-controls button.tns-nav-active {
    background: #563150;
  }

</style>

<script>
  window.addEventListener('DOMContentLoaded', function() {
    var filtersSlider = tns({
      container: '.categories-carousel',
      controls: true,
      controlsText: ['<i class="fal fa-long-arrow-left"></i>','<i class="fal fa-long-arrow-right"></i>'],
      mouseDrag: true,
      swipeAngle: false,
      items: 6,
      controlsPosition:'bottom',
      navPosition: 'bottom,',
      slideBy: 1,
      responsive: {
      640: {
        items: 2
      },
      768: {
        items: 3
      },
      992: {
        items: 4
      },
      1200: {
        items: 6
      }
      }
    });
  })
</script>