{% assign ring_background_color = 'rgba(192, 220, 246, 0.6)' %}
{% assign ring_fill_color = '#0274de' %}
{% assign number_color = 'rgb(0, 0, 0)' %}
{% assign text_color = '#0274de' %}
{% assign background_color = 'white' %}

<div class="progress-card-wrapper">
  <div class="progress-card">
    {% if courses.enrolled.any? %}
      {% assign countComplete = 0 %}
      {% assign countInProgress = 0 %}
      {% assign countNotStarted = 0 %}
      {% assign countTotal = 0 | times: 1.0 %}
      {% for course in courses.enrolled %}
        {% assign countTotal = countTotal | plus: 1 %}
        {% if course.progress == 100 %}
          {% assign countComplete = countComplete | plus: 1 %}
        {% endif %}
        {% if course.progress > 0 and course.progress < 100 %}
          {% assign countInProgress = countInProgress | plus: 1 %}
        {% endif %}
        {% if course.progress == 0 %}
          {% assign countNotStarted = countNotStarted | plus: 1 %}
        {% endif %}
      {% endfor %}
      <ul class="progress-circle-list">
        <li>
          {%
            include "progress_circle",
            name: 'Completed' ,
            count: countComplete ,
            total: countTotal,
            size: "120",
            stroke_color: ring_fill_color,
            stroke_color_bg: ring_background_color,
            text_color: text_color,
            number_color: number_color
          %}
        </li>
        <li>
          {%
            include "progress_circle",
            name:'In Progress' ,
            count: countInProgress ,
            total: countTotal,
            size: "120",
            stroke_color: ring_fill_color,
            stroke_color_bg: ring_background_color,
            text_color: text_color,
            number_color: number_color
          %}
        </li>
      </ul>
    {% else %}
      {% capture message %}
        {% t shared.zero_state.courses.index,
          key: current_school.course_vocabulary
        %}
      {% endcapture %}
      {% include "courses_zero_state", message: message %}
    {% endif %}
  </div>
</div>


<style>
  .progress-card {
    border-radius: 8px;
    background: {{ background_color }};
    padding: 0;
    display: flex;
    margin-bottom: 2.187rem;
    width: 100%;
    border: 2px solid rgba(0,0,0, 0.25);
    border-radius: 10px;
  }
  .progress-circle-list {
    padding: 0;
    list-style-type: none !important;
    justify-content: space-around;
    display: inline-flex;
    align-items: center;
    max-width: 400px;
    margin: auto;
  }
  .progress-ring-wrapper {
    flex: 0;
    flex-direction: column;
    display: flex;
    width: 100%;
    padding: 1.5rem 1rem 1rem 1rem;
    align-items: center;
  }
  .progress-ring circle {
    stroke-linecap: round;
    transition: stroke-dashoffset 0.35s;
    transform: rotate(-90deg);
    transform-origin: center;
  }
  .progress-ring text {
    font-size:2rem;
  }
  .progress-circle-label {
    color: {{ text_color }};
    text-transform: uppercase;
    font-size: 0.875rem;
    margin-top: 1rem;
  }
  
  @media (min-width:768px) {
    .progress-ring-wrapper {
      padding: 1.5rem 0.4rem 1rem 0.4rem;
    }
    .progress-circle-list {
      flex-direction: column;
    }
  }
  @media screen and (min-width: 1023px) {
    .progress-circle-list {
      flex-direction: row;
    }
  }
  @media (min-width:1170px) {
    .progress-ring text {
      font-size: 2.5rem;
    }
    .progress-ring-wrapper {
      padding: 1.5rem 1rem 1rem 1rem;
    }
  }
</style>
