/*
 *  Application Header
 *
 */
header {
  &.navbar-empty {
    background: #FFF;
    border-bottom: 1px solid #EEE;

    .center-logo {
      margin: 8px 0;
      text-align: center;
    }
  }

  &.navbar-gitlab {
    z-index: 100;
    margin-bottom: 0;
    min-height: $header-height;
    border: none;
    width: 100%;

    .container {
      background: #FFF;
      width: 100% !important;
      padding: 0;
      filter: none;

      .nav > li > a {
        color: #888;
        font-size: 14px;
        padding: 0;
        background-color: #f5f5f5;
        margin: ($header-height - 28) / 2 0;
        margin-left: 10px;
        border-radius: 40px;
        height: 28px;
        width: 28px;
        line-height: 28px;
        text-align: center;

        &:hover, &:focus, &:active {
          background-color: #EEE;
        }
      }

      .navbar-toggle {
        color: #666;
        margin: 0;
        border-radius: 0;
        position: absolute;
        right: 2px;

        &:hover {
          background-color: #EEE;
        }
      }
    }
  }

  .header-logo {
    border-bottom: 1px solid transparent;
    float: left;
    height: $header-height;
    width: $sidebar_width;

    a {
      float: left;
      height: $header-height;
      width: 100%;
      padding: ($header-height - 36 ) / 2 8px;

      h3 {
        width: 158px;
        float: left;
        margin: 0;
        margin-left: 14px;
        font-size: 18px;
        line-height: $header-height - 14;
        font-weight: normal;
      }

      img {
        width: 36px;
        height: 36px;
        float: left;
      }
    }

    &:hover {
      background-color: #EEE;
    }
  }

  .header-content {
    border-bottom: 1px solid #EEE;
    padding-right: 35px;
    height: $header-height;

    .title {
      position: relative;
      float: left;
      margin: 0;
      margin-left: 35px;
      font-size: 18px;
      line-height: $header-height;
      font-weight: bold;
      color: #444;

      @include str-truncated(37%);

      a {
        color: #444;
        &:hover {
          text-decoration: underline;
        }
      }
    }
  }

  .search {
    margin-right: 10px;
    margin-left: 10px;
    margin-top: ($header-height - 28) / 2;

    form {
      margin: 0;
      padding: 0;
    }

    .search-input {
      width: 220px;
      background-image: image-url("icon-search.png");
      background-repeat: no-repeat;
      background-position: 10px;
      height: inherit;
      padding: 4px 6px;
      padding-left: 25px;
      font-size: 13px;
      background-color: #f5f5f5;
      border-color: #f5f5f5;

      &:focus {
        @include box-shadow(none);
        outline: none;
        border-color: #DDD;
        background-color: #FFF;
      }
    }
  }
}

@mixin collapsed-header {
  .header-logo {
    width: $sidebar_collapsed_width;

    h3 {
      display: none;
    }
  }

  .header-content {
    .title {
      margin-left: 30px;
    }
  }
}

@media (max-width: $screen-md-max) {
  header .container .title {
    max-width: 43%;
  }

  .header-collapsed, .header-expanded {
    @include collapsed-header;
  }
}

@media(min-width: $screen-md-max) {
  .header-collapsed {
    @include collapsed-header;
  }

  .header-expanded {
  }
}

@media (max-width: $screen-xs-max) {
  header .container {
    font-size: 18px;

    .title {
      max-width: 70%;
    }

    .navbar-nav {
      margin: 0px;
      float: none !important;

      .visible-xs, .visable-sm {
        display: table-cell !important;
      }
    }

    li {
      display: table-cell;
      width: 1%;
    }
  }
}