@mixin esri-feature-table__prompt($contextColor) {
  @include defaultBoxShadow();

  display: flex;
  flex-flow: column nowrap;
  border: solid 3px $contextColor;
  background-color: var(--calcite-color-background);
  padding: $cap-spacing $side-spacing;
  max-height: 85%;
  animation: esri-fade-in-up 250ms ease-in-out;
  color: $font-color;

  .esri-feature-table__prompt__header {
    display: flex;
    flex: 0 0 auto;
    margin-bottom: $cap-spacing;
    color: $contextColor;

    &__heading {
      margin: 0 $side-spacing--quarter;
      color: $heading-color;
    }
  }

  .esri-feature-table__prompt__message {
    flex: 1 1 auto;
    padding: 0 0 $cap-spacing 0;
    overflow: auto;
    overflow-x: hidden;
    word-break: break-word;
    color: inherit;
    font-weight: $font-weight;
  }

  .esri-feature-table__prompt__divider {
    flex: 0 0 auto;
    margin: 0 0 $cap-spacing 0;
    border-bottom: $border;
    border-color: $border-color--subtle;
    color: inherit;
  }

  .esri-feature-table__prompt__actions {
    display: flex;
    flex-direction: row;
  }
}

@mixin featureTable() {
  .esri-feature-table {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;

    &__content {
      overflow: hidden;
    }

    &__collapsed {
      min-width: 500px;

      &:not(:last-child) {
        border-inline-end: 1px solid var(--calcite-color-text-2);
        min-width: 300px;
        max-width: 300px;
      }
    }

    &__expanded {
      display: flex;
      min-width: 300px;

      &:not(:last-child) {
        border-inline-end: 1px solid var(--calcite-color-text-2);
      }
    }

    &__table-container {
      display: flex;
      flex: 1 1 0;
      margin: 0;
      padding: 0;
      min-height: 0;

      calcite-panel div {
        display: flex;
        flex: 1 1 0;
        flex-direction: row;
      }
    }

    &__table-navigation {
      --calcite-label-margin-bottom: 0;

      display: flex;
      align-items: center;
      background-color: var(--calcite-ui-foreground-1);
      padding-block-start: 2px; // Height of calcite progress component
      width: 100%;

      // Flips the 'move-up' icon; inspired by similar update in Popup
      calcite-action:first-child {
        transform: scaleX(-1);
      }

      calcite-action {
        display: flex;
        overflow: hidden;
      }

      :last-child {
        display: flex;
        float: inline-end;
        margin-inline: auto $side-spacing--half;
      }
    }

    &__menu-popover {
      @include defaultBoxShadow();

      // Avoid issues with menu growing outside of the viewport
      // 256px is roughly the height of a filter and 5 menu items.
      max-width: 300px;
      max-height: 256px;
      overflow-y: auto;
    }

    .esri-grid {
      background-color: inherit;

      &__grid {
        width: 100%;
        height: 100%;
      }
    }

    vaadin-grid {
      border-bottom: none;
      border-inline: none;
      background-color: inherit;
      color: inherit;
      font-family: inherit;
      font-size: $font-size;
    }

    vaadin-grid::part(body-cell) {
      font-size: $font-size;

      &:hover {
        background-color: var(--calcite-color-foreground-2);
      }
    }

    vaadin-grid::part(header-cell) {
      font-weight: $font-weight;
    }

    vaadin-grid::part(header-cell invalid) {
      background-color: var(--calcite-color-background);
      font-weight: var(--calcite-font-weight-bold);
    }

    vaadin-grid::part(body-cell invalid) {
      color: var(--calcite-color-text-3);
      font-style: italic;
    }

    vaadin-grid::part(body-cell highlight) {
      background-color: var(--calcite-color-foreground-3);
    }
  }

  .esri-feature-table__prompt--info {
    @include esri-feature-table__prompt(var(--calcite-color-status-info));
  }

  .esri-feature-table__prompt--warning {
    @include esri-feature-table__prompt(var(--calcite-color-status-warning));
  }

  .esri-feature-table__prompt--danger {
    @include esri-feature-table__prompt(var(--calcite-color-status-danger));
  }

  .esri-feature-table__layer-switcher-menu {
    display: flex;
    align-items: center;
  }

  .esri-column__show-related-records-button {
    display: flex;
    height: 100%;
  }
}

@if $include_FeatureTable == true {
  @include featureTable();
}
