/**
 * Copyright (c) 2015 Bosch Software Innovations GmbH and others.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
// scss-lint:disable ImportantRule, PropertySortOrder
@import "table-content.scss";

@mixin sp-drag-image {
  background: $v-selection-color;
  background-image: none;
  opacity: .6;
}

@mixin count-sp-drag-image {
  display: block;
  float: right;
  width: 20px;
  margin-top: -34px;
  background: $red-color;
  font-weight: bold;
  text-align: center;
  border-radius: 10px;
  position: relative;
  overflow: visible;
  &[style*="hidden"] {

  }
  right: -10px;
  top: -15px;
}

@mixin table {
  @include table-content;
  $color5: $lighter-orange-color;
  $color3: $dark-green-color;

  //Custom styles for drag and drop image for targets and distributions
  // For target table
  tbody.v-drag-element {
    margin-top: 0 !important;
    margin-left: 0 !important;

    tr:not(.v-table-focus) {
      display: none;
    }

    tr.v-table-focus {
      @include valo-selection-item-selected-style;
      @include sp-drag-image;
    }

    tr {
      overflow: visible !important;
    }

    tr td:last-child {
      display: none;
    }

    tr td.v-table-cell-content:last-child {
      display: none;
    }

    tr:after {
      @include count-sp-drag-image;
    }
  }

  .v-table-row-drag-top td.v-table-cell-content {
    border-top: 1px solid $widget-border-color;
  }

  //disable table drag hint
  .v-table-row-drag-bottom td.v-table-cell-content {
    border-bottom: 0;
  }

  // For table and drag without selection
  tr.v-drag-element {
    overflow: visible !important;

    td:last-child {
      display: none;
    }

    &:after {
      @include count-sp-drag-image;
    }

    &.v-table-focus {
      @include valo-selection-item-selected-style;
      @include sp-drag-image;
    }
  }

  // For table in IE
  table.v-drag-element {
    background: none;
    margin-top: 0 !important;
    margin-left: 0 !important;
    overflow: visible !important;

    tr:not(.v-table-focus) {
      display: none;
    }

    tr.v-table-focus {
      @include valo-selection-item-selected-style;
      @include sp-drag-image;
      color: $widget-bg;
      opacity: 1;
    }

    td:last-child {
      display: none;
    }

    tr td:last-child {
      display: none;
    }

    tr td.v-table-cell-content:last-child {
      display: none;
    }

    &:after {
      @include count-sp-drag-image;
    }
  }
}
