// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) 2015-2020 Andrey Antukh <niwi@niwi.nz>
// Copyright (c) 2015-2020 Juan de la Cruz <delacruzgarciajuan@gmail.com>

.element-list-body {
  align-items: center;
  display: flex;
  height: 35px;
  padding: $x-small $small;
  transition: none;
  width: 100%;

  svg {
    fill: $color-gray-20;
    height: 13px;
    flex-shrink: 0;
    margin-right: 8px;
    width: 13px;
  }
  
  &.group {
    &.open {
      .toggle-content {
        flex-shrink: 0;
        
        svg {
          transform: rotate(270deg);
        }
      }
    }
  }
  
  &:hover {
    background-color: $color-primary;
    
    svg {
      fill: $color-gray-60 !important;
    }
    
    .element-icon,
    .element-actions {
      
      svg {
        fill: $color-gray-60;
      }
    }
    
    .element-actions > * {
      display: flex;
    }
    
    span {
      color: $color-gray-60;
    }
    
    .toggle-content {
      margin-left: $x-small;

      svg {
        fill: $color-gray-60;
      }
    }
  }

  &.selected {
    
    svg {
      fill: $color-primary;
    }
    
    .element-icon {
      
      svg {
        fill: $color-primary;
      }
    }

    span {
      color: $color-primary;
    }
    
    &:hover {
      background-color: $color-primary;
      
      .element-icon,
      .element-actions {
        svg {
          fill: $color-gray-60;
        }
      }

      .element-name {
        color: $color-gray-60;
      }
    }
  }
  
  &.drag-top {
    border-top: 40px solid $color-gray-60 !important;
  }
  
  &.drag-bottom {
    border-bottom: 40px solid $color-gray-60 !important;
  }
  
  &.drag-inside {
    border: 2px solid $color-primary !important;
  }
}

.element-icon {
  svg {
    fill: $color-gray-30;
  }
}

input.element-name {
  max-width: 130px;
  width: 100%;
}

span.element-name {
  color: $color-gray-20;
  display: block;
  font-size: $fs13;
  max-width: 130px;
  min-width: 40px;
  min-height: 16px;
  overflow-x: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}
  
.element-actions {
  display: flex;
  flex-shrink: 0;
  height: 14px;
  margin-left: auto;
  position: relative;
  width: 32px;

  > * {
    display: none;
  }
  
  .toggle-element,
  .block-element {
    left: 0;
    position: absolute;
    top: 0;
        
    &.selected {
      display: flex;

        svg {
          fill: $color-gray-20;
        }
    }
  }
}

.block-element {
  left: 18px !important;

  svg {
    fill: $color-gray-30;
  }
}

.toggle-content {
  margin-left: auto;
  width: 12px;
  
  svg {
    fill: $color-gray-30;
    transform: rotate(90deg);
    width: 10px;
  }
  
  &.inverse {
    svg { transform: rotate(270deg); }
  }
  
  &:hover {
    svg {
      fill: $color-gray-60;
    }
  }
}