/*
 * Copyright (c) 2010, 2023 BSI Business Systems Integration AG
 *
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 */
.mode-selector {
  position: relative;
  background-color: @control-background-color;
  white-space: nowrap;
  display: inline-flex;
  overflow: hidden;

  & > .mode-slider {
    display: none;
  }

  &.alternative {
    background-color: @mode-alternative-background-color;
    border-radius: @button-border-radius;
    border: @mode-selector-alternative-border-width solid transparent;

    &:not(.disabled) > .mode-slider {
      display: block;
      position: absolute;
      top: 0;
      height: 100%;
      background-color: @mode-alternative-selected-background-color;
      border-radius: @button-border-radius;
      transition: left 500ms ease, width 500ms ease;

      // do not show animations during drag
      &.mode-selector-dragging {
        transition: unset;
      }
    }

    & > .mode.mode-selector-dragging {
      pointer-events: none; // prevent click event when releasing the slider
    }
  }
}
