/* Copyright 2017 Apinf Oy
This file is covered by the EUPL license.
You may obtain a copy of the licence at
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 */

/* Bootstrap */
@import "/apinf_packages/core/client/style/bootstrap-variables.less";

/* Tablets/phone both portrait and landscape */
@media only screen and (max-width: 768px) {

  .mobile-links-only {
    display: inline-block !important;
    float: none !important;
  }

  .nav-bar-right-links {
    display: none !important;
    float: none !important;
  }

  .hide-link {
    display: inline-block !important;
    float: none !important;
  }

  .main-navigation {
    height: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;

    .navbar-header {
      display: inline-block;
      padding-left: 2em !important;
      max-width: 100px;
    }

    .navbar-brand {
      width: 100px !important;
    }

    #main-navbar {
      list-style: none;
      margin: 0;
      padding: 0;
      white-space: nowrap;
      overflow-x: scroll;
      overflow-y: hidden;
      width: 100%;

      > li {
        display: table-cell;
        vertical-align: middle;

        > a {
          display: block;
          text-decoration: none;
          font-size: 1.2em;

          &:hover,
          &:active {
            text-decoration: none;
            color: #fff;
          }

          &:visited {
            color: #fff;
          }
        }
      }

      .main-links {
        float: none !important;
      }
    }
  }

  #user-menu {
    margin-right: 0;
    margin-left: 0;
    display: inline-block;
    float: right;

    > li {
      display: table-cell;
      vertical-align: middle;

      .navbar-login,
      .dropdown-toggle {
        > i {
          display: none;
        }
      }

      > a {
        text-decoration: none;
        font-size: 1em;
      }
    }

    .dropdown-menu {
      position: fixed;
      top: 3em;
      width: 100%;
      background-color: #fff;
      margin-top: 1.9em;
      font-size: 1.2em;
      text-align: center;

      > li {
        padding-bottom: 0.5em;
        padding-top: 0.5em;
      }
    }
  }

  .sign-in-user {
    display: none;
  }
}

/* Navbar */
.main-navigation {
  height: 50px;

  .mobile-links-only {
    display: inherit;
    float: right;
  }

  .hide-link {
    display: none;
  }

  .nav-bar-right-links i {
    color: rgba(255, 255, 255, 0.9);
  }

  #main-navbar {
    margin: 0 auto;
    display: block;
    text-align: center;

    .main-links {
      display: inline-block;
      float: left;
      padding-left: 1px;
      padding-right: 1px;
    }
  }

  background-color: #2655C9;
  z-index: 9;
  margin-bottom: 0;
  border: none;
  border-radius: 0;
  top: 0;

  .navbar-header {
    padding-left: 1em;
    margin-right: 1em;
  }

  .navbar-brand {
    background: center / contain no-repeat;
    width: 90px;
  }

  .navbar-toggle {
    margin: 0.18em 0.18em 0.06em 0;
  }

  .navbar-toggle > .icon-bar {
    background-color: #fff;
  }

  .main-navigation .navbar-toggle:hover, .navbar-toggle:focus {
    background-color: darken(@brand-primary, 5%);
  }

  .project-name {
    padding-top: 1em;
    .project-name-link {
      font-size: 1.3em;
      color: #FFF;
      cursor: pointer;
    }
    .project-name-link:hover,
    .project-name-link:focus,
    .project-name-link:active {
      color: #FFF;
      text-decoration: none;
    }
  }
}

@media (min-width: 768px) {
  .navbar-nav {
    float: inherit !important;
  }
}

/* Bootstrap navbar overriding */
.navbar-default .navbar-nav > .main-links {
  padding-top: 11px;
  padding-bottom: 11px;
}

.navbar-default .navbar-nav > li > a {
  color: rgba(255,255,255,0.9);
  font-size: 1.4rem;
  padding-top: 4px;
  padding-bottom: 4px;
  letter-spacing: 0.3px;
}

// main links
.navbar-default .navbar-nav > .main-links > a:hover,
.navbar-default .navbar-nav > .main-links > a:active {
  border: none;
  color: #fff;
  background-color: #284DB2;
  border-radius: 4px;
  text-decoration: none;
}

.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
  border: none;
  color: #fff;
  background-color: #284DB2;
  border-radius: 4px;
  text-decoration: none;
}

.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
  border: none;
  color: #fff;
  background-color: #284DB2;
  border-radius: 4px;
  text-decoration: none;
}

.navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus {
  color: #fff !important;
}

// right icons
.navbar-default .navbar-nav > .nav-bar-right-links > a:hover,
.navbar-default .navbar-nav > .nav-bar-right-links > a:active {
  border: none;
  color: #fff;
  background-color: transparent;
  border-radius: 4px;
  text-decoration: none;
}

.navbar-default .navbar-nav > .nav-bar-right-links > a:hover i,
.navbar-default .navbar-nav > .nav-bar-right-links > a:active i {
  color: #fff;
}

.navbar-default .navbar-nav > .nav-bar-right-links .active > a,
.navbar-default .navbar-nav > .nav-bar-right-links .active > a:hover,
.navbar-default .navbar-nav > .nav-bar-right-links .active > a:focus {
  border: none;
  color: #fff;
  background-color: transparent;
  border-radius: 4px;
  text-decoration: none;
}

.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
  border: none;
  color: #fff !important;
  background-color: transparent !important;
  border-radius: 4px;
  text-decoration: none;
}

.navbar-default .navbar-nav > .open > a i,
.navbar-default .navbar-nav > .open > a i:hover,
.navbar-default .navbar-nav > .open > a i:focus {
  color: #fff !important;
}

navbar-nav > li > a {
  padding-top: 0;
  padding-bottom: 0;
  line-height: 42px;
}

.dropdown-menu > li > a {
  padding-left: 25px;
  padding-right: 25px;
  padding-bottom: 10px;
  padding-top: 10px;
  color: #4c6072;
}

.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus {
  color: #37474F;
  text-decoration: none;
  background-color: #ecf3f8;
  border-radius: 0;
}

.navbar-nav > li > .dropdown-menu {
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}

#signup-button {
  background-color: #19b934;
  border-color: #19b934;
  border-radius: 4px;
}

.sign-in-user {
  color: #6d859e;
  text-overflow: ellipsis;
  overflow: hidden;
  display: block;
  max-width: 220px;
  padding-left: 25px;
  padding-right: 25px;
}
