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

/* Common Table Layout CSS */

.custom-button .MuiButton-startIcon {
  margin-right: 4px;
}

.custom-button .MuiButton-endIcon {
  margin-left: 4px;
}

.custom-button .MuiButton-startIcon svg {
  font-size: 20px;
}

/* table */

.table {
  width: 100%;
  table-layout: auto;
}
.table-paper {
  width: 100%;
  overflow: auto;
  border: thin #e1e2e4 solid;
  border-radius: 6px;
  box-shadow: 0 0 4px #d8d8d8;
  background: #f6f6f6;
}

.table-header-row {
  background-color: #e0e0e0;
  color: #686868;
}

.table-body-cell {
  max-width: 250px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 16px !important;
  font-size: 14px !important;
}

.table-header-cell {
  max-width: 250px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 16px !important;
  font-size: 14px !important;
  color: rgb(106, 106, 106) !important;
  font-weight: 600 !important;
  min-width: 40px;
  width: auto !important;
}

/* Ensure the content wrapper inside header spans full cell width */
.table-header-cell > div,
.table-header-wrap {
  display: flex;
  width: 100%;
  min-width: 0; /* allow flex children to shrink instead of overflowing */
}

/* Header text wrapper to avoid inline styles in JSX */
.table-header-text {
  display: flex;
  align-items: center;
  line-height: 20px;
  width: 100%;
  min-width: 0;
}

/* table-pagination */

.table-pagination {
  padding: 0.75rem 1rem;
}

.table-pagination-filters-box {
  min-width: 120px;
}

.table-pagination-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1.5rem;
}

.table-pagination-gotopage-paper {
  display: flex;
  align-items: center;
  width: 150px;
  border: 1px solid rgba(0, 0, 0, 0.23);
  height: 27px;
}

.pagination-page-change-btn {
  height: 24px;
  width: 24px;
}

.table-pagination-gotopage-input {
  margin-left: 5px;
  flex: 1px;
}
.table-pagination-gotopage-input input {
  padding: 0 4px !important;
}

.table-pagination-gotopage-button {
  padding: 6px !important;
  border-radius: 0 !important;
  border-left: 1px solid rgba(0, 0, 0, 0.23) !important;
  font-size: 14px !important;
}
.table-pagination-page {
  border-radius: 4px !important;
  height: 20px;
  color: #37bb9b !important;
  border: 1px solid #37bb9b !important;
  margin: 0 0.5rem !important;
  font-size: 0.875rem !important;
}

/* table-flters */

.table-filter-btn {
  border-color: #37bb9b;
  color: #37bb9b;
}

.table-filter-btn:hover {
  background-color: #37bb9b;
  border-color: #37bb9b;
  color: white;
}

.table-filters {
  border-color: #37bb9b;
  color: #37bb9b;
}
.table-filters:hover {
  background-color: #37bb9b;
  border-color: #37bb9b;
  color: white;
}

.table-filter-refresh {
  width: 0.75em !important;
  display: block !important;
  font-size: 20px !important;
}

.table-filter-column-list {
  width: 100%;
  max-width: 360px;
  padding: 0 !important;
}

.table-filter-column-list-btn {
  padding-top: 0;
  padding-bottom: 0;
}

/* SearchResult Table  view CSS */

.searchTableName {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
}

td:has(.searchTableName) {
  overflow: visible;
}

.searchTableName:hover div {
  transform: scale(1.5);
  transform-origin: 100% 50%;
  transition: transform 0.2s;
}

@keyframes placeHolderLoader {
  0% {
    background-position: -468px 0;
  }

  100% {
    background-position: 468px 0;
  }
}

.search-result-table-name-col {
  display: inline-block;
  vertical-align: bottom;
  margin-right: 8px;
}

.search-result-table-img {
  display: block;
  width: 24px;
  height: 24px;
}

.assignTag {
  height: 24px;
  padding: 2px 4px !important;
}

.remove-modal-icon {
  font-size: 1.25rem;
}

.chip-ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-list {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.entity-name {
  line-height: 24px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.delete-icon {
  font-size: 1.25rem;
  height: 24px;
}

.table-filter-column {
  font-size: 1rem;
  cursor: pointer;
}

.table-filter-column label {
  display: flex;
  align-items: center;
  padding: 0.25rem 0.875rem;
  gap: 0.5rem;
  cursor: pointer;
}

/* Only stretch non-first columns when a table is actually expanded (tbody has expanded rows) */
/* Only stretch direct cells of the expandable table, not nested inner tables */
.expand-row-table.has-expanded-rows > thead > tr > th:not(:first-child),
.expand-row-table.has-expanded-rows > tbody > tr > td:not(:first-child) {
  width: 100% !important;
}
