// (C) Copyright 2011-2013 Hewlett-Packard Development Company, L.P.

table.hp-master-table {
  opacity: 1;
  @include transition-property(opacity);
  @include transition-duration(0s);
  
  &.hp-changing {
    opacity: $changing-opacity;
    @include transition-delay($changing-animation-delay);
    @include transition-duration($normal-animation-duration);
  }
  
  a {
    color: $text-link-color;
  }
  
  > tbody > tr.hp-master-table-control {
    a {
      padding-right: 20px;
    }
  }
  
  > tbody > tr.hp-row-details-row {
    cursor: default;
    
    &:hover {
      > td {
        background-color: inherit;
      }
    }
  }
}

div.hp-master-pane {
  
  .dataTables_wrapper {
    display: none;
    
    &.hp-active {
      display: block;
    }
    &.hp-empty {
      display: none;
    }
  }
  
  .dataTables_scrollBody {
    border-top: 1px solid #d9d9d9;
    border-bottom: 1px solid #d9d9d9;
    
    body.hp-basic-layout & {
      border-bottom: none;
    }
    
    &:focus {
      outline: none;
    }
  }
  
  .hp-master-table {
    
    &:focus {
      outline: none;
    }
    
    > thead {
      th, td {
        white-space: nowrap;
        padding: 5px 20px 5px 10px;
        font-family: 'HPBold', Arial, Helvetica, sans-serif;
      }
    }
    
    > tbody > tr > td {
      height: $master-row-height - 16px;
      line-height: $master-row-height - 16px;
      padding: 8px 10px;
      word-break: break-all;
      
      > * {
        height: 14px;
      }
      
      a:hover {
        text-decoration: none;
      }
      
      &.hp-icon {
        padding-top: 0px;
        padding-bottom: 0px;
        
        > .hp-status {
          position: relative;
          top: 10px;
        }
      }
      
      > .hp-status {
        //top: 4px;
      }
    }
    
    > tbody > tr {
      cursor: pointer;
      color: $secondary-primary-color;
      
      &:hover {
        color: $primary-color;
      }
      
      &.hp-selected {
        color: $selected-color;
      }
      
      &.hp-expanded {
        background-color: $primary-background;
      }
      
      &.hp-master-table-control {
        background-image: none;
        
        > td {
          padding-top: 15px;
          padding-bottom: 15px;
          
          &:hover {
            background-color: inherit;
          }
        }
        
        div.hp-help {
          .hp-add-help {
            color: $secondary-color;
          }
          .hp-add-action-link {
            margin: 10px 0px;
          }
        }
        a:not(.hp-disabled) {
          color: $text-link-color;
        }
      }
      
      &.hp-row-details-row {
        cursor: auto;
        background: none;
        
        > td > * {
          height: auto;
        }
        .hp-row-details-cell {
          padding: 0px 20px 20px 50px;
          border-top-style: none;
          border-bottom: 1px solid $secondary-divider;
          border-right: 1px solid $secondary-divider;
          
          a:not(.hp-disabled) {
              color: $text-link-color;
          }
        }
        form:last-of-type {
          padding-bottom: 0px;
        }
        form, ol {
          margin-bottom: 0px;
        }
        
        &.hp-selected {
          
        }
      }
    }
  }
  
  > .hp-master-table {
    width: 100%;
    overflow: auto;
  }
}

div.hp-master-full {
  
  > div.dataTables_wrapper {
    position: absolute;
    top: 50px + 35px;
    left: 15px;
    right: 15px;
    bottom: 0px;
  }
  
  .hp-master-table > tbody {
    > td {
      height: inherit;
      line-height: inherit;
      padding: 13px 10px;
      
      &.hp-icon {
        height: 30px;
      }
    }
    tr.hp-master-table-control {
      div.hp-help {
        .hp-add-help {
            color: $secondary-color;
          }
        .hp-add-action-link {
          margin: 10px 0px;
        }
      }
    }
    > tr.hp-selected, > tr.hp-selected:hover {
      
      > td {
        
        &.hp-row-details-cell {
          border-bottom-color: $primary-divider;
        }
        
        &:last-child {
          border-right: 1px solid $primary-divider;
          padding-right: 9px;
        
          &:after {
            content: '';
            display: none;
          }
        }
      }
    }
  }
}
