/*!
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
.billing-page-wrapper {
  height: calc(100vh - 130px);
  margin-left: -15px;
  margin-right: -15px;
  padding-left: 15px;
  padding-right: 15px;
  scroll-behavior: smooth;

  &.scroll {
    overflow: auto;
  }
}

.table-wrapper {
  position: relative;
  display: block;
  width: 100%;
  height: inherit;
  max-height: calc(100vh - 130px);
  overflow: unset;
  scroll-behavior: smooth;
  background-color: #ffffff;
  box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);

  &.scroll {
    overflow: auto;
  }
}

.charges-th {
  right: 0px !important;
}

.wrapper {
  position: relative;
  height: inherit;

  .nav-buttons {
    position: absolute;
    bottom: 0;
    z-index: 105;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 48px;
    background-color: #ffffff;
    
    &.border {
      border-top: 1px solid #e3e5e8;
    }

    .mat-mini-fab {
      height: 25px;
      width: 25px;

      .mat-button-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2px 0 0;
        line-height: unset;
      }
    }
  }

  button {
    display: flex;
    align-items: center;
    background-color: #fff;
    box-shadow: none;

    mat-icon {
      color: lightgrey;

      &.highlight {
        color: #35afd5;
      }
    }
  }
}

.reporting {
  width: 100%;
  min-width: 1100px;
  overflow: auto;
  border-collapse: inherit;

  .mat-cell {
    vertical-align: middle;
  }

  tr {

    th {
      padding-right: 5px;

      &.th_charges {
        z-index: 16 !important;
      }
    }

    td {
      padding-left: 20px;
      font-size: 13px;

      &.mat-cell {
        border-bottom-color: #e3e5e8;
      }

      &.info {
        z-index: 1 !important;
        text-align: center;
        padding: 40px;
      }

      &.no-border {
        border-bottom: none;
      }
    }

    &.filter-row {
      th {
        z-index: 103 !important;
        padding: 5px;
        font-size: 13px;
      }

      .filter-field {
        font-size: 13px;
      }
    }

    &.header-row {
      th {
        .label {
          position: relative;
          padding-left: 0;
          font-size: 13px;
        }
      }
    }
  }

  .th_shape {
    z-index: 10 !important;
    width: 12%;
    min-width: 150px;
  }

  .th_user,
  .env_name,
  .service,
  .tags {
    width: 15%;
    min-width: 150px;
    word-wrap: break-word;
  }

  .service {
    width: 10%;
  }

  .tags {
    .label {
      padding-top: 0;
    }
  }

  .service {
    z-index: 9 !important;
    min-width: 175px;
  }

  .env_name {
    z-index: 15 !important;
    width: 21%;
    min-width: 200px;
    padding-left: 0;
  }

  .th_user {
    z-index: 14 !important;
  }

  .th_empty {
    z-index: 4 !important;
    width: 3%;
  }

  .th_project {
    z-index: 13 !important;
    width: 12%;
    min-width: 150px;
  }

  .th_type {
    z-index: 12 !important;
    width: 12%;
    min-width: 170px;
  }

  .th_status {
    z-index: 11 !important;
    width: 8%;
    min-width: 150px;
  }

  .th_charges {
    min-width: 135px;
    text-align: right;

    .label {
      padding-top: 0;
    }
  }

  .tags-col {
    padding: 5px;

    mat-chip {
      display: inline-block;
      min-height: 20px;
      max-width: 110px !important;
      margin: 2px;
      padding: 5px 10px;
      font-size: 13px;
      white-space: nowrap;
      line-height: 10px;
    }
  }

  .mat-column-charge,
  .filter-row-item:last-child,
  .table-footer.mat-column-charge {
    text-align: right;
    background-color: #f8f8f8;
  }

  .header-row {
    position: unset;

    .th_charges {
      padding-top: 0;

      .label {
        padding-top: 10px;
      }

      &.label-header {
        box-shadow: none;
        border-bottom: 1px solid lightgrey !important;
      }
    }

    .label {
      display: inline-block;
      padding-top: 13px;
      vertical-align: super !important;

      .text {
        padding-left: 20px;
      }
    }

    .sort {
      position: absolute;
      bottom: 2px;

      &-user,
      &-project {
        right: -15px;
      }

      &-arrow {
        width: 6px;
        height: 6px;
        border: 3px solid transparent;
        border-bottom: 3px solid rgba(0, 0, 0, 0.54);
        border-left: 3px solid rgba(0, 0, 0, 0.54);
        cursor: pointer;

        &.active {
          border-bottom: 3px solid #35afd5;
          border-left: 3px solid #35afd5;
        }
      }

      .down {
        transform: rotate(-45deg);
      }

      .up {
        transform: rotate(135deg);
      }
    }
  }

  .filter-row {
    .actions {
      text-align: right;

      button {
        background: inherit;
      }
    }
  }

  .table-footer {
    position: sticky;
    bottom: -1px;
    padding-left: 0 !important;
    background: inherit;
    border-top: 1px solid #e0e0e0;
    transform: translateY(-1px);
    border-bottom: none;
  }
}

.dashboard_table_body {
  td:first-child {
    cursor: default;
  }

  .dropdown-multiselect {
    button {
      height: 34px;
      padding: 7px 20px;
      font-size: 14px;
    }
  }
}

.table-footer {
  position: sticky;
  bottom: -1px;
  background: inherit;
  border-top: 1px solid #e0e0e0;
  border-bottom: none;
  transform: translateY(-1px);

  &.total-cost {
    position: sticky;
    right: 0;
    z-index: 101;
    min-width: 140px;
    padding-right: 25px;
    padding-left: 0 !important;
    text-align: right;
  }
}

.user-name-cell {
  cursor: default;
}

.right {
  position: absolute;
  right: 0;
}

.wrapper {
  .table-wrapper {
    .reporting {
      tr {
        th.th_charges.index-105,
        .filter-row-item.index-105 {
          z-index: 105 !important;
        }
      }
    }
  }
}

@media screen and (max-width: 1280px) {
  .dashboard_table.reporting {
    .env_name,
    .service,
    .th_type,
    .th_status {
      width: 10%;
    }

    .th_user {
      width: 12%;
    }

    .user-field {
      word-wrap: break-word;
    }
  }
}

.totaL-item {
  position: absolute;
  right: 0;
  z-index: 115;
  padding-right: 24px;
  font-size: 13px;

  &.scrollbar-right {
    right: 3px;
  }

  &.scrollbar-bottom {
    bottom: 3px;
  }

  span {
    padding-left: 2px;
  }
}

@-moz-document url-prefix() {
  .totaL-item {
    &.scrollbar-right {
      right: 8px !important;
    }

    &.scrollbar-bottom {
      bottom: 8px !important;
    }
  }
}