//
// Navigation
// ==============================




// Common
// ------------------------------

.app-nav {
	&:extend(.u-clearfix all);
	list-style: none;
	margin: 0;
	padding: 0;
	display: inline-block;

	> li {
		float: left;

		&.right {
			float: right;
		}
	}
	> li > a {
		.transition( color 180ms );
		display: block;
		outline: none;
		text-decoration: none;
	}
}
.app-nav--left,
.app-nav--right{
	display: table-cell;
}
.app-nav--left {
/*	float: left;*/
}
.app-nav--right {
/*	float: right;
*/
	// Alignment Hack
	// align last nav items to the right of the container
	// first item alignment declared separately for primary/secondary - see below
	li:last-child > a {
		padding-right: 0;
	}
}

// fade out the hovered item's siblings
.app-nav--primary:hover {
	// color: fade(@primary-navbar-color, 66%);
}
.app-nav--secondary:hover {
	// color: fade(@secondary-navbar-color, 66%);
}




// Primary
// ------------------------------

.primary-header{
	.primary-header-tools{
		display: block;
		width: 100%;
		/*height: 40px;*/
		padding: 5px 0;
		background-color: @admin-menu-logo-bg;
		border-bottom: 1px solid #ccc;
		.octicon{
			color: #666;
		}

		> div.primary-header-container{
			margin: 0 !important;
			padding: 0 40px !important;

		}

		.app-nav--right{
			display: inlin-block;
			float: right;
			text-align: right;
			li.primary-navbar__item{
				float: initial;
				display: inline-block;
				line-height: 30px;
				> a{
					padding-top: 5px;
					padding-bottom: 5px;
				}
			}
		}
	}
	.primary-navbar__logoContainer{
		float: left;
		max-height: 41px;
		img {
			max-height: 41px;
			max-width: 240px;
		}
	}
	.primary-navbar__currentUser {
		display: inline-block;
	    vertical-align: middle;
	    float: right;
	    line-height: 40px;
	    padding-right: 30px;
	    margin-right: 20px;
	    position: relative;
	    b {
	    	margin-right: 15px;
	    	font-weight: normal;
	    	color: @language-btn-active-bg;
	    }
	    a{
	    	color: @admin-menu-section-active-text-color;
	    	text-decoration: underline;
	    	font-weight: bolder;
	    }
	    &:after{
	    	content: '';
	    	display: block;
	    	position: absolute;
	    	top: 10px;
	    	right: 0;
		    background: #ccc;
		    height: 20px;
		    width: 1px;
	    }
	}
	.primary-navbar__container {
		text-align: center;
		.primary-navbar__logo{
			border: 0;
			max-height: 41px;
			display: inline-block;
    		margin: 25px 0 20px 0;
			img {
				text-align: center;
			    margin: 0 auto;
			    display: block;
			}
		}
	}
}

.primary-navbar {
	background-color: @primary-navbar-bg;
	color: @primary-navbar-color;
	padding-bottom: .8em;
	padding-top: .8em;
	display: table;
	width: 100%;
}

.primary-navbar__item {
	position: relative;

	// adds a divider between nav items
	&::before {
/*		.translate(0,-50%);
		background-color: rgba(255, 255, 255, 0.2);
		content: " ";
		left: 0;
		height: 1em;
		position: absolute;
		top: 50%;
		width: 1px;
		z-index: 1;*/
	}

	// hide the divider where appropriate
	&:first-child::before,
	&.right:last-child::before {
		display: none;
	}
}

// anchors and Link component
.primary-navbar__link {
	border-radius: .3em;
	color: inherit;
	padding: @primary-navbar-padding-vertical @primary-navbar-padding-horizontal;
	position: relative;

	&:hover {
		// background-color: @primary-navbar-hover-bg;
		// color: @primary-navbar-hover-color;
	}
}

// hide the active item's divider and, using box-shadow, mask the one
// to its right
.primary-navbar__item--active {
	box-shadow: 2px 0 0 @primary-navbar-bg;
	z-index: 2;

	&::before {
		display: none;
	}

	.primary-navbar__link {
		background-color: @primary-navbar-active-bg;
		color: @primary-navbar-active-color;
	}
}

// brand specific styles
.primary-navbar__brand {
	box-shadow: none;

	.primary-navbar__link {
		background-color: transparent;
		padding-left: 0;
	}
}




// Secondary
// ------------------------------

.secondary-navbar {
	background-color: @secondary-navbar-bg;
	border-bottom: 1px solid darken(@secondary-navbar-bg, 10%);
	color: @secondary-navbar-color;

	li > a {
		color: inherit;
		padding: @secondary-navbar-padding-vertical @secondary-navbar-padding-horizontal;
		position: relative;

		&:hover {
			// color: @secondary-navbar-hover-color;
		}
	}
	.active > a {

		&::before,
		&::after {
			.square(0);
			border: @secondary-navbar-arrow-size solid transparent;
			border-bottom-width: 0;
			content: "";
			margin-left: -@secondary-navbar-arrow-size;
			position: absolute;
			left: 50%;
		}
		&::before {
			border-top-color: #ccc;
			bottom: -(@secondary-navbar-arrow-size + 1);
		}
		&::after {
			border-top-color: @secondary-navbar-bg;
			bottom: -@secondary-navbar-arrow-size;
		}
		&, &:hover {
			background-color: @secondary-navbar-active-bg;
			color: @secondary-navbar-active-color;
		}
	}

	// align first nav items to the left of the container
	// 1. remove right padding to fix the center alignment of the active arrow
	// 2. recover the missing right padding using margin
	li:first-child > a {
		margin-right: @secondary-navbar-padding-horizontal; // 2
		padding-left: 0;
		padding-right: 0; // 1
	}
}




