@use '@carbon/layout';
@use '../../vars' as *;

$icon-button-size: layout.$spacing-08;
$actionPanelOffset: layout.$spacing-09;

.sideRailHidden {
  display: none;
}

.sideRailVisible {
  display: flex;
}

/* Desktop */
:global(.omrs-breakpoint-gt-tablet) {
  .sideRail {
    width: $actionPanelOffset;

    .container {
      position: fixed;
      top: var(--omrs-navbar-height);
      right: 0;
      background: $ui-01;
      height: 100%;
      z-index: 1000;
      width: $actionPanelOffset;
      border-left: 1px solid $text-03;
      display: flex;
      align-items: center;
      flex-direction: column;
    }

    &.withinWorkspace .container {
      top: calc(var(--omrs-navbar-height) + var(--workspace-header-height));
    }
  }
}

/* Tablet */
:global(.omrs-breakpoint-lt-desktop) {
  .sideRail {
    border-top: 1px solid $color-gray-30;
    background-color: $ui-02;
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 8003;
    width: 100%;
    display: flex;
    justify-content: stretch;
  }

  .chartExtensions {
    background-color: $ui-02;
    display: flex;
    width: 100%;

    > div {
      flex: 1;
      cursor: pointer;
    }
  }

  .container {
    display: flex;
    align-items: center;
    width: 100%;
  }
}

.divider {
  background-color: $text-03;
  margin: layout.$spacing-04 0;
  height: 1px;
  width: layout.$spacing-08;
}

// Overriding styles for RTL support
html[dir='rtl'] {
  :global(.omrs-breakpoint-gt-tablet) {
    .sideRail {
      .container {
        right: unset;
        left: 0;
      }
    }
  }
}
