@import './global/variables.scss';

.flex-header {
  display: grid;
  height: 70px;
  grid-template-columns: 1.4fr 0.6fr;

  &.is-dark {
    color: $white;
    background: #21394f;

    :global(.sg-icon) {
      color: $white;

      &:hover,
      &:focus {
        color: $white;
      }
    }

    :global(.counter) {
      margin: 0 27px;
      color: $white;

      :global(.counter-bubble) {
        color: $slate;
        background: $white;
      }
    }

    .flex-header-action {
      color: $white;
    }

    .flex-header-action:hover,
    .flex-header-action:focus {
      color: $white;
      outline: none;
    }

    .flex-header-action:focus {
      outline: 1px dashed white;
    }

    .flex-header-title {
      h3 {
        color: $white;
      }
    }

    .flex-header-tab {
      border-right: 1px solid $header-tabs-border-color;
      border-left: 1px solid $header-tabs-border-color;
      color: $slate-60;
      opacity: 0.6;
    }

    .flex-header-tab:hover,
    .flex-header-tab:focus {
      color: $white;
      outline: none;
      opacity: 1;
    }

    .flex-header-tab:only-of-type {
      border-right: 1px solid $header-tabs-border-color;
      border-left: 1px solid $header-tabs-border-color;
    }

    .flex-header-tab.is-active {
      color: $white;
      background: $header-tabs-hover;
      opacity: 1;
    }
  }

  &.is-light {
    color: $slate;
    background-color: $slate-05;
    border-bottom: 1px solid $slate-20;

    :global(.counter) {
      margin: 0 27px;
      color: $slate;

      :global(.counter-bubble) {
        color: $white;
        background: $slate;
      }
    }

    .flex-header-action {
      color: $slate;
    }

    .flex-header-action:hover {
      color: $slate;
    }

    .flex-header-action:focus {
      color: $sg-blue;
    }

    .flex-header-title::before {
      border-left: 1px solid $slate-20;
    }

    .flex-header-tab {
      padding: 0 $scale-base-up-06;
      text-transform: none;
      letter-spacing: 0;
      border-right: 0;
      border-bottom: 1px solid transparent;
      border-left: 0;
      opacity: 1;
    }

    .flex-header-tab:hover {
      color: $slate;
    }

    .flex-header-tab.is-active,
    .flex-header-tab:focus {
      color: $sg-blue;
      background-color: transparent;
      border-bottom-color: $sg-blue;
      box-shadow: 0 1px 0 $sg-blue;
      outline: none;
    }

    .counter {
      color: $slate;
    }

    .counter-bubble {
      color: $white;
      background-color: $slate;
    }
  }
}

.flex-header > div {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
}

.flex-header-right {
  -ms-flex-pack: end;
  justify-content: flex-end;
  min-width: 400px;
  padding-right: 27px;
}

.flex-header-action {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  cursor: pointer;

  :global(.sg-icon) {
    font-size: 20px;
  }
}

.flex-header-title {
  position: relative;
  padding: 0 27px;

  &:before {
    position: absolute;
    top: -27px;
    left: 0;
    display: block;
    height: 70px;
    content: '';
  }

  h3 {
    margin: 0;
  }

  :global(.sg-icon) {
    margin-left: 5px;
    font-size: 13px;
  }
}

.flex-header-tabs {
  display: -ms-flexbox;
  display: flex;
  margin-right: 27px;
}

.flex-header-tab {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  height: 70px;
  padding: 0 27px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.75px;
  text-transform: uppercase;
  cursor: pointer;

  &:last-of-type {
    border-left: 0;
  }

  :global(i) {
    position: relative;
    top: -1px;
    margin-right: 13px;
  }
}
