:root {
  --primary: #496cf6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #f6f6f6;
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
}

li {
  list-style: none;
}

.user {
  position: sticky;
  top: 0;
  z-index: 9;
  width: 100%;
  overflow: auto;
  border-radius: 0 0 8px 8px;
  background-color: #fff;
}

.user.shadow {
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
  background-color: rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.user__list {
  display: grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 16px;
  width: max-content;
  margin: 0 auto;
  overflow-x: auto;
  padding: 8px 16px;
}

.user__list::-webkit-scrollbar,
.user::-webkit-scrollbar {
  display: none;
}

.user__item {
  flex-shrink: 0;
  text-align: center;
}

.user__item.selected {
  color: var(--primary);
  font-weight: bold;
}

.user__avatar {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
}

.user__avatar img {
  width: 100%;
  height: 100%;
}

.user__name {
  font-size: 12px;
  margin-top: 4px;
}

.sort {
  position: sticky;
  top: 92px;
  z-index: 2;
  text-align: right;
}

.sort__wrapper {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 32px;
  margin-right: 16px;
  border-radius: 32px;
  line-height: 32px;
  text-align: center;
  background: #fff;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, .1);
}

.sort-list {
  position: absolute;
  top: 48px;
  right: 0;
  border-radius: 6px;
  background: #fff;
  padding: 8px 0;
  opacity: 0;
  transform: scale(0);
  transform-origin: 90% top;
  transition: transform 250ms ease-in-out, opacity 250ms ease-in-out;
  filter: drop-shadow(2px 2px 10px rgba(0, 0, 0, .1));
}

.sort-list.active {
  opacity: 1;
  transform: scale(1);
}

.sort-list::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 9px;
  border-width: 0 7px 10px 7px;
  border-style: solid;
  border-color: transparent transparent #fff transparent;
}

.sort-list__item {
  white-space: nowrap;
  padding: 0 16px;
}

.sort-list__item.active {
  color: var(--primary);
}

.sort-list__item.active svg {
  transform: scale(1);
}

.sort-list__item span {
  font-size: 14px;
}

.sort-list__item svg {
  margin-left: 8px;
  color: var(--primary);
  transform: scale(0);
  transition: transform .25s ease-in-out;
}

.video {
  display: grid;
  gap: 16px;
  margin-top: 32px;
  padding: 0 16px 16px;
}

.video__item {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: #fff;
}

.video__header {
  display: flex;
  align-items: center;
  padding: 8px 16px;
}

.video__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.video__user {
  margin-left: 8px;
}

.video__cover {
  position: relative;
  width: 100%;
}

.video__cover::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}

.video__cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video__duration {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: .25em .5em;
  border-radius: 4px 0 0 4px;
  font-size: 12px;
  color: #fff;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(10px);
}

.video__title {
  padding: 8px 16px;
  font-size: 20px;
  flex: 1;
}

.video__footer {
  display: flex;
  align-items: center;
  padding: 0 16px 8px;
}

.video__date {
  color: #8c8c8c;
  font-size: 14px;
  margin-right: auto;
}

.video__footer a {
  display: inline-block;
  padding: 5px;
  border-radius: 50%;
  font-size: 0;
  margin-left: 8px;
  -webkit-tap-highlight-color: #f0f0f0;
}

.video__footer a img {
  pointer-events: none;
}

@media screen and (min-width: 768px) {
  .video {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (min-width: 1000px) {
  .video {
    grid-template-columns: repeat(3, 1fr);
  }
}

.modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transform: translate3d(0, -100vh, 0);
  transition: .3s;
}

.modal.show {
  transform: translate3d(0, 0, 0);
}

.loading {
  width: 50px;
  height: 50px;
  margin: auto;
  position: relative;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
}

.loading:before {
  content: '';
  width: 50px;
  height: 5px;
  background: #fff;
  opacity: 0.7;
  position: absolute;
  top: 59px;
  left: 0;
  border-radius: 50%;
  animation: shadow .5s linear infinite;
}

.loading:after {
  content: '';
  width: 50px;
  height: 50px;
  background: var(--primary);
  animation: animate .5s linear infinite;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 3px;
}

@keyframes animate {
  17% {
    border-bottom-right-radius: 3px;
  }
  25% {
    transform: translateY(9px) rotate(22.5deg);
  }
  50% {
    transform: translateY(18px) scale(1, .9) rotate(45deg);
    border-bottom-right-radius: 40px;
  }
  75% {
    transform: translateY(9px) rotate(67.5deg);
  }
  100% {
    transform: translateY(0) rotate(90deg);
  }
}

@keyframes shadow {
  0%, 100% {
    transform: scale(1, 1);
  }
  50% {
    transform: scale(1.2, 1);
  }
}

.video-loading,
.empty {
  height: calc(100vh - 77px);
  display: none;
  justify-content: center;
  align-items: center;
}

.empty img {
  width: 50%;
}
