@import "../config";

.table-layout-search {
  float: left;
  padding-bottom: 0.5rem !important;
}

.table-layout-action {
  float: right;
  line-height: 2.5rem;
}

.table-layout-table {
  width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  clear: both;

  th {
    text-align: start;
  }

  th, td {
    padding: 0 0.6rem;
  }

  .action {
    text-align: center;
  }

  tr {
    border-top: solid 1px var(--table-border-color);

    &:first-child {
      background-color: var(--table-header-color);
      height: 2.5rem;
      line-height: 2.5rem;
    }

    &:not(:first-child) {
      height: 2rem;
      line-height: 2rem;

      &:hover {
        background-color: var(--table-header-color);
      }
    }
  }

  span {
    display: block;
    position: relative;

    &:empty:before {
      content: "\200b";
    }

    &.error {
      background-color: var(--error-background-color);
    }
  }

  .table-select-box {
    position: absolute;
    z-index: 1;
    background: var(--background-primary-color);
    width: 10rem;
    border: solid 1px var(--input-border-color);
    border-radius: $border-radius;
    padding: 0.5rem 0;

    span {
      padding: 0 0.5rem;

      &:hover {
        background-color: var(--table-header-color);
      }
    }
  }
}

.work-group-constraints {
  position: relative;

  & > label {
    margin-bottom: 0.8rem;
  }

  .input-group {
    margin-bottom: 0.5rem;

    span {
      width: 4rem;
      position: relative;
      text-align: center;
      overflow: hidden;

      &:hover::after {
        content: 'DELETE';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        text-align: center;

        font-weight: bold;
        color: var(--primary-text-color);
        background: var(--primary-color);
      }
    }

    .form-control {
      width: 12rem;
    }
  }
}

.work-group-constraints-add {
  position: absolute;
  top: -0.5rem;
  right: 0;
}

.work-group-constraints-add-list {
  position: absolute;
  top: -2rem;
  right: 0;
  z-index: 1;
  display: none;
  padding: 0.5rem 0;

  background: var(--background-primary-color);
  border: solid 1px var(--input-border-color);
  border-radius: $border-radius;

  span {
    padding: 0 0.5rem;
    line-height: 2rem;
    display: block;

    &:hover {
      background-color: var(--table-header-color);
    }
  }

  &.active {
    display: block;
  }
}