/**
 * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com).
 *
 * WSO2 LLC. 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 "../../utils/styles/Theme.scss";

.consentTable {
  width: 100%;
  height: 100%;
  // overflow-x: scroll;

  // Filters
  .consentTable__filters {
    width: 100%;
    height: 80px;

    position: relative;

    .consentTable__filters__container {
      width: 100%;
      height: 100%;

      @include flexbox;
      .consentTable__filters__pageDetails {
        display: none;
      }
      .consentTable__filters__search {
        width: calc(100% - 100px);
        height: 100%;

        @include flexbox;
        justify-content: flex-end;

        padding-right: $padding-10;
      }
      .consentTable__filters__menu__button {
        width: 100px;
        height: 100%;

        @include flexbox;
        justify-content: flex-end;
      }
    }

    .consentTable__filters__menu {
      position: absolute;
      right: 0px;
      top: 80px;
      z-index: 3;

      .consentTable__filters__menu__search {
        display: none;
      }
    }
  }

  // Table
  .consentTable__table {
    width: 100%;
    height: calc(100svh - 260px);
    max-height: calc(800px);

    overflow-y: auto;

    table {
      width: 100%;
      min-width: 1000px;
      table-layout: fixed;
      thead {
        height: 60px;

        text-align: center;
        tr {
          position: sticky;
          top: 0px;
        }
      }

      tbody {
        tr {
          td {
            padding: $padding-16 0px;

            .consentTable__table__fallback {
              width: 100%;
              height: 100%;

              @include flexbox;
              flex-direction: column;

              .consentTable__table__fallback__icon {
                height: 80px;
              }
            }
          }
        }
      }
    }

    table,
    tr,
    td {
      border: none;
      border-collapse: collapse;
    }
  }

  // Pagination
  .consentTable__pagination {
    height: 80px;
    width: 100%;

    @include flexbox;
    justify-content: flex-end;

    .consentTable__pagination__icon {
      height: 100%;
      width: 60px;

      @include flexbox;

      font-weight: bold;

      :only-child {
        cursor: pointer;
      }
    }
  }
}

// Media Queries
@media (width<=1000px) {
  .consentTable {
    .consentTable__filters {
      .consentTable__filters__container {
        .consentTable__filters__pageDetails {
          width: calc(100% - 100px);
          height: 100%;

          @include flexbox;
          justify-content: flex-start;
          display: flex;
        }
        .consentTable__filters__search {
          display: none;
        }
      }

      .consentTable__filters__menu {
        .consentTable__filters__menu__search {
          display: block;
        }
      }
    }
    .consentTable {
      max-height: unset;
    }

    .consentTable__pagination {
      justify-content: center;
    }
  }
}
