@import '../../_style/animation/variables.scss';

.md-list-item {
  height: auto;
  position: relative;
  z-index: 2;

  &.md-inset {
    .md-list-item-content {
      padding-left: 72px;
    }
  }

  .md-icon {
    font-size: 24px;
    margin: 0;
    transition-property: color, margin-right;
    color: var(--md-on-surface-medium);

    &.md-primary {
      color: var(--md-primary);
    }

    &.md-accent {
      color: var(--md-secondary);
    }
  }
}

.md-list-item-container {
  width: 100%;
  font-size: 16px;
  font-weight: 400;
  text-align: left;
  text-transform: none;

  &:not(.md-list-item-default, [disabled]) {
    > .md-list-item-content {
      user-select: none;
      cursor: pointer;
    }
  }

  &.md-button-clean {
    padding: 0;
    background-color: transparent;

    &:hover {
      opacity: 1;
      text-decoration: none;
    }
  }
}

button.md-list-item-button {
  border: 0;
  color: var(--md-on-surface);
}

a.md-list-item-link {
  position: relative;
  display: block;
}

a.md-list-item-container {
  position: relative;
  display: block;
  color: var(--md-on-surface);
}

.md-list-item-content {
  min-height: 48px;
  padding: 4px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: padding 0.4s $md-transition-stand-timing;
  will-change: padding;

  .md-list.md-dense & {
    min-height: 40px;
    font-size: 13px;

    > .md-avatar {
      margin-top: 0;
      margin-bottom: 0;

      &:not(.md-small) {
        width: 36px;
        min-width: 36px;
        height: 36px;
      }

      &:first-child {
        margin-right: 20px;
      }
    }
  }

  .md-list.md-double-line & {
    min-height: 72px;
  }

  .md-list.md-double-line.md-dense & {
    min-height: 60px;
  }

  .md-list.md-triple-line & {
    min-height: 88px;
  }

  .md-list.md-triple-line.md-dense & {
    min-height: 76px;
  }

  .md-list-action {
    margin: 0 -10px 0 0;

    &:last-of-type {
      margin: 0 -10px 0 16px;

      .md-list.md-triple-line & {
        align-self: flex-start;
      }
    }
  }

  > .md-icon:first-child {
    margin-right: 32px;
  }

  > .md-icon:last-child {
    margin-left: 16px;
  }

  > .md-checkbox,
  > .md-radio {
    margin: 0;

    &:first-child {
      margin-right: 36px;
    }
  }

  > .md-switch {
    margin: 0;

    &:first-child {
      margin-right: 22px;
    }
  }

  > .md-avatar {
    margin: 4px 0;

    &:first-child {
      margin-right: 16px;
    }
  }
}

.md-list-item-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  line-height: 1.25em;
  white-space: nowrap;

  .md-list.md-dense & {
    font-size: 13px;
  }

  * {
    width: 100%;
    margin: 0;
    overflow: hidden;
    line-height: 1.25em;
    text-overflow: ellipsis;
  }

  :nth-child(2),
  :nth-child(3) {
    font-size: 14px;
  }

  .md-list.md-dense & * {
    font-size: 13px;
  }
}