// Mobile
// ------------------------------

.MobileNavigation {}


// Common

.MobileNavigation__icon {}


// Bar

.MobileNavigation__bar--placeholder {
	height: @mobile-nav-bar-height;
}
.MobileNavigation__bar {
	background-color: @app-primary;
	color: white;
	line-height: @mobile-nav-bar-height;
	position: fixed;
	z-index: @mobile-nav-zindex-bar;
	width: 100%;
}
.MobileNavigation__bar__button {
	background: none;
	border: none;
	display: inline-block;
	color: white;
	padding: 0 @mobile-nav-bar-padding-horizontal;

	&:hover,
	&:focus {
		color: white;
		outline: none;
	}
	&:active {
		opacity: .75;
	}
}
.MobileNavigation__bar__button--signout,
.MobileNavigation__bar__button--accountSetting {
	float: right;
}

.MobileNavigation__bar__icon {
}
.MobileNavigation__bar__label {
	font-size: @font-size-lg;
	// font-weight: 300;
}


// Blockout

.MobileNavigation__blockout {
	.transition( opacity 160ms ease-out 100ms );
	background: fade(@body-bg, 60%);
	height: 100%;
	left: 0;
	opacity: 0;
	opacity: 1;
	overflow: hidden;
	position: fixed;
	top: @mobile-nav-bar-height;
	width: 100%;
	z-index: @mobile-nav-zindex-blockout;
}


// Menu

.MobileNavigation__menu {
	background: @mobile-nav-menu-bg;
	border-radius: @border-radius-base;
	bottom: 0;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
	left: 0;
	margin: @grid-gutter-width;
	max-width: 375 - (@grid-gutter-width * 2); // arbitrary: iPhone6 portrait
	overflow: hidden;
	position: fixed;
	right: 0;
	top: @mobile-nav-bar-height;
	z-index: @mobile-nav-zindex-menu;
}
.MobileNavigation__menu-enter {
	.animation-name( mobileNavMenuEnter );
	.animation-duration( 260ms );
	.animation-timing-function( cubic-bezier(0.230, 1.000, 0.320, 1.000) ); // easeOutQuint
}
.MobileNavigation__menu-leave {
	.animation-duration( 200ms );
	.animation-name( mobileNavMenuLeave );
}

.MobileNavigation__icon {
	display: inline-block;
	min-height: 1px;
	text-align: center;
	width: 32px;
}


// Sections

.MobileNavigation__sections {
	box-shadow: inset @mobile-nav-menu-border-width 0 0 @mobile-nav-menu-border-color;
	height: 100%;
	overflow-x: hidden;
	overflow-y: auto;
	-ms-overflow-style: -ms-autohiding-scrollbar;
	-webkit-overflow-scrolling: touch;
	// padding: @mobile-nav-padding-vertical 0;
}
.MobileNavigation__section {
	padding: @mobile-nav-menu-padding-vertical @mobile-nav-menu-padding-horizontal  @mobile-nav-menu-padding-vertical 0;

	&.is-active {
		background-color: @mobile-nav-menu-section-selected-bg;
		box-shadow: inset @mobile-nav-menu-section-selected-border-width 0 0 @mobile-nav-menu-section-selected-border-color;
	}
}

.MobileNavigation__section-item {
	color: @mobile-nav-menu-section-item-color;
	display: block;
	font-size: @font-size-lg;
	padding: @mobile-nav-menu-padding-vertical @mobile-nav-menu-padding-horizontal;

	&:hover,
	&:focus,
	&:active {
		color: @mobile-nav-menu-section-item-color;
		outline: none;
		text-decoration: none;
	}
}


// Lists

.MobileNavigation__lists {
	// padding: 10px 0;
}

.MobileNavigation__list-item {
	.border-right-radius(@border-radius-base);
	color: @mobile-nav-menu-list-item-color;
	display: block;
	padding: @mobile-nav-menu-padding-vertical @mobile-nav-menu-padding-horizontal;

	&:hover,
	&:focus,
	&:active {
		color: @mobile-nav-menu-list-item-color;
		outline: none;
		text-decoration: none;
	}

	&.is-active {
		background-color: @mobile-nav-menu-list-item-selected-bg;
		color: @mobile-nav-menu-list-item-selected-color;
	}
}


// slide in

@-webkit-keyframes mobileNavMenuEnter {
	from { opacity: 0; -webkit-transform: translate3d(-8%, 0, 0); }
	to   { opacity: 1; -webkit-transform: none; }
}
@keyframes mobileNavMenuEnter {
	from { opacity: 0; transform: translate3d(-8%, 0, 0); }
	to   { opacity: 1; transform: none; }
}



// slide out

@-webkit-keyframes mobileNavMenuLeave {
	from { opacity: 1; -webkit-transform: none; }
	to   { opacity: 0; -webkit-transform: translate3d(-4%, 0, 0); }
}
@keyframes mobileNavMenuLeave {
	from { opacity: 1; transform: none; }
	to   { opacity: 0; transform: translate3d(-4%, 0, 0); }
}
