@use "../../variables/variables" as v;
@use "sass:math";

@mixin scrollbars(
  $size,
  $foreground-color,
  $background-color: mix(v.$foreground-color, white, 50%)
) {
  // For Google Chrome
  &::-webkit-scrollbar {
    width: math.div($size, 1.3);
    // Jure at one point changed previous line to:
    // width: math.floor($size / 1.3);
    // However this sintax is deprecated.
    // Reenable with good reason or better yet, find a better (non-deprecated) alternative.
    height: $size;
  }

  &::-webkit-scrollbar-thumb {
    background: $foreground-color;
    border-radius: 10px;
  }

  &::-webkit-scrollbar-track {
    background: $background-color;
    border-radius: 10px;
  }

  // For Internet Explorer
  & {
    scrollbar-face-color: $foreground-color;
    scrollbar-track-color: $background-color;
  }

  scrollbar-color: $background-color $foreground-color;
  scrollbar-width: thin;
}

#modal-filter-label {
  font-size: 1.5rem;
}

.maincolor-text {
  color: v.$navigation-maincolor !important;
}

.clear-filter-modal-section {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  align-items: center;
  text-decoration: none;

  img {
    width: 16px;
  }

  span {
    padding-left: 14px;
    font-size: 0.9rem;
  }
}

.search-modal-filter {
  display: flex;
  background-color: #ecf0f3;
  border-radius: 3px;
  padding: 8px;
  margin: 25px 0;

  * {
    display: flex;
    border: none;
    background: none;
  }

  input {
    flex: 100;
    flex-grow: fill;
    flex-shrink: 0;
  }

  span {
    flex: 1;
    justify-content: flex-end;
    img {
      width: 30px;
    }
  }
}

.modal-content {
  padding: 0 16px;
}

.nav-modal-section-content {
  @include scrollbars(10px, v.$navigation-maincolor, #e6e6e6);

  display: flex;
  flex-direction: column;
  padding-left: 0;
  // height: 364px;
  overflow-y: scroll;

  * {
    display: flex;
    flex-grow: 1;
  }

  li {
    width: 100%;
    line-height: 1.7rem;

    .nav-modal-content-desc {
      padding-left: 14px;
      flex: 100;
      color: #848c90;
    }

    .nav-modal-content-desc.checked {
      color: v.$navigation-maincolor;
    }

    :first-child {
      //padding-top: 0.4rem;
      justify-content: flex-end;
      align-items: center;
    }

    :last-child {
      justify-content: flex-end;
    }

    /* only the last child of a */
    > :last-child {
      margin-right: 32px;
      color: #848c90;
    }

    > div {
      max-width: 16px;
    }
  }

  input {
    display: inline-block;
    width: 15px;
    height: 15px;
  }

  &-desc {
    margin-left: 12px;
    flex-grow: 100;
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

@media (min-width: v.$layout-breakpoint-medium) {
  .search-modal-header-root {
    margin-top: 14px;
    flex-direction: row-reverse;
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;

    .clear-filter-modal-root {
      display: flex;
    }
  }

  /*
  .nav-modal-section-content {
    width: 700px;
  }
  

  .clear-filter-section {
  }


  */

  .search-modal-filter {
    max-width: 342px;

    margin: 0;

    * {
    }

    input {
    }

    img {
    }
  }
}

@media (min-width: v.$layout-breakpoint-large) {
  .search-modal-filter {
    width: 100%;
  }
}
