//
// Topbar
// --------------------------------------------------
.topbar {
  transition: top 0.2s ease-in-out;
  position: fixed;
  display: block;
  height: 50px;
  width: 100%;
  top: 0;
  &.nav-up {
    top: -50px;
  }
  ul.nav {
    float: left;
  }
  ul.nav > li {
    float: left;
  }
  ul.nav > li > a {
    padding-top: 15px;
    padding-bottom: 15px;
    line-height: 20px;
  }
  .dropdown-footer {
    margin: 10px;
  }
  .dropdown-header {
    font-size: 16px;
    padding: 3px 10px;
    margin-bottom: 10px;
    font-weight: 600;
    color: @text-color-soft;

    .dropdown-header-link {
      position: absolute;
      top: 2px;
      right: 10px;
      a {
        color: @info !important;
        font-size: 12px;
        font-weight: normal;
      }
    }
  }

  .dropdown-header:hover {
    color: @text-color-soft;
  }
}

.topbar-bth {
  & > a {
    background-color: darken(@primary, 5%);
    padding: 5px 10px;
    margin: 10px 2px;
    display: inline-block;
    border-radius: 2px;

    &:hover {
      background-color: darken(@primary, 10%);
    }
  }
}
.topbar-bth-div {
  background-color: darken(@primary, 5%);
  padding: 5px 10px;
  margin: 10px 2px;
  display: inline-block;
  border-radius: 2px;

  &:hover {
    background-color: darken(@primary, 10%);
  }
}

#topbar-first {
  background-color: @primary;
  z-index: 1030;
  color: white;
  .nav > li > a:hover,
  .nav > .open > a {
    background-color: darken(@primary, 10%);
  }
  .nav > .account {
    height: 50px;
    margin-left: 20px;
    &.open {
      .dropdown-toggle {
        background-color: darken(@primary, 10%);

        &:hover {
          background-color: darken(@primary, 10%);
        }
      }
    }
    img {
      margin-left: 10px;
    }
    .dropdown-toggle {
      background-color: darken(@primary, 5%);
      padding: 10px 15px 8px 15px;
      line-height: 1.1em;
      text-align: left;
      span {
        font-size: 12px;
      }
      &:hover {
        background-color: darken(@primary, 10%);
      }
    }
  }
  .topbar-brand {
    position: relative;
    z-index: 2;
  }
  .topbar-actions {
    position: relative;
    z-index: 3;
  }
  .navbar-brand {
    padding: 15px 20px;
  }
  .notifications {
    margin-right: 20px;
    margin-left: 20px;
    text-align: center;
    z-index: 1;

    @media @md {
      position: absolute;
      right: 0;
      left: 0;
    }

    &-frame {
      display: inline-flex;
    }
    .btn-group {
      position: relative;
      text-align: left;
    }
    .btn-group > a {
      padding: 5px 10px;
      margin: 10px 2px;
      display: inline-block;
      border-radius: 2px;
      text-decoration: none;
      text-align: left;
    }
    .btn-group > .label {
      position: absolute;
      top: 4px;
      right: -2px;
      border-radius: 25px;
      padding: 3px 6px 4px;
    }
    .arrow:after {
      position: absolute;
      display: block;
      width: 0;
      height: 0;
      border-color: transparent;
      border-style: solid;
      border-width: 10px;
      content: " ";
      top: 1px;
      margin-left: -10px;
      border-top-width: 0;
      border-bottom-color: #fff;
      z-index: 1035;
    }
    .arrow {
      position: absolute;
      display: block;
      width: 0;
      height: 0;
      border-color: transparent;
      border-style: solid;
      z-index: 1001;
      border-width: 11px;
      left: 50%;
      margin-left: -18px;
      border-top-width: 0;
      border-bottom-color: rgba(0, 0, 0, 0.15);
      top: -19px;
      z-index: 1035;
    }
    .dropdown-menu {
      margin-left: -148px;
      width: 350px;
      border: 0;
      ul.media-list {
        max-height: 400px;
        overflow: auto;
      }
      li {
        position: relative;
        i.approval {
          position: absolute;
          left: 2px;
          top: 36px;
          font-size: 14px;
        }
        i.accepted {
          color: #5cb85c;
        }
        i.declined {
          color: #d9534f;
        }
        a {
          color: @text-color-main;
        }
        &:hover {
          background-color: @background-color-subpage;
        }
      }
      li .media {
        position: relative;
      }
      li .media .img-space {
        position: absolute;
        top: 14px;
        left: 14px;
      }
    }
  }
  
  .dropdown-footer {
    margin: 10px 10px 5px;
  }
  a {
    color: white;
  }
  .caret {
    border-top-color: @text-color-soft;
    margin-right: 5px;
    margin-left: 5px;
  }
  .btn-group > a {
    background-color: darken(@primary, 5%);

    &:hover {
      background-color: darken(@primary, 10%);
    }
  }
  .btn-enter {
    background-color: darken(@primary, 5%);
    margin: 6px 0;
  }
  .btn-enter:hover {
    background-color: darken(@primary, 8%);
  }
  .media-list {
    a {
      color: @text-color-highlight;
      padding: 0;
    }
    li {
      color: @text-color-highlight;
      i.accepted {
        color: @info !important;
      }
      i.declined {
        color: @danger !important;
      }
    }
    li.placeholder {
      border-bottom: none;
    }
    .media .media-body {
      .label {
        padding: 0.1em 0.5em;
      }
    }
  }
  .account .user-title {
    text-align: right;
    span {
      color: @background3;
    }
  }
  .dropdown.account > a,
  .dropdown.account.open > a,
  .dropdown.account > a:hover,
  .dropdown.account.open > a:hover {
    background-color: @primary;
  }
}

