<nav class="navbar navbar-dark navbar-theme-primary px-4 col-12 d-lg-none">
    <a class="navbar-brand me-lg-5" href="/">
        <img class="navbar-brand-dark" src="/static/assets/img/brand/light.svg" alt="Volt logo" /> <img class="navbar-brand-light" src="/static/assets/img/brand/dark.svg" alt="Volt logo" />
    </a>
    <div class="d-flex align-items-center">
        <button class="navbar-toggler d-lg-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>
    </div>
</nav>

<nav id="sidebarMenu" class="sidebar d-lg-block bg-gray-800 text-white collapse" data-simplebar>
  <div class="sidebar-inner px-4 pt-3">
    <div class="user-card d-flex d-md-none align-items-center justify-content-between justify-content-md-center pb-4">
      <div class="d-flex align-items-center">
        <div class="avatar-lg me-4">
          <img src="{{ user.userinfo.profile_pic_url }}" class="card-img-top rounded-circle border-white"
            alt="Bonnie Green">
        </div>
        <div class="d-block">
          <h2 class="h5 mb-3">{{ user.userinfo }}</h2>
          <a href="/logout" class="btn btn-secondary btn-sm d-inline-flex align-items-center">
            <svg class="icon icon-xxs me-1" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"></path></svg>
            Sign Out
          </a>
        </div>
      </div>
      <div class="collapse-close d-md-none">
        <a href="#sidebarMenu" data-bs-toggle="collapse"
            data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="true"
            aria-label="Toggle navigation">
            <svg class="icon icon-xs" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
          </a>
      </div>
    </div>
    <ul class="nav flex-column pt-3 pt-md-0">
      <li class="nav-item">
        <a href="/" class="nav-link d-flex align-items-center">
          <span class="sidebar-icon">
            <img src="/static/assets/img/brand/light.svg" height="20" width="20" alt="Volt Logo">
          </span>
          <span class="mt-1 ms-1 sidebar-text">Sprint</span>
        </a>
      </li>
      {% if user.userinfo.groups %}
          <li class="nav-item">
            <span
              class="nav-link  collapsed  d-flex justify-content-between align-items-center"
              data-bs-toggle="collapse" data-bs-target="#submenu-groups">
              <span>
                <span class="sidebar-icon">
                  <img src="/static/assets/img/icons/users.svg" height="20" width="20" alt="Volt Logo">
                </span>
                <span class="sidebar-text">Группы</span>
              </span>
              <span class="link-arrow">
                <svg class="icon icon-sm" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path></svg>
              </span>
            </span>
            <div class="multi-level collapse"
              role="list" id="submenu-groups" aria-expanded="false">
              <ul class="flex-column nav">
                {% for group in user.userinfo.groups %}
                <li class="nav-item">
                  <a class="nav-link" href="/group?group_id={{ group.id }}">
                    <span class="sidebar-text">{{ group.name }}</span>
                  </a>
                </li>
                {% endfor %}
              </ul>
            </div>
          </li>
      {% endif %}
      <li class="nav-item">
        <span
          class="nav-link  collapsed  d-flex justify-content-between align-items-center"
          data-bs-toggle="collapse" data-bs-target="#submenu-app">
          <span>
            <span class="sidebar-icon">
              <img src="/static/assets/img/icons/tasks.svg" height="20" width="20" alt="Volt Logo">
            </span>
            <span class="sidebar-text">Задачи</span>
          </span>
          <span class="link-arrow">
            <svg class="icon icon-sm" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"></path></svg>
          </span>
        </span>
        <div class="multi-level collapse"
          role="list" id="submenu-app" aria-expanded="false">
          <ul class="flex-column nav">
            <li class="nav-item">
              <a class="nav-link" href="/tasks">
                <span class="sidebar-text">Все</span>
              </a>
            </li>
            {% if user.userinfo.teacher %}
            <li class="nav-item">
              <a class="nav-link" href="/tasks?filter=my">
                <span class="sidebar-text">Мои</span>
              </a>
            </li>
            {% endif %}
            <li class="nav-item">
              <a class="nav-link" href="/tasks?filter=new">
                <span class="sidebar-text">Новые</span>
              </a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="/tasks?filter=unsolved">
                <span class="sidebar-text">Незавершенные</span>
              </a>
            </li>
          </ul>
        </div>
      </li>
      <li class="nav-item">
        <a href="/sets" class="nav-link">
          <span class="sidebar-icon">
            <img src="/static/assets/img/icons/cubes.svg" height="20" width="20" alt="Volt Logo">
          </span>
          <span class="sidebar-text">Сеты</span>
        </a>
      </li>
      <li class="nav-item">
        <a href="/rating" class="nav-link">
          <span class="sidebar-icon">
            <img src="/static/assets/img/icons/star.svg" height="20" width="20" alt="Volt Logo">
          </span>
          <span class="sidebar-text">Рейтинг</span>
        </a>
      </li>
      <li role="separator" class="dropdown-divider mt-4 mb-3 border-gray-700"></li>
      <li class="nav-item">
        <button class="btn btn-secondary d-flex align-items-center justify-content-center btn-upgrade-pro" data-bs-toggle="modal" data-bs-target="#modal-support">
          Поддержка
        </button>

      </li>
    </ul>
  </div>
</nav>
<div class="modal fade" id="modal-support" tabindex="-1" aria-labelledby="modal-default" style="display: none;" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h2 class="h6 modal-title">Поддержка</h2>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                По вопросам работы системы или сотрудничества можно обратиться по почте:
                <b>sprint.connect@yandex.ru</b>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-link text-gray-600 ms-auto" data-bs-dismiss="modal">Закрыть</button>
            </div>
        </div>
    </div>
</div>