/*
 * 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.
 */

@import "variables";

.data-table {
  width: 100%;
}

.resources-wrapper {
  height: calc(100vh - 105px);
  margin: -15px;
  padding: 15px;
  overflow: hidden;
  .table-wrapper {
    height: calc(100vh - 115px);
    margin: 0 -15px -15px -15px;
    padding: 0 15px 15px 15px;
    overflow: auto;
  }
}

table.resources {
  width: 100%;
  max-height: 100%;

  .header-row {
    position: sticky;
    z-index: 1;
    background-clip: padding-box;
    th {
      padding: 5px;
      padding-left: 20px;

      .mat-icon-button {
        line-height: 45px;
      }
    }

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

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

  .exploratory {
    padding: 0;

    .element-row {
      display: flex;
      min-height: 48px;
      height: initial;

      td {
        display: flex;
        align-items: center;
        padding: 5px 5px 5px 20px;

        &.name-col {
          padding-left: 21px;
          overflow: hidden;
          span {
            cursor: pointer;
          }
        }

        &.shape-col {
          align-items: start;
          flex-direction: column;
          justify-content: center;
        }

        &.resources-col {
          overflow: hidden;
        }
      }
    }

    tr:not(:last-child) {
      border-bottom: 1px solid #d9d9d9;
    }
  }

  .element-row {
    td {
      border-bottom-width: 0;
    }
  }

  .filter-row {
    background-clip: padding-box;

    th {
      padding: 5px;
      background-clip: padding-box;

      &:last-child {
        padding-right: 6px;
      }
    }
  }

  .name-col {
    width: 17%;
    padding-right: 5px;
    padding-left: 24px;
    background-color: inherit;
  }

  .project-name {
    font-weight: 600;
    color: #577289;
    padding-left: 21px;
  }

  .status-col {
    width: 11%;
  }

  .shape-col {
    width: 13%;
    color: #577289;
    .label {
      color: $table-header-color;
    }
  }

  .tag-col {
    width: 13%;

    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;
    }
  }

  .resources-col {
    width: 28%;
  }

  .cost-col {
    width: 12%;
    justify-content: space-between;
  }

  .label-header {
    &.cost-col {
      z-index: 6 !important;
    }

    &.status-col {
      z-index: 10 !important;
    }

    &.resources-col {
      z-index: 7 !important;
    }

    &.tag-col {
      z-index: 8 !important;
    }

    &.shape-col {
      z-index: 9 !important;
    }

    &.settings {
      z-index: 5 !important;
    }
  }

  .actions-col {
    padding-right: 24px;
    text-align: right;
    background-color: inherit;

    .label {
      padding-right: 5px;
    }
  }

  tr.detail-row {
    height: 0;
  }

  .element-diagram {
    height: 104px;
    min-width: 80px;
    padding: 8px;
    margin: 8px 0;
    border: 2px solid black;
    font-weight: lighter;
  }

  .element-symbol {
    font-weight: bold;
    font-size: 40px;
    line-height: normal;
  }

  .element-description {
    padding: 16px;
  }

  .element-description-attribution {
    opacity: 0.5;
  }

  .dashboard_table {
    width: 100%;
    table-layout: fixed;
  }

  .dashboard_table tr {
    vertical-align: top;
  }

  .dashboard_table tr th span {
    width: 50px;
    height: 100%;
    text-align: center;
    line-height: 40px;
  }

  .dashboard_table tr td {
    font-size: 13px;
    padding: 20px 15px 16px;
  }

  .dashboard_table tr td,
  .dashboard_table tr th {
    border: 1px solid #d5dfea;
    text-align: left;
  }

  .dashboard_table tr td:last-child {
    text-align: center;
  }

  .dashboard_table_body td:first-child {
    background: #f3fbfd;
    color: #455c74;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    &::after {
      content: "";
      display: block;
    }
  }

  .dashboard_table tr:nth-child(2n + 1) {
    background: #f9fafb;
  }

  .dashboard_table tr.filter-row td {
    padding: 10px;
  }

  .dashboard_table tr.filter-row td:first-child {
    font-weight: 400;
  }

  .dashboard_table tr.filter-row td:last-child {
    padding: 10px 0;
  }

  .dashboard_table tr:nth-child(2n + 1) td:first-child {
    background: #edf6f9;
  }

  .dashboard_table th {
    padding-left: 12px;
    background: #a1b7d1;
    color: #fff;
    font-weight: 600;
    line-height: 40px;
    text-transform: uppercase;
    font-size: 13px;
  }

  &.data-grid .status-col .status {
    text-transform: capitalize;
  }

  .message_block td {
    text-align: left !important;
  }

  &.data-grid .total_cost {
    float: left;
    display: inline-block;
    color: #455c74;
  }

  .currency_details {
    display: flex;
    padding-left: 10px;
    color: #35afd5;
    cursor: pointer;
    transition: all 0.45s ease-in-out;
  }

  .currency_details:hover {
    color: #3392b0;
  }

  .currency_details .material-icons {
    font-size: 18px;
  }

  .mat-icon-button .mat-icon,
  .mat-icon-button i {
    line-height: 42px;
    font-size: 18px;
  }

  .info {
    padding: 40px;
    text-align: center;
  }

  .content-row {
    background-clip: padding-box;
  }

  .not-allow {
    cursor: not-allowed !important;
  }
}

.data-grid .list-menu {
  left: auto;
  right: 15px;
  min-width: 190px;
  max-height: calc(100vh / 2 - 70px);
  margin-left: 0;
  padding: 10px 15px;
  box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);
  border: none;
}

.settings:not(.label-header) {
  position: relative;
  width: 6%;
  padding-right: 15px !important;
  justify-content: flex-end;
  text-align: right;

  .actions {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url(../../../assets/svg/settings_icon.svg);
    text-align: center;
    cursor: pointer;
  }

  .disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
  }
}

.data-grid .list-menu li {
  //margin: 5px -5px;
  padding-bottom: 5px;
  font-size: 13px;
  border-bottom: 1px solid #edf1f5;
  cursor: pointer;
  color: #577289;
  transition: all 0.45s ease-in-out;

  div {
    padding: 8px 15px;
  }
}

.data-grid .list-menu a.navigate {
  text-decoration: none;
  color: #577289;
  transition: all 0.45s ease-in-out;
}

.data-grid .list-menu li i {
  padding-right: 5px;
  font-size: 18px;
  vertical-align: bottom;
}

.data-grid .list-menu li:not(.not-allow):hover,
.data-grid .list-menu li:not(.not-allow):hover a {
  background: none !important;
  color: #36afd5;
}

.data-grid .list-menu li:last-child {
  border-bottom: 0;
}

.data-grid .list-menu ul {
  margin-bottom: 0;
}

.data-grid .list-menu .active-items li {
  border-bottom: 1px solid #edf1f5;
}

.data-grid .message_block {
  background: #edf6f9;
}

@media screen and (max-width: 1400px) {
  table.resources {
    .settings {
      width: 7%;
    }
  }
}

.info {
  padding: 40px;
  text-align: center;
}

.odahu-icon {
  vertical-align: middle;
  margin-left: 10px;
}

.content-row {
  background-clip: padding-box;
}
