$primary-color: #7abfbc;
$secondary-color: #343a40;
$secondary-font-color: rgb(82, 95, 127);
$color-light-grey: rgba(0, 0, 0, 0.07);

$color-success: #86af49;
$color-failed: #af4949;
$color-scheduled: #ffa500;

$primary-color-dark: #196b99;
$table-odd-dark-background: #373737;

#tl_navigation .group-workmate {
  background: url(/bundles/pdirworkmate/img/pdir_logo.svg) 0 1px no-repeat;
  background-size: auto;
  background-size: 18px 18px;
}

.workmate {
  .software,
  .customer {
    display: inline-block;
    padding-left: 3px;
  }

  .customer {
    color: #999;
    min-width: 70px;
    width: 7em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .software {
    min-width: 125px;
    max-width: 125px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .badge {
    border-radius: .375rem;
    color: #fff;
    display: inline-block;
    font-size: .75em;
    font-weight: 600;
    line-height: 1;
    padding: .2rem .6rem;
    text-align: center;
    vertical-align: baseline;
    white-space: nowrap;
    margin-right: 3px;

    &.url {
      background-color: $primary-color;
      border-radius: 0;
      min-width: 150px;
      display: inline-grid;
    }

    &.tag {
      background-color: $secondary-color;
    }

    &.urls {
      background-color: #ccc;
      border-radius: 0;
    }

    &.deactivated {
      background-color: $color-failed;
      color: #fff;
      a {
        color: #fff;
      }
    }
  }

  .screen {
    min-width: 15px;
    display: inline-block;
    margin-right: 5px;

    .preview-image {
      width: 15px;
      height: 15px;

      &:hover {
        position: absolute;
        width: 600px;
        height: auto;
        margin-top: -10px;
        z-index: 1;
        border: 10px solid $secondary-color;
      }
    }
  }

  .runner {
    width: 1rem;
    min-height: 11px;
    display: inline-block;
    margin-right: 5px;
    text-align: center;

    .circle {
      position: relative;
      margin-top: 3px;
      margin-left: 4px;
      display: block;
      width: 10px;
      height: 10px;
      border-radius: 100%;

      &.failed {
        background-color: $color-failed;
      }

      &.success {
        background-color: $color-success;
      }

      &.scheduled {
        background-color: $color-scheduled;
      }
    }
  }

  .dropdown {
    display: inline-block;

    &:hover .content {
      display: block;
    }

    .content {
      width: 400px;
      position: absolute;
      text-align: center;
      display: none;
      background-color: #f9f9f9;
      min-width: 160px;
      box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
      padding: 12px 16px;
      z-index: 1;
      border-radius: 10px;

      h2 {
        text-align: left;
        width: 100%;
        padding: 5px 15px 15px 15px;
        border-bottom: 1px solid $secondary-color;
        box-sizing: border-box;

        &.failed {
          color: $color-failed;
        }

        &.success {
          color: $color-success;
        }

        small {
          color: $primary-color;
        }

      }

      div {
        display: flex;
        align-items: baseline;
        position: relative;
        padding: 8px 16px;
        padding-left: 16px;
        border-bottom: 1px solid $secondary-color;
        justify-content: space-between;
        text-align: left;

        > * {
          display: flex;
          font-size: 1.1em;
          text-align: left;
        }

        .name {
          width: 100%;
        }

        .details a {
          color: $primary-color;
          font-weight: normal;
        }

        .symbol {
          cursor: pointer;
          padding-right: 5px;
          font-size: 1.3rem;
          width: 20px;

          &.failed {
            color: $color-failed;
          }

          &.success {
            color: $color-success;
          }
        }
      }
    }
  }

  .sub-data {
    display: none;
    ul {
      display: flex;

      li {
        display: block;

        .data-item {
          display: flex;

          h5 {
            padding: 15px 0 0 0;
            margin: 0;
          }

          .avatar-box {
            flex-shrink: 0;
            width: 2.40625rem;
            height: 2.40625rem;
            padding-top: 1.40625rem;

            .avatar {
              .avatar:not(img) {
                background: #fff;
              }

              .avatar-soft-dark .avatar-initials {
                color: #132144;
                background-color: rgba(19, 33, 68, .1);
              }

              .avatar-initials {
                font-size: .875rem;
                border-radius: 50%;
              }

              max-width: 100%;
            }
          }

          .data-item-content {
            flex-grow: 1;

            .row {
              --bs-gutter-x: -1.5rem;
              --bs-gutter-y: 0;
              display: -ms-flexbox;
              display: flex;
              -ms-flex-wrap: wrap;
              flex-wrap: wrap;
              margin-top: calc(-1 * var(--bs-gutter-y));
              margin-right: calc(-.5 * var(--bs-gutter-x));
              margin-left: calc(-.5 * var(--bs-gutter-x));

              .col-md-5 {
                flex: 0 0 auto;
                width: 41.66666667%;
              }

              .col-md-7 {
                flex: 0 0 auto;
                width: 58.33333333%;
              }
            }

            .failed {
              color: $color-failed;
            }

            .success {
              color: $color-success;
            }

            .scheduled {
              color: $color-scheduled;
            }
          }
        }
      }

      &.versions {
        li {
          width: 33.3333334%;
        }
      }

      &.packages,
      &.tools,
      &.monitoring {
        margin-top: 10px;
        border-top: 1px dotted #ccc;
        padding: 15px 15px 15px 30px;
        margin-left: 15px;

        &:before {
          position:absolute;
          margin-right: 20px;
          margin-left: -20px;
        }
      }

      &.packages {
        flex-wrap: wrap;

        &:before {
          content:'📦';
        }

        li {
          width: calc(25% - 15px);
          // flex: 1 0 calc(25% - 15px);
        }
      }

      &.monitoring {
        &:before {
          content:'🕐';
        }
      }

      &.tools {
        &:before {
          content:'🛠';
        }
        li {
          border-left: 1px solid #ccc;
          padding: 0 5px;

          &:first-child {
            padding-left: 0;
          }
        }

        li:first-child {
          border: 0;
        }
      }

    }
  }

  // operations
  a.updateManager img {
    max-width: 20px;
    max-height: 20px;
  }

  a.updateComposer img {
    max-width: 30px;
    max-height: 30px;
  }

  a.showReport img {
    max-width: 20px;
    max-height: 20px;
  }

  > table > tbody > tr:hover,
  > table > tbody > tr:hover td {
    background-color: #d3d3d3 !important;
  }

  > table > tbody > tr.clicked td .sub-data {
    display:block;
  }
  > table > tbody > tr.clicked td:first-child {
    padding-top: 12px;
  }
}

#tl_workmate_project {

  .helper-button {
    position: absolute;
    left: 50%;
    margin-left: 120px;
    margin-top: -105px;

    &.update {
      margin-left: 207px;
    }

    &.tool {
      margin-left: 297px;
    }
  }
}

.wm-w25,
.wm-w33 {
  float: left;
  min-height: 80px;
}

.wm-w25 {
  width: calc(25% - 30px);
}

.wm-w33 {
  width: calc(33.33333% - 30px);
}

.wm-w66 {
  width: calc(66.66666% - 30px);
}

html[data-color-scheme="dark"] {

  .click2edit a.showReport img {
    filter: invert(1);
  }

  .workmate {

    .badge {
      &.urls {
        background-color: #2f4f4f;
      }

      &.tag {
        background-color: #556B2F;
      }

      &.url {
        background-color: $primary-color-dark;
      }

      &.deactivated {
        background-color: $color-failed;
        color: #fff;
        a {
          color: #fff;
        }
      }
    }

    > table > tbody > tr:hover,
    > table > tbody > tr:hover td {
      background-color: #262626 !important;
    }

    img.php {
      filter: invert(1);
    }
  }
}

@import "project_report";
