/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
.timeline {
  position: relative;
  height: 110px;
  background: var(--iui-color-background);
  border: 1px solid var(--iui-color-background-disabled);
  box-sizing: border-box;
}

.rail {
  position: absolute;
  width: 100%;
  height: 40px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 3;
}

.rail-center {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  cursor: pointer;
  pointer-events: none;
  background: var(--iui-color-background-disabled);
}

.tooltip-rail {
  position: absolute;
  margin-left: -11px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

.needle {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  z-index: 4;
  width: 2px;
  height: 100%;
  background: var(--iui-color-icon-accent);
  cursor: pointer;
}

.handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: 14px;
  height: 14px;
  cursor: pointer;
  border: none;
  border-radius: 50%;
  background: var(--iui-color-icon-accent);
  border: 2px solid var(--iui-color-background);

  > span {
    position: absolute;
    left: 50%;
    bottom: -25px;
    font-size: 14px;
    white-space: nowrap;
    transform: translateX(-50%);
    color: rgba(black, 0.85);
  }

  input {
    position: absolute;
    border: none;
    margin-top: 10px;
    top: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
  }

  input:focus {
    cursor: text;
    left: -0.25rem;
    top: calc(1.2rem - 0.25rem);
    width: 140px;
    padding: 0.25rem;
    border: 1px solid #ddd;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.11);
    box-sizing: border-box;
    outline: none;
  }
}

.tick-line {
  position: absolute;
  width: 2px;
  height: 11px;
  transform: translateX(-50%);
  background: var(--iui-color-background-disabled);
}

.tick-label {
  position: absolute;
  margin-top: 9px;
  font-size: 14px;
  color: rgba(black, 0.85);
  white-space: nowrap;
}

.tick-label.start {
  left: -50px;
}

.tick-label.end {
  right: -50px;
  text-align: right;
}

.tick-label.tick {
  margin-left: 11px;
  text-align: left;
}

.tooltip {
  position: absolute;
  top: -20px;
  display: inline-block;
  border-bottom: 1px dotted #222;
  margin-left: 22px;
  font-size: 14px;

  .tooltip-text {
    width: 100px;
    background-color: #222;
    color: #fff;
    // opacity: 0.8;
    text-align: center;
    border-radius: 6px;
    padding: 8px 0;
    position: absolute;
    z-index: 1;
    bottom: 150%;
    left: 50%;
    margin-left: -60px;

    &:after {
      content: "";
      position: absolute;
      top: 100%;
      left: 50%;
      margin-left: -5px;
      border-width: 5px;
      border-style: solid;
      border-color: #222 transparent transparent transparent;
    }
  }
}
