
#titlebar {

  -webkit-app-region: drag;
  display: flex;
  align-items: center;
  background-color: $color-titlebar;
  height: $titlebar-height;
  font-size: $titlebar-font-size;
  transition: box-shadow $shadow-animation-duration;

  #app-wrapper.scrolled & {
    box-shadow: 0 2px 3px 0 $shadow-color;
  }

}

#titlebar-close {

  position: relative;
  width: $gutter;
  height: $gutter;
  border-radius: $gutter;
  margin-left: $gutter;
  background-color: #ff5f57;
  border: 1px solid #e2463f;
  -webkit-app-region: no-drag;

  &:active {
    border-color: #ad3934;
    background-color: #bf4943;
  }

  svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    -webkit-app-region: no-drag;
  }

  &:not(:hover) svg {
    display: none;
  }

  #app-wrapper:not(.focused) & {
    border-color: lighten( $color-titlebar, 25% );
    background-color: lighten( $color-titlebar, 25% );
  }

}

#titlebar-title {

  position: fixed;
  top: 0;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  padding: 0 $gutter;
  height: $titlebar-height;
  background: $color-titlebar-title;
  -webkit-app-region: no-drag;

  &:hover {
    background: $color-titlebar-title-hover;
  }

  &:active {
    background: $color-titlebar-title-active;
  }

}

#titlebar-select {
  -webkit-appearance: none;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  border: 0;
  border-radius: inherit;
  z-index: 1;
}
