/*
 * This file is part of the Access to Memory (AtoM) software.
 *
 * Access to Memory (AtoM) is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Access to Memory (AtoM) is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Access to Memory (AtoM).  If not, see <http://www.gnu.org/licenses/>.
 */

@topBarBackgroundColor: #ccc;
@topBarButtonHoverColor: @orange;


#top-bar {
  height: 40px;
  background-color: @topBarBackgroundColor;
}

header #logo {
  display: block;
  float: left;
  margin: 0 20px 0 8px;
}

#site-name {
  margin: 0;
  float: left;
  margin: 6px 0 0 4px;
  padding-right: 35px;
  a {
    color: @white;
  }
}

#site-slogan {
  background-color: @topBarBackgroundColor;
  background-color: rgba(22, 21, 20, .75);
  height: 24px;
  color: @white;
  span {
    line-height: 24px;
  }
  .text-overflow();
}

// Shared class for buttons and dropdowns elements

.top-item {
  display: block;
  float: right;
  margin: 7px 11px 0 0;
  background-color: @black;
  color: @white;
  .border-radius(4px);
  font-size: 13px;
  line-height: 14px;
  text-decoration: none;
  border: none;
  outline: none;
}

.top-dropdown {
  cursor: pointer; // no href
}

.top-dropdown,
button.top-dropdown:link,
button.top-dropdown:visited,
button.top-dropdown:active {
  padding: 5px 29px 6px 17px;
  background-image: url(../../images/gray-arrow.png);
  background-position: right center;
  background-repeat: no-repeat;
  color: lighten(@gray, 40%);
}

.open > button.top-dropdown,
button.top-dropdown:hover,
button.top-dropdown:focus {
  background-color: @topBarButtonHoverColor !important;
  background-image: url(../../images/white-arrow.png);
  color: @white;
}

// Dropdown container

nav > div {
  // Positionate nested dropdowns
  position: relative;
}

nav > div {
  float: right;
  height: 50px;
}

.open > .top-dropdown-container {
  display: block;
}

.top-dropdown-container {

  .hide();
  position: absolute;
  top: 37px;
  right: 0px;
  z-index: @zindexPopover;
  min-width: 240px;
  @shadow: 0 2px 2px rgba(25, 25, 25, .25);
  .box-shadow(@shadow);

  .top-dropdown-arrow {
    height: 13px;
    .arrow {
      width: 30px;
      height: 20px;
      position: absolute;
      right: 10px;
      background-image: url('../../images/dropdown-arrow.png');
      background-repeat: no-repeat;
      background-position: center -25px;
    }
  }

  .top-dropdown-header {
    background-color: @white;
    padding: 0 10px;
    border-bottom: 1px solid @grayLighter;

    h2 {
      display: inline-block;
      font-size: 16px;
      margin: 0;
    }
  }

  .top-dropdown-body {

    background-color: @graySilver;
    background-color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    .clearfix();

    ul {
      list-style: none;
      margin-bottom: 0;
      margin-left: 0;
      a {
        display: block;
        padding: 4px 8px;
        line-height: 24px;
        // border-bottom: 1px solid rgb(220, 220, 220);
        &:hover {
          color: @topBarButtonHoverColor;
        }
      }
      // li:last-child a {
      //     border-bottom: none;
      // }
    }

  }

  .top-dropdown-bottom {
    background-color: @white;
    height: 4px;
  }

}

.top-dropdown-container-right,
.top-dropdown-container-right .arrow {
  right: auto;
  left: 0px;
}

// Menu customizations

#browse-menu {
  float: left;
  > button {
    .border-radius(4px);
    background-color: lighten(@grayDark, 5%);
  }
}

// Institutional block dropdown menu css.
// Institutional block present when 'Enable institutional scoping' is on.
#repo-holdings #browse-menu {
  float: none;
  width: 100%;
  > button {
    width: 100%;
    float: none;
    .border-radius(4px);
    background-color: lighten(@grayDark, 5%);
  }
}

#user-menu {
  > button {
    margin-left: 12px;
  }
  form {
    background: none;
    padding: 10px 20px;
    margin-bottom: 4px;
    input {
      .input-block-level();
    }
  }
}

// Hide global search/replace node temporary

#node_globalReplace {
    .hide();
}

// Icons

#quick-links-menu,
#language-menu,
#admin-menu,
#import-menu,
#manage-menu,
#add-menu,
#clipboard-menu {

  @side: 40px;

  // As text is hidden
  cursor: pointer;

  > button {
    .border-radius(0);
  }

  // Cancel margin and padding
  > button,
  > button:before {
    margin: 0;
    padding: 0;
    line-height: @side;
    width: 35px;
    height: 40px;
    // .square(@side);
  }

  > button {
    .hide-text();
    position: relative;
  }

  // Icons
  > button:before {
    font-family: 'FontAwesome';
    font-weight: normal;
    font-style: normal;
    text-align: center;
    color: @grayLighter;
    font-size: @side/2;
    position: absolute;
    top: 0;
    left: 0;
  }

  // Hover effect
  &.open,
  > button:hover,
  > button:focus {
    background-color: @topBarButtonHoverColor;
  }

  &.open > button:before,
  > button:hover:before {
    color: @white;
  }

}

// Font-Awesome icons

#admin-menu  {
  > button:before {
    content: "\f085";
  }
}

#add-menu {
  > button:before {
    content: "\f055";
  }
}

#manage-menu {
  > button:before {
    content: "\f14b";
  }
}

#import-menu {
  > button:before {
    content: "\f019";
  }
}

#language-menu {
  > button:before {
    content: "\f0ac";
  }
}

#quick-links-menu {
  > button:before {
    content: "\f05a";
  }
  
  
  > button > span {
    background-color: @blue;
    color: @black;
    position: absolute;
    top: 5px;
    padding-top: 10px;
    font-family: "Open Sans Regular", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    border-radius: 10px;
    height: 10px;
    width: 20px;
  }

  .top-dropdown-header > span {
    display: block;
    color: @grayLight;
    margin: -6px 0 5px 0;
  }
}


#clipboard-menu {
  > button:before {
    content: "\f0c6";
  }

  > button > span {
    background-color: @moleson;
    color: @white;
    position: absolute;
    top: 5px;
    padding-top: 10px;
    font-family: "Open Sans Regular", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    border-radius: 10px;
    height: 10px;
    width: 20px;
  }

  .top-dropdown-header > span {
    display: block;
    color: @grayLight;
    margin: -6px 0 5px 0;
  }
}

// Top search bar

#search-bar {
  white-space: nowrap;
  position: relative;
  > div {
    // Positionate nested dropdowns
    position: relative;
  }
}

#search-bar > div {
  float: left;
}

#search-bar #search-form-wrapper {

  h2 {
    .hide();
  }

  // Use form to margin top
  // And cancel default margin bottom
  form {
    position: relative; // Positionate search autocomplete
    margin: 12px 0 0 0;
    width: 300px;
  }

  input {

    // Reset border
    border: none;

    // See .top-item
    background-color: @grayDark;
    .border-radius(4px);
    color: lighten(@gray, 40%);

    // Overrides defaults for [type=text]
    // Some of this default like box-model are set by AtoM, not only Bootstrap
    width: 100%;
    min-height: 0;
    margin-bottom: 0;
    // .box-sizing(content-box);

    // Define height (box-model is content-box here)
    padding: 0 8px;
    height: 25px;

    &:focus {
      background-color: @graySilver;
      color: @gray;
      .placeholder(@grayLight);
    }

  }

  button {
    display: block;
    width: 25px;
    height: 25px;
    right: 0px;
    position: absolute;
    top: 0px;
    background-color: white;
    color: white;
    margin-top: 0px;
    font-size: 1.1em;
    border: none;
    .border-radius(0 4px 4px 0);

    &:before {
      font-family: FontAwesome;
      content:"\f002";
    }

    span {
      .hide();
    }
  }
}

//feedback button

#feedback-img {
  position: fixed;
  width: 70px;
  right: 0;
  top: 17%;
}
#feedback-img-mobile {
  position: fixed;
  opacity: 30%;
  width: 60px;
  right: 1%;
  top: 0;
}
#feedback-link:hover #feedback-img {
  //fill: #B550AC;
}

//browse menu

.bcu-browse-link{
  vertical-align: top;
}

.bcu-browse-icon{
  color: #555555;
  font-size: 20px;
  line-height: 40px;
  width: 35px;
  height: 40px;
  text-align: center;
  margin-top: 3px;
}
.bcu-browse-icon:hover{
  color: #0099b2;
}

//header-nav
#header-nav-container {
  width: 520px;
  float: right;
  margin-right: 4.5%;
}

//layout logo and title
#logo-and-name {
  width: 220px;
}
#header-title {
  margin-left: 50px;
}



// Responsive design

@media (min-width: 1200px) {}

@media (min-width: 979px) {
  //feedback
  #feedback-link-mobile {
  display: none;
  }
  #feedback-img-mobile {
  display: none;
  }
}

@media (max-width: 979px) {

  // Increase height of the bar
  #top-bar {
    height: 150px;
  }

  // Hide buttons
  nav {
    clear: both;
  }

  // Fist row: logo
  #logo {
    float: none;
    text-align: center;
  }

  // Second row: search bar
  #search-bar {

    .clearfix();
    margin: 0 auto;
    padding: 0 20px;
    clear: both;

    #search-form-wrapper {
      width: 80%;
      float: left;
      form {
        width: auto;
        margin-right: 0;
      }
      input {
        .input-block-level();
        min-height: 25px;
      }
    }

    #browse-menu {
      width: 20%;
      > a {
        .box-sizing(border-box);
        width: 100%;
        margin-right: 0px;
        float: left;
      }
    }

  }

  //header-nav
  #header-nav-container {
    width: 290px;
  }
  //feedback
  #feedback-link {
    display: none;
  }
  #feedback-img {
    display: none;
  }
}

@media (max-width: 767px) {

  #top-bar {
    margin: 0 -20px;
    height: auto;
    padding-bottom: 10px;
  }

  #site-name {
    float: none;
    text-align: center;
    margin-top: 0;
  }

  #site-slogan {
    margin: 0 -20px;
    padding: 0 20px;
  }

  #wrapper {
    background-image: none;
  }

  nav {
    .top-dropdown-container {
      right: auto;
      left: 0;
      .arrow {
        right: auto;
        left: 10px;
      }
    }
  }
  //header-nav
  #header-nav-container {
    width: 100%;
  }
}

@media (max-width: 480px) {

  #browse-menu {
    width: 3%;
    &> a {
      text-indent: -9999px;
    }
  }

  nav {
    clear: both;
  }

  #search-bar {
    margin-bottom: 10px;
  }

  nav > div {
    &.open {
      float: none;
      clear: both;
    }
    .top-dropdown-container {
      clear: both;
      float: none;
      left: 0; right: 0;
    }
  }
  //header-nav
  #header-nav-container {
    width: 100%;
  }

}
