//
// Copyright IBM Corp. 2021, 2022
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//

// Standard imports.
@import '../../global/styles/project-settings';

// WebTerminal uses the following Carbon components:
// Button
// OverflowMenu
@import 'carbon-components/scss/components/button/button';
@import 'carbon-components/scss/components/overflow-menu/overflow-menu';

$web-terminal-width: 40rem; // 640px
$block-class: #{$pkg-prefix}--web-terminal;

@keyframes web-terminal-entrance {
  from {
    opacity: 0;
    // stylelint-disable-next-line carbon/layout-token-use
    transform: translateX(#{$web-terminal-width});
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes web-terminal-exit {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    // stylelint-disable-next-line carbon/layout-token-use
    transform: translateX(#{$web-terminal-width});
  }
}

/*
  The reason for not using theme tokens in the web terminal
  component is because we want these colors to always be the same
  despite of which carbon theme the user has.
*/

.#{$block-class} {
  @include carbon--theme($carbon--theme--g90, true);

  position: fixed;
  top: $spacing-09;
  right: 0;
  width: 100%;
  max-width: $web-terminal-width;
  height: calc(100vh - #{$spacing-09});
  border-left: 1px solid $gray-90;
  color: $text-01;
  /* stylelint-disable-next-line  */
  background-color: $gray-100;
}

.#{$block-class}__bar {
  display: flex;
  height: 3rem;
  align-items: center;
  justify-content: space-between;
  background-color: $ui-background;
}

.#{$block-class}__actions {
  display: flex;
}

.#{$block-class}__documentation-overflow {
  @include carbon--theme($carbon--theme--g100, true);
}

// Terminal body styles
.#{$block-class}__body {
  height: 100%;
}

// Terminal wrapper styles
.#{$block-class}-content-wrapper {
  width: 100vw;
  height: 100%;
}

.#{$block-class}-content-wrapper--open {
  width: calc(100vw - #{$web-terminal-width});
}
