@use "sass:color";
@use "../colors" as c;

@mixin ilios-list-reset() {
  list-style-type: none;
  margin: 0;
  padding: 0;

  ul,
  ol {
    list-style-type: none;
    margin: 0 0 0 1em;
    padding: 0;
  }
}
@mixin ilios-static-list() {
  @include ilios-list-reset;
  background-color: c.$white;
  border: 1px solid c.$culturedGrey;
  border-radius: 3px;
  padding: 1em 2em;
  width: 80%;

  li {
    font-weight: bold;
  }

  ul {
    margin-left: 1em;

    li {
      font-weight: normal;
    }
  }
}

@mixin ilios-tag-list() {
  @include ilios-list-reset;

  display: flex;
  flex-wrap: wrap;

  li {
    background-color: c.$culturedGrey;
    border-radius: 4px;
    margin-right: 0.3em;
    margin-top: 10px;
    padding: 0.2em 0.4em 0.2em 0.6em;
    vertical-align: middle;
  }
}

@mixin ilios-browser-defaults {
  ul {
    list-style-position: inside;
    list-style-type: disc;
  }

  ol {
    list-style-position: inside;
    list-style-type: decimal;
  }

  ul ul,
  ol ul {
    list-style-position: inside;
    list-style-type: circle;
    margin-left: 15px;
  }

  ol ol,
  ul ol {
    list-style-position: inside;
    list-style-type: lower-latin;
    margin-left: 15px;
  }

  p {
    margin: 0;
  }
}

@mixin ilios-selectable-list {
  @include ilios-list-reset;

  ul {
    margin-left: 2em;
  }

  li {
    color: c.$blueMunsell;
    cursor: pointer;

    &.static {
      color: c.$raisinBlack;
      cursor: arrow;
    }

    &.disabled {
      color: color.adjust(c.$raisinBlack, $lightness: 40%);
      cursor: arrow;
    }
  }
}

@mixin ilios-removable-list {
  @include ilios-tag-list;

  li {
    cursor: pointer;
    display: flex;

    .remove,
    .info {
      margin-left: 0.5em;
    }
  }
}

@mixin ilios-tag-tree-list {
  @include ilios-list-reset;
  margin-bottom: 1rem;

  li {
    div {
      background-color: c.$white;
      border: 1px c.$culturedGrey solid;
      border-radius: 4px;
      margin-top: 5px;
      padding: 0.2em 0.4em 0.2em 0.6em;
      vertical-align: middle;

      &.selected {
        background-color: c.$culturedGrey;
      }
    }

    .actions {
      float: right;
    }

    &.top-level {
      margin-left: 0;
    }
  }
}

@mixin ilios-list-badges() {
  @include ilios-removable-list;

  li {
    background-color: c.$culturedGrey;
    border-radius: 4px;
    font-weight: bold;
    margin-top: 0.5rem;
    padding: 1rem;
  }
}

@mixin ilios-list-tree() {
  @include ilios-list-reset;

  li {
    color: c.$raisinBlack;
    margin-left: 20px;

    &.strong {
      font-weight: bold;

      li {
        font-weight: normal;
      }
    }

    &.em {
      font-style: italic;

      li {
        font-style: normal;
      }
    }

    &.disabled {
      color: c.$davysGrey;
    }
  }
}