#topbar-second {
  top: 50px;
  background-color: #fff;
  z-index: 1029;
  background-image: none;
  -webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
  -moz-box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #d4d4d4;
  .dropdown-menu {
    padding-top: 0;
    padding-bottom: 0;

    .divider {
      margin: 0;
    }
  }

  // Space dropdown menu
  #space-menu-dropdown,
  #search-menu-dropdown {
    width: 400px;
    .media-list {
      max-height: 400px;
      overflow: auto;
    }
    @media screen and (max-width: 768px) {
      .media-list {
        max-height: 200px;
      }
    }
    form {
      margin: 10px;
    }
    
    .search-reset {
      position: absolute;
      color: #BFBFBF;
      margin: 7px;
      top:0px;
      right: 40px;
      z-index:10;
      display: none;
      cursor: pointer;
    }
  }

  .nav > li > a {
    padding: 7px 13px 0;
    text-decoration: none;
    text-shadow: none;
    font-weight: 600;
    font-size: 10px;
    min-height: 50px;
    text-transform: uppercase;
    text-align: center;
    &:hover,
    &:active,
    &:focus {
      border-bottom: 3px solid @info;
      background-color: @background-color-secondary;
      color: @text-color-highlight;
      text-decoration: none;
    }
    i {
      font-size: 14px;
    }
    .caret {
      border-top-color: @text-color-secondary;
      margin-left: 5px;
    }
  }
    
  .nav > li.active > a {
    min-height: 47px;
  }

  .nav > li > ul > li > a {
    border-left: 0;
    background-color: #fff;
    color: @text-color-highlight;
  }

  .nav > li > ul > li > a:hover, .nav > li > ul > li > a.active {
    border-left: 0;
    background-color: @background-color-secondary;
    color: @text-color-highlight;
  }

  .nav > li > a#space-menu {
    padding-right: 13px;
    border-right: 1px solid #ededed;
  }
  .nav > li > a#search-menu {
    padding-top: 15px;
  }
  .nav > li > a:hover,
  .nav .open > a,
  .nav > li.active {
    border-bottom: 3px solid @info;
    background-color: @background-color-secondary;
    color: @text-color-highlight;
  }
  .nav > li.active > a:hover {
    border-bottom: none;
  }
  #space-menu-dropdown li > ul > li > a > .media .media-body p {
    color: @text-color-soft;
    font-size: 11px;
    margin: 0;
    font-weight: 400;
  }
}

#space-menu {
  .caret {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .topbar {
    padding-left: 0;
    padding-right: 0;
  }
}
