/*
 * Copyright (c) 2018 Eclipse Foundation, Inc.
 * 
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 * 
 * Contributors:
 *   Christopher Guindon <chris.guindon@eclipse-foundation.org>
 * 
 * SPDX-License-Identifier: EPL-2.0
*/

// Default main-menu styles

// Mobile menu (collapse)
@media (max-width: @screen-xs-max) {
  #main-menu-wrapper{
    padding:0;
    margin:0;
  }

  #main-menu {
    background: @mobile-menu-background;
    margin-bottom: 0;
    .navbar-header {
      padding-top: 15px;
      padding-bottom: 15px;
    }

    .navbar-brand {
      height: auto;
      padding: 0;
      padding-left: 15px;
    }

    #navbar-main-menu {
      float:none;
    }

    &.navbar {
      border: 0;
      border-bottom: 1px solid @gray-mid-light;
    }

    .navbar-toggle {
      margin: 0;
      padding: 10px 15px 10px 0;
      .icon-bar {
        background: @navbar-toggle-icon-background;
        height: 3px;
      }
    }

    .nav {
      margin: 0;
      padding: 0;
      background: @mobile-menu-nav-background;
      & > li {
        &.open {
          & .dropdown-toggle, & a.dropdown-toggle {
            color: @mobile-menu-open-active-color;
            background: @mobile-menu-open-active-background;
          }
        }

        & > a {
          color: @mobile-menu-color;
          text-transform: @main-menu-link-transform;
          padding: @mobile-main-menu-link-padding;
          border-bottom: @mobile-main-menu-link-border-bottom;
        }

        .dropdown-menu {
          background: @mobile-menu-dropdown-menu-background;
          padding: 0;
          border-radius:0;
          border-bottom:@mobile-menu-dropdown-menu-border-bottom;
          > li {
            &.active {
              a {
                &:link , &:visited {
                  background: @mobile-menu-dropdown-menu-active-background;
                  color: @mobile-menu-dropdown-menu-active-color;
                }

                &:hover , &:focus {
                  color: @mobile-menu-dropdown-menu-active-hover;
                  background: @mobile-menu-dropdown-menu-active-hover-background;
                }
              }
            }

            > a {
              padding: @mobile-main-menu-link-padding;
              color: @mobile-menu-dropdown-menu-color;
              &:hover , &:focus {
                color: @mobile-menu-dropdown-menu-hover;
                background: @mobile-menu-dropdown-menu-hover-background;
              }
            }
          }
        }
      }
      & > li.main-menu-search {
        .dropdown-toggle {
          display:none;
        }
        .dropdown-menu {
          position: static;
          float: none;
          width: auto;
          margin-top: 0;
          background-color: transparent;
          border: 0;
          box-shadow: none;
          display:block;
          p {
            color:@mobile-menu-color;
          }
          .yamm-content {
            padding:15px;
          }
          .gsc-input {
            background-color:#fff;
          }
          .gsc-input-box {
            border:none;
          }
        }
      }
    }
  }
}

// Use fluid container for xs, sm and md screens.
@media (max-width: @screen-md-max) {
  #header-wrapper, .toolbar-container-wrapper, main, #breadcrumb, .region-breadcrumb{
    .container{
      width:auto;
    }
  }
}

// Default menu (not-collapsed)
@media (min-width: @screen-sm-min) {
  #main-menu {
    font-size: @mobile-main-menu-link-size;
    margin-bottom: 5px;
    ul li {
      text-transform: @main-menu-link-transform;
    }

    .dropdown {
      li {
        text-transform: none;
      }
    }

    li {
      a {
        margin-right: 0px;
        color: @main-menu-link-color;
        &:hover , &:active {
          color: @main-menu-link-active-color;
        }
      }
    }

   li.dropdown .dropdown-menu {
      left: auto;
      right: auto;
    }

    li.dropdown.eclipse-more .dropdown-menu {
      width: 600px;
      right: initial;
      left: 0;
    }

    .navbar-right li.dropdown:last-child .dropdown-menu {
      left: initial;
      right: 0;
    }

    .navbar-right li.dropdown.eclipse-more .dropdown-menu {
      width: 600px;
    }

    .dropdown-menu {
      a {
        color: @main-menu-dropdown-link-color;
        &:hover {
          color: @main-menu-dropdown-link-hover-color;
        }
        &:active {
          color: @main-menu-dropdown-link-active-color;
        }
      }
      .yamm-content {
        a {
          margin: 0;
        }
      }
    }
  }
}

// Menu on medium screens and up
@media (min-width: @screen-md-min) {
  #main-menu {
    .dropdown-menu {
      max-width: 630px;
      li {
        padding-bottom: 2px;
      }
    }
    font-size: @main-menu-link-size;
  }
}

// Default menu styles (Overrides and compliment styles previously set)
#main-menu {
  margin-bottom:0;
  li {
    padding-bottom: 0;
  }
 
  a {
    font-weight: 400;
    &:active, &:focus {
      color: @main-menu-link-active-color;
    }
  }

  .nav {
    > li {
      > a {
        &:hover, &:focus {
          background-color:@main-menu-link-hover-bg-color;
        }
      } 
    }

    .open {
      a {
        background-color:@main-menu-link-hover-bg-color;
        &:hover, &:focus {
          background-color:@main-menu-link-hover-bg-color;
        }
      }
    }
  }
}

.dropdown-toggle:hover {
  cursor: pointer;
}

// Left nav from Nav()
.ul-left-nav {
  padding-left: 0;
  margin-left: 0;

  > li {
    list-style: none;
    margin-bottom: 0.45em;

    &.active a {
      font-weight: 600;
    }

    &.separator , &.about {
      padding-left: 0px;
      font-weight: bold;
      img {
        position: absolute;
        top: 6px;
      }
    }

    &.separator {
      border-top: 1px solid #D4D4DD;
      padding-top: 8px;
      a {
        font-weight: 700;
      }
    }

    &.separator:first-child {
      border-top: none;
    }

    > a {
      color: #545454;
      font-weight: 400;
      &:hover {
        color: @main-menu-link-hover-color;
      }
    }
  }
}

// Set a max-high on mobile logo
.logo-eclipse-default-mobile{
  max-width:@mobile-menu-logo-max-width;
}
@media (min-width: @screen-sm-min) {
  .alternate-layout {
    #main-menu {
      font-size: @alternate-mobile-main-menu-link-size;
      ul li {
        text-transform: @alternate-main-menu-link-transform;
      }
      li {
        a {
          color: @alternate-main-menu-link-color;
          &:hover , &:active {
            color: @alternate-main-menu-link-active-color;
          }
        }
      }
      
    }
  }
}

@media (min-width: @screen-md-min) {
  .alternate-layout {
    #main-menu {
      font-size: @alternate-main-menu-link-size;
    }
  }
}

@media (max-width: @screen-xs-max) {
  .alternate-layout {
    #main-menu {
      background: @alternate-mobile-menu-background;
    }
  }
}


