// Component of ui.less
// FIXME: Move to components/

/* Left menu */
@menuBorder: 12px;
@menuBorderColor: #252525;

#mw-mf-viewport {
	position: relative;
	height: 100%;
}

#mw-mf-page-center {
	width: 100%;
	.box-sizing(border-box);
	position: relative;
	z-index: 3;
}

#mw-mf-page-left {
	float: left;
	min-height: 100%;
	background: @mainMenuBackgroundColor;
	border-left: solid @menuBorder @menuBorderColor;
	.box-sizing( border-box );
}

// Kept for caching reasons
#mw-mf-page-left,
.navigation-drawer {
	display: none; /* JS only */
}

// needs to be more specific than .overlay rules
.notifications-overlay.navigation-drawer {
	right: 0;

	height: 100%;
	width: auto;
	box-shadow: -5px 0 0 0 rgba(0, 0, 0, 0.3);
}

#mw-mf-page-left ul {
	background-color: @mainMenuBackgroundColor;
	list-style: none;
	margin: 0;
	padding: 0;

	&:first-child {
		border-bottom: @menuBorder solid @menuBorderColor;

		li:first-child {
			border-top: none;
		}
	}

	li {
		position: relative; // ensure the logout link in beta can be position absolute
		font-size: 1.2em;
		text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
		border-bottom: 1px solid #3e3e3e;
		border-top: 1px solid #717171;

		&:hover {
			background-color: #5C5C5C;
			border-left: solid @menuBorder #3366BB;
			margin-left: -@menuBorder;
		}

		// for beta logout button
		.icon-secondary {
			border: none;
			position: absolute;
			right: 0;
			top: 0;
			background-position: center center;
			background-size: 18px 18px;
			text-indent: -999px;
			overflow: hidden;
			padding-right: 0;
			width: 0; // rely on padding
			border-left: 1px solid #717171;
		}

		.icon-profile {
			padding-right: 40px;
		}

		a {
			color: white;
			display: block;
			padding: 13px 10px 11px 34px;
			line-height: 22px;
			background-repeat: no-repeat;
			.background-size(24px, 24px);
			background-position: left center;
			margin-left: 9px;
			&:hover {
				text-decoration: none;
			}
		}

		&.icon-home a {
			.background-image('images/menu/home.png');
		}

		&.icon-random a {
			.background-image('images/menu/random.png');
		}

		&.icon-watchlist a {
			.background-image('images/menu/watchlist.png');
		}

		&.icon-uploads a {
			.background-image('images/menu/uploads.png');
		}

		&.icon-nearby a {
			.background-image('images/menu/nearby.png');
		}

		&.icon-settings a {
			.background-image('images/menu/settings.png');
		}

		&.icon-user .icon-secondary-logout,
		&.icon-loginout a {
			.background-image('images/menu/loginout.png');
		}

		&.icon-user a {
			.background-image('images/menu/user.png');
		}

		&.icon-anon a {
			.background-image('images/menu/anon.png');
		}
	}

	&.hlist {
		li {
			font-size: 0.8em;
			margin: 0;
			border: none;

			a {
				color: #ccc;
				border: none;
				padding: .7em 12px;
				margin-left: 0;
			}
		}
	}
}

body.navigation-enabled {

	#mw-mf-viewport {
		// disable horizontal scrolling
		overflow: hidden;
		// the two following properties are needed to override the height set
		// by position: fixed fallback on scroll event
		min-height: 100%;
		height: auto !important;
	}

	#mw-mf-page-center {
		// Since we change the color of the body tag above we need to ensure the content has a white background
		background: #fff;
		position: absolute;
		height: 100%;
		// Overriden in mainmenuAnimation
		left: @menuWidth;
		// set border here (#mw-mf-page-left doesn't expand height)
		border-left: solid 1px #000;
		box-shadow: -5px 0 0 0 rgba(0, 0, 0, 0.1);
	}

	.navigation-drawer,
	// Kept for caching reasons
	#mw-mf-page-left {
		display: block;
	}

	.transparent-shield {
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		position: absolute;
		background: @semiTransparent;
	}
}

.primary-navigation-enabled {
	// set background and border here (#mw-mf-page-left doesn't expand height
	// and #mw-mf-viewport has overflow: hidden and clips blue hover borders)
	border-left: solid @menuBorder @menuBorderColor;
	background: @mainMenuBackgroundColor;

	#mw-mf-viewport {
		margin-left: -@menuBorder;
	}

	#mw-mf-page-left {
		width: @menuWidth;
	}

	.position-fixed {
		left: @menuWidth !important;
	}
}

@media all and (min-width: @wgMFDeviceWidthTablet) {
	@rightDrawerLeftOffset: 100% - @rightDrawerWidth;
	.beta,
	.alpha {
		&.secondary-navigation-enabled {
			.user-button {
				display: none;
			}

			#mw-mf-page-center {
				left: -@rightDrawerWidth !important;
				right: @rightDrawerWidth !important;
				width: auto;
			}
		}

		.notifications-overlay.navigation-drawer {
			left: @rightDrawerLeftOffset;
		}
	}
}

.beta, .alpha {
	#mw-mf-page-left {
		// FIXME: Move this rule when new typography in stable
		font-size: 90%;
	}
}