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

.expression-container .table-component,
.expression-container .table-component table {
  font-style: normal;
}

.expression-container .table-component,
.expression-container .table-component table,
.expression-container .table-component table thead,
.expression-container .table-component table thead tr,
.expression-container .table-component table tbody,
.expression-container .table-component table tbody tr {
  box-sizing: border-box;
}

/** Table Header rules */

.expression-container .table-component table th {
  min-height: 55px;
  position: relative;
  padding: 0.7em 0;
  border-style: ridge;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.expression-container .table-component table th:not(.row-index-column) {
  text-align: center;
  background-color: #def3ff;
}

.expression-container .table-component table th.fixed-column {
  font-weight: 400;
  min-width: 60px;
  background-color: initial;
}

.expression-container .table-component table th.no-clickable-cell:first-of-type .header-cell,
.expression-container .table-component table th.no-clickable-cell .header-cell-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  text-align: center;
}

.expression-container .table-component table th:not(.no-clickable-cell) .header-cell-info {
  cursor: pointer;
}

.expression-container .table-component table th:not(.no-clickable-cell) .header-cell-info .name {
  min-height: 21px;
}

.header-cell-element-extension {
  position: absolute;
  top: 0;
  right: 0;
}

.expression-container .table-component table thead tr {
  height: 4em;
}

.expression-container .table-component table thead th,
.expression-container .table-component table tbody td {
  border-top: 1px solid var(--pf-v5-global--palette--black-300);
  border-left: 1px solid var(--pf-v5-global--palette--black-300);
  border-right: 0;
  border-bottom: 0;
  outline: none;
}

.expression-container .table-component table thead th:last-child,
.expression-container .table-component table tbody td:last-child {
  border-right: 1px solid var(--pf-v5-global--palette--black-300);
}

.expression-container .table-component table thead tr:last-child th,
.expression-container .table-component table tbody tr:last-child td {
  border-bottom: 1px solid var(--pf-v5-global--palette--black-300);
}
/* SELECTION */

.expression-container .table-component table thead th.selected:after {
  position: absolute;
  top: -1px;
  left: -1px;
  content: "";
  width: 100%;
  height: 100%;
  z-index: 15;
  background-color: rgba(0, 0, 0, 0.06);
}
.expression-container .table-component table tbody td.row-index-column-cell.selected {
  background-color: #f0f0f0;
}

.expression-container .table-component table thead th.editing {
  box-shadow: inset 0px 0px 20px -5px darkgrey;
}
.expression-container .literal-expression-body.editing,
.expression-container .table-component table tbody td.editing {
  box-shadow: 0px 0px 20px -5px darkgrey;
}

.expression-container .table-component table thead tr th {
  border-top: 1px solid var(--pf-v5-global--palette--black-400);
  border-left: 1px solid var(--pf-v5-global--palette--black-400);
  border-right: 1px solid var(--pf-v5-global--palette--black-400);
  border-bottom: 1px solid var(--pf-v5-global--palette--black-400);
}

.expression-container .table-component table tbody tr td.row-index-column-cell {
  border-top: 1px solid var(--pf-v5-global--palette--black-400);
  border-left: 1px solid var(--pf-v5-global--palette--black-400);
  border-right: 1px solid var(--pf-v5-global--palette--black-400);
}
.expression-container .table-component table tbody tr:last-child td.row-index-column-cell {
  border-bottom: 1px solid var(--pf-v5-global--palette--black-400);
}

.expression-container .table-component table thead th.selected:not(.editing):after,
.expression-container .table-component table tbody td.selected:not(.editing):after {
  position: absolute;
  content: "";
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  z-index: 5;
}

.expression-container .table-component table thead th:after,
.expression-container .table-component table tbody td:after {
  pointer-events: none;
}

.expression-container .table-component table tbody td.selected:not(.editing):not(.row-index-column-cell):after {
  background-color: rgba(182, 210, 251, 0.312);
}

.expression-container .table-component table thead th.selected.middle:after,
.expression-container .table-component table tbody td.selected.middle:after {
  top: -1px;
  left: -1px;
}
.expression-container .table-component table thead th.selected.left:after,
.expression-container .table-component table tbody td.selected.left:after {
  top: -1px;
  left: -1px;
  border-left: 1px solid #438cb1;
}
.expression-container .table-component table thead th.selected.top:after,
.expression-container .table-component table tbody td.selected.top:after {
  top: -1px;
  left: -1px;
  border-top: 1px solid #438cb1;
}
.expression-container .table-component table thead th.selected.bottom:after,
.expression-container .table-component table tbody td.selected.bottom:after {
  bottom: -1px;
  left: -1px;
  border-bottom: 1px solid #438cb1;
}
.expression-container .table-component table thead th.selected.right:after,
.expression-container .table-component table tbody td.selected.right:after {
  top: -1px;
  left: -1px;
  border-right: 1px solid #438cb1;
}

.expression-container .table-component table thead th.active:after,
.expression-container .table-component table tbody td.active:after {
  position: absolute;
  top: -2px !important;
  left: -2px !important;
  content: "";
  width: calc(100% + 4px) !important;
  height: calc(100% + 4px) !important;
  z-index: 6 !important;
  border: 3px solid #438cb1 !important;
  border-radius: 3px !important;
}

