/**
 * ScrollList Component Style for SaltUI
 * @author zhouquan.yezq
 * 
 * Copyright 2018-2019, SaltUI Team.
 * All rights reserved.
 */
$scrollListPrefixCls = t-scroll-list;

.scroll-list-no-border {
  .{$scrollListPrefixCls}-item {
    border-bottom: 0px solid transparent;    
  }
}

.scroll-list-full-border {
  .{$scrollListPrefixCls}-item {
    border-bottom: 1px solid $normal-alpha-7;    
  }
}

.scroll-list-cut-border {
  .{$scrollListPrefixCls}-item {
    &:after {
      position: absolute;
      content: '';
      height: 1px;
      width: calc(100% - 16px);
      bottom: 0;
      right: 0;
      background: $normal-alpha-7;
    }
  }
}

.{$scrollListPrefixCls} {
  overflow: hidden;
  margin: 0;
  width: 100%;
  height: 100%;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  overflow-scrolling: touch;

  .empty-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    height: 100%;
    .icon {
      width: 160px;
      height: 160px;  
      margin-bottom: 20px;
    }
    .text {
      color: $normal-alpha-2;
    }
  }

  .bottom-tip {
    width: 100%;
    color: #999;
    font-size: 12px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;

    .icon {
      width: 30px;
      height: 27px;
      background: url('https://img.alicdn.com/tps/TB1fPYRMXXXXXcdXFXXXXXXXXXX-480-238.svg') center no-repeat; // img.alicdn.com/tps/TB1fPYRMXXXXXcdXFXXXXXXXXXX-480-238.svg) center no-repeat;
      background-size: contain;
      display: inline-block;
      margin-right: 4px;
      vertical-align: middle;

      svg {
        margin-top: -4px;
      }
    }

    .text {
      display: inline-block;
      line-height: 27px;
      height: 27px;
      vertical-align: top;
      padding-left: 0;
    }
  }
}

.{$scrollListPrefixCls}-item {
  padding: 16px;
  background: white;
  display: flex;
  line-height: 1.5;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  &:active {
    background: $normal-alpha-7;
  }
  &.no-border {
    border-bottom: 0px solid transparent;
    &:after { 
      display: none;  
    }
  }
  &.full-border {
    border-bottom: 1px solid $normal-alpha-7;
    &:after { 
      display: none;  
    }
  }
  &.cut-border {
    border-bottom: 0px solid transparent;
    &:after {
      position: absolute;
      content: '';
      height: 1px;
      width: calc(100% - 16px);
      bottom: 0;
      right: 0;
      background: $normal-alpha-7;
    }
  }
  &:last-child  {
    border-bottom: 0px solid transparent;
    &:after { 
      display: none;  
    }
  }
}

.{$scrollListPrefixCls}-item-img {
  width: 40px;
  height: 40px;
  border-radius: $global-border-radius;
  align-self: baseline;
  margin-right: 16px;
}

.{$scrollListPrefixCls}-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  align-self: baseline;
  margin-right: 16px;
}

.{$scrollListPrefixCls}-item .t-avatar {
    margin-right: 16px;
    align-self: baseline;
}

.{$scrollListPrefixCls}-item-badge {
  margin-bottom: 3px;
  .badge-inner {
    background: $function-red;
    margin: 1px 0 0 8px;
  }
}

.{$scrollListPrefixCls}-item-content {
  flex: 1;
  // very important, make ellipsis in flexbox work
  // https://css-tricks.com/flexbox-truncated-text/
  min-width: 0;
}

.{$scrollListPrefixCls}-item-extra {
  margin-left: 10px;
  svg {
    fill: $normal-alpha-4;
    width: 20px;
    height: 20px;
  }
}
.{$scrollListPrefixCls}-item-extra-inner {
  display: flex;
  align-items: center;
}

.{$scrollListPrefixCls}-item-title {
  font-size: 16px;
  color: $dark-alpha-2;
  &.titleRight {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
  }
}

.{$scrollListPrefixCls}-item-des-inner {
  font-size: 12px;
  color: $dark-alpha-3;
  padding-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  text-align: justify;
}

.hairline {
  .{$scrollListPrefixCls}-item {
    &:after {
      border-width: 0.5px;
    }
  }
}


.{$scrollListPrefixCls}-taglist {
  padding: 12px 4px 0 16px;
  .{$scrollListPrefixCls}-taglist-item {
    display: inline-block;
    padding: 0 8px;
    font-size: 12px;
    margin: 0 12px 12px 0;
    height: 18px;
    line-height: 18px;
    color: $dark-alpha-3;
    border: 1px solid $dark-alpha-5;
    border-radius: 16px;
  }
}
