@import '../variables.less';

header {
  box-shadow:
    0 0 0 1px rgba(16, 22, 26, 0.2),
    0 0 0 rgba(16, 22, 26, 0),
    0 1px 1px rgba(16, 22, 26, 0.4);
  background-color: @background-3;
  -webkit-app-region: drag;

  #version-chooser .bp3-button-text::before {
    content: 'Electron v';
  }

  @media (max-width: 980px) {
    #version-chooser .bp3-button-text::before {
      content: 'v';
    }
  }

  @media (max-width: 800px) {
    .bp3-button:not(#version-chooser) {
      display: flex;
      justify-content: center;
      align-items: center;
      .bp3-button-text {
        display: none;
      }
    }

    .bp3-button > * {
      margin-right: 0;
    }

    .bp3-button .bp3-icon-compressed {
      margin-right: 7px;
    }

    .address-bar .bp3-input {
      padding-right: 36px !important;
    }
  }
}

.address-bar .bp3-input {
  padding-right: 116px !important;
}

.disabled-menu-tooltip.bp3-popover-target,
.disabled-menu-tooltip.bp3-popover2-target {
  width: 100%;
}

.commands.is-mac {
  padding: 10px
    calc(100vw - (env(titlebar-area-x, 0) + env(titlebar-area-width, 0))) 10px
    env(titlebar-area-x, 0);
}

.commands {
  display: flex;
  justify-content: space-between;
  height: 50px;
  padding: 10px;
  box-sizing: border-box;
  font-family: @fonts-common;

  button,
  input,
  select {
    -webkit-app-region: no-drag;
    margin-bottom: 0;
    white-space: nowrap;
  }

  select {
    width: 100px;
    margin-left: 5px;
  }

  fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
  }

  & > div {
    display: flex;

    &:last-of-type {
      margin-right: 10px;

      .bp3-button-group {
        margin-left: 5px;
      }
    }
  }

  .bp3-control-group {
    margin-right: 0.5rem;
  }

  .address-bar {
    width: ~'min(max(200px, 30vw), 420px)';
    transition: width 0.4s;

    input,
    span {
      -webkit-app-region: no-drag;
    }

    &.empty {
      width: ~'min(max(160px, 25vw), 300px)';
    }

    &:focus-within {
      span,
      input {
        border-color: @foreground-2;
      }
    }
  }

  & > .title {
    display: inline-block;
    max-width: 20vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    align-self: stretch;
    flex-shrink: 0;
    user-select: none;
    margin: auto 10px;
  }
}