/** Table Body rules */

.expression-container .table-component table tr {
  border: 0;
}

.expression-container-box
  .conditional-expression
  .table-component
  tr.evaluation-hits-count-row-overlay
  > td:first-child::before {
  content: "";
  position: absolute;
  background-color: rgb(215, 201, 255, 0.5);
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.expression-container-box
  .conditional-expression
  .table-component
  tr.evaluation-hits-count-row-overlay
  > td
  > div
  > div
  > div
  > .logic-type-selected-header::before {
  content: "";
  position: absolute;
  background-color: rgb(215, 201, 255, 0.5);
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.expression-container-box
  .decision-table-expression
  .table-component
  tr.evaluation-hits-count-row-overlay
  > td::before {
  content: "";
  position: absolute;
  background-color: rgb(215, 201, 255, 0.5);
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

.evaluation-hits-count-badge-non-colored::before {
  content: attr(data-evaluation-hits-count);
  font-size: 0.8em;
  text-align: left;
  color: white;
  background-color: var(--pf-global--palette--black-600);
  position: absolute;
  top: 0px;
  left: 0px;
  height: 40px;
  width: 40px;
  clip-path: polygon(0% 100%, 100% 0%, 0% 0%);
  padding-left: 0.2em;
}

.evaluation-hits-count-badge-colored::before {
  content: attr(data-evaluation-hits-count);
  font-size: 0.8em;
  text-align: left;
  color: white;
  background-color: rgb(134, 106, 212);
  position: absolute;
  top: 0px;
  left: 0px;
  height: 40px;
  width: 40px;
  clip-path: polygon(0% 100%, 100% 0%, 0% 0%);
  padding-left: 0.2em;
}

.expression-container .table-component table tbody tr td.row-index-cell-column {
  padding: 1.1em 0;
}

.expression-container .table-component table tbody tr td {
  padding: 0;
  border-style: solid;
  text-align: center;
  overflow: visible;
  position: relative;
}

.expression-container .table-component table tbody tr td.row-index-column-cell {
  align-items: flex-start;
  justify-content: center;
  box-sizing: border-box;
  min-width: 60px;
}

.expression-container .table-component table tbody tr td.row-index-column-cell {
  align-items: center;
}

.expression-container .table-component table tbody tr .empty-cell {
  display: inline-block;
  box-sizing: border-box;
  min-width: 60px;
}

/** Handle for resizing columns */

.expression-container .pf-v5-c-drawer {
  background-color: inherit;
  width: 8px;
  min-width: 8px;
}

.expression-container .pf-v5-c-drawer__splitter {
  background-color: inherit;
  width: 8px;
}

.expression-container .pf-v5-c-drawer {
  --pf-v5-c-drawer__splitter--after--BorderLeftWidth: var(--pf-v5-global--BorderWidth--sm);
  position: absolute;
  min-width: 8px;
  max-width: 8px;
  right: 2px;
  top: 0;
  bottom: 0;
}

.expression-container .pf-v5-c-drawer.resizer-disabled * {
  cursor: not-allowed;
}

.expression-container .pf-v5-c-drawer.resizer-disabled .pf-v5-c-drawer__splitter {
  background-color: lightgray;
}

.expression-container .pf-v5-c-drawer .pf-v5-c-drawer__splitter {
  z-index: 10;
  background-color: #00000010;
}

.expression-container .pf-v5-c-drawer .pf-v5-c-drawer__splitter.min {
  background-color: #00ffb739;
}

.expression-container .pf-v5-c-drawer .pf-v5-c-drawer__splitter.min-basis {
  background-color: #ffe10039;
}

.expression-container .pf-v5-c-drawer .pf-v5-c-drawer__splitter.actual {
  background-color: rgba(144, 0, 255, 0.137);
}

.expression-container .pf-v5-c-drawer .pf-v5-c-drawer__splitter.error {
  background-color: red;
}
/** Additional row section */

.expression-container .table-component table tbody tr .additional-row-content {
  box-sizing: border-box;
}

/** Inline adding rows and columns */

.add-row-button {
  position: absolute;
  border: 1px solid var(--pf-v5-global--palette--black-400);
  height: 18px;
  width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background-color: white;
  font-size: 0.65em;
  z-index: 20;
  cursor: pointer;
}

.add-row-button:hover {
  filter: brightness(0.9);
}

.add-row-button:active {
  filter: brightness(0.8);
}

.add-column-button {
  position: absolute;
  border: 1px solid var(--pf-v5-global--palette--black-400);
  bottom: 5px;
  height: 18px;
  width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background-color: #def3ff;
  font-size: 0.65em;
  z-index: 20;
  cursor: pointer;
}

.add-column-button:hover {
  filter: brightness(0.9);
}

.add-column-button:active {
  filter: brightness(0.8);
}

.logic-type-popover .pf-v5-c-menu {
  box-shadow: none;
  min-width: 210px;
}
