// Copyright (c) Microsoft. All rights reserved.

@import 'src/styles/mixins';
@import 'src/styles/themes';

.panel-container {
  flex-grow: 1;
  display: flex;
  flex-flow: column nowrap;
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  box-shadow: -1px 2px 5px rgba(0, 0, 0, 0.07);

  .panel-header {
    display: flex;
    align-items: center;
    flex-shrink: 0;

    .panel-header-label {
      flex-shrink: 0;
      font-size: 1em;
      font-weight: normal;
      margin: 0;
      padding: 10px;
    }
  }

  .panel-content {
    flex-grow: 1;
    padding: 10px;
    overflow: auto;
    position: relative;
  }

  .panel-message {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .panel-overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Use flex to center the loading indicator */
    display: flex;
    align-items: center;
    justify-content: center;

    &.error-overlay { overflow: auto; }

    .panel-error-container {
      width: 90%;
      text-align: center;
      display: flex;
      flex-flow: row wrap;
      justify-content: center;
    }
  }

  @include themify($themes) {
    .panel-header {
      background-color: themed('colorDashboardPanelHeaderBg');
      color: themed('colorDashboardPanelText');
    }

    .panel-content,
    .panel-message {
      color: themed('colorDashboardPanelText');
      background-color: themed('colorDashboardPanelContentBg');

      // since the background color has changed, the borders for grids looks weird. To match
      // the fluent behavior, don't show row separators for grids in a tile:
      :global(.ag-row) {
        border-color: themed('colorDashboardPanelContentBg');
      }
    }


    .panel-overlay-container {
      background-color: themed('colorDashboardPanelOverlayBg');

      &.error-overlay { background-color: themed('colorDashboardPanelErrorOverlayBg'); }

      .panel-error-container { color: themed('colorContentText'); }
    }
  }
}
