:root {
  --ide-rail-background: var(--bg-dark-primary);
  --ide-rail-color: var(--content-primary-dark);
  --ide-rail-link-background: var(--bg-dark-primary);
  --ide-rail-link-active-color: var(--green-10);
  --ide-rail-link-active-background: var(--green-70);
  --ide-rail-link-hover-color: var(--content-primary-dark);
  --ide-rail-link-hover-background: var(--bg-dark-secondary);
  --ide-rail-border-colour: var(--border-divider-dark);
  --ide-rail-header-subdued-button-color: var(--content-primary-dark);
  --ide-rail-header-subdued-button-hover-background: var(--bg-dark-tertiary);
}

@include theme('light') {
  --ide-rail-background: #fff;
  --ide-rail-color: var(--content-primary);
  --ide-rail-link-background: #fff;
  --ide-rail-link-active-color: var(--green-70);
  --ide-rail-link-active-background: var(--bg-accent-03);
  --ide-rail-link-hover-color: var(--content-primary);
  --ide-rail-link-hover-background: var(--bg-light-secondary);
  --ide-rail-border-colour: var(--border-divider);
  --ide-rail-header-subdued-button-color: var(--content-primary);
  --ide-rail-header-subdued-button-hover-background: var(--bg-light-tertiary);
}

.rail-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-03) var(--spacing-04);
  background-color: var(--ide-rail-background);

  .rail-panel-header-button-subdued {
    @include ol-button-variant(
      var(--ide-rail-header-subdued-button-color),
      transparent,
      transparent,
      var(--ide-rail-header-subdued-button-hover-background),
      transparent,
      true
    );
  }
}

.rail-panel-title {
  font-size: var(--font-size-02);
  color: var(--ide-rail-color);
  margin-bottom: 0;
}

.ide-rail-tab-button {
  border: 0;
  background: none;
}

.ide-rail-tab-link {
  border-radius: var(--border-radius-base);
  display: block;
  margin: 0 auto;
  height: 32px;
  width: 32px;
  text-align: center;
  padding: 0;
  color: var(--ide-rail-color);
  background-color: var(--ide-rail-link-background);
  position: relative;
  overflow-y: hidden;

  &:visited,
  &:focus {
    color: var(--ide-rail-color);
  }

  &:hover {
    color: var(--ide-rail-link-hover-color);
    background-color: var(--ide-rail-link-hover-background);
  }

  .ide-rail-tab-link-icon {
    line-height: 32px;
    font-size: 20px;
  }

  &.open-rail {
    color: var(--ide-rail-link-active-color);
    background-color: var(--ide-rail-link-active-background);

    &::after {
      $indicator-height: 3px;

      border-radius: 12px;
      content: '';
      position: absolute;
      bottom: -$indicator-height;
      left: 4px;
      box-sizing: border-box;
      width: 24px;
      height: $indicator-height * 2;
      border: $indicator-height solid var(--ide-rail-link-active-color);
      background-color: var(--ide-rail-link-active-color);
    }
  }

  .badge {
    position: absolute;
    top: 0;
    right: 0;
  }
}

.ide-rail {
  height: 100%;
  padding: var(--spacing-02);
  background: var(--ide-rail-background);
  border-right: 1px solid var(--ide-rail-border-colour);
  width: 40px;
}

.ide-rail-content {
  height: 100%;

  .logs-pane {
    top: 0;
  }

  .tab-pane {
    height: 100%;
  }

  .tab-content {
    height: 100%;
    width: 100%;
    position: relative;
  }
}

.ide-rail-tabs-nav {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-02);
}

.ide-rail-tab-dropdown {
  border: 0;

  &.dropdown-toggle::after {
    display: none;
  }
}
