@import "./../styles/index.scss";

.files-container{
  display: flex;
  flex-direction: column;
  margin-left: 20px;
}

.file-container{
  border-radius: 5px;
  height: 40px;
  margin: 5px 0;
  position: relative;
  width: 330px;

  &:hover{
    border-color: #bcdaff;
    background-color: #edf5ff;

    .file-delete{
      display: flex;
    }
  }

  &.file-uploading {
    opacity: 0.6;
  }

  &.file-failed {
    border: 1px solid #ffa6b0;
  }

  .file-icon{
    color: #fff;
    display: flex;
    float: left;
    font-size: 30px;
    height: 30px;
    margin: 5px 8px 5px 7px;
    width: 30px;
    
    .icon-container-image { 
      background-color: #99ccff; 
      border-radius: 3px;
    }
    .icon-container-pdf { 
      background-color: #ff4539; 
      border-radius: 3px;
    }
    .icon-container-zip{ 
      background-color: #ffe196; 
      border-radius: 3px;
    }
    .icon-container-audio{ 
      background-color: #f0ba02;
      border-radius: 3px; 
    }
    .icon-container-video{ 
      background-color: #00a49e; 
      border-radius: 3px;
    }
    .icon-container-ppt{ 
      background-color: #d64123;
      border-radius: 3px; 
    }
    .icon-container-word{ 
      background-color: #2b5697;
      border-radius: 3px; 
    }
    .icon-container-excel{ 
      background-color: #4d9c45;
      border-radius: 3px; 
    }
    .icon-container-file-default { 
      background-color: #4a90e2; 
      border-radius: 3px;
    }
  }

  .file-info{
    align-items: center;
    display: flex;
    float: right;
    height: 100%;
    width: calc(100% - 50px);
    
    span{
      display: block;
      font-family: NunitoSans;
      font-size: 13px;
      white-space: nowrap;
  
      &:first-child{
        flex-grow: 2;
        font-weight: bold;
        margin-right: 5px;
        text-overflow: ellipsis;
        overflow: hidden;
      }
    
      &:last-child{
        color: #9b9b9b;
        flex-grow: 1;
        font-weight: 500;
        padding-right: 10px;
        text-align: right;
      }
    }
  }

  .file-delete{
    align-items: center;
    box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.18);
    border-radius: 50%;
    display: none;
    height: 19px;
    position: absolute;
    right: -10px;
    top: -10px;
    width: 19px;
  
    i{
      font-size: 18px;
      margin: 0 auto;
    }
  }

  .file-loading-bar {
    height: 2px;
    background-color: #0091ff;
    position: relative;
    top: 41px;
  }
}

/* THEME
----------------------------- */
@mixin themable($_THEME, $_BACKGROUND_COLOR_ATTACHMENT, $_BORDER_COLOR_ATTACHMENT, $_BACKGROUND_COLOR_DELETE_ATTACHMENT, $_BORDER_COLOR_DELETE_ATTACHMENT, $_COLOR_TEXT_DELETE_ATTACHMENT){
  [data-theme^=#{$_THEME}],
  [data-theme] [data-theme^=#{$_THEME}] {
    .file-container{
      background-color: $_BACKGROUND_COLOR_ATTACHMENT;
      border: 1px solid $_BORDER_COLOR_ATTACHMENT;

      .file-delete {
        background-color: $_BACKGROUND_COLOR_DELETE_ATTACHMENT;
        border: solid 1px $_BORDER_COLOR_DELETE_ATTACHMENT;
        i {
          color: $_COLOR_TEXT_DELETE_ATTACHMENT;
        }
      }
    }
  }
}
    
@include themable($_THEME_LIGHT, $_BACKGROUND_COLOR_ATTACHMENT_LIGHT,$_BORDER_COLOR_ATTACHMENT_LIGHT, $_BACKGROUND_COLOR_DELETE_ATTACHMENT_LIGHT, $_BORDER_COLOR_DELETE_ATTACHMENT_LIGHT,$_COLOR_TEXT_DELETE_ATTACHMENT_LIGHT);
@include themable($_THEME_DARK, $_BACKGROUND_COLOR_ATTACHMENT_DARK,$_BORDER_COLOR_ATTACHMENT_DARK,$_BACKGROUND_COLOR_DELETE_ATTACHMENT_DARK, $_BORDER_COLOR_DELETE_ATTACHMENT_DARK,$_COLOR_TEXT_DELETE_ATTACHMENT_DARK);