/**
 * Copyright (c) OpenLens Authors. All rights reserved.
 * Licensed under MIT License. See LICENSE in root directory for more information.
 */


.Drawer {
  --spacing: #{$padding * 3};
  --icon-focus-color: white;

  position: absolute;
  background: var(--contentColor);
  box-shadow: 0 0 $unit * 2 var(--boxShadow);
  z-index: $zIndex-drawer;
  height: 100%;

  &.left {
    left: 0;
  }

  &.right {
    right: 0;
  }

  &.top {
    top: 0;
  }

  &.bottom {
    bottom: 0;
  }

  &.left,
  &.right {
    top: 0;
    width: var(--size);
    max-width: 95vw; /* Prevent drawer to be bigger than viewport */
  }

  &.top,
  &.bottom {
    left: 0;
    width: 100%;
    height: var(--size);
  }

  .drawer-wrapper {
    height: 100%;
    min-height: 100%;
  }

  .drawer-title {
    background: var(--blue);
    color: var(--drawerTitleText);
    padding: $padding $padding * 2.5;
    word-break: break-all;
    position: relative;
    min-height: 54px;

    .drawer-title-text {
      font-weight: bold;
      flex-grow: 2;
      padding-right: $padding;
    }

    .drawer-title-text .Icon {
      opacity: 0;
      font-weight: normal;
      margin-left: 8px;
    }

    .drawer-title-text:hover .Icon {
      opacity: 1;
      transition: opacity 250ms;
    }

    .MenuActions.toolbar .Icon {
      color: var(--drawerTitleText);
    }

    .Menu {
      box-shadow: none;
    }
  }

  .drawer-content {
    overflow: auto;
    padding: var(--spacing);

    .Table .TableHead {
      border-bottom: 1px solid var(--borderFaintColor);
    }
  }
}
