/**
* @version   $Id: menu.less 13257 2013-09-04 19:24:30Z arifin $
* @author    RocketTheme http://www.rockettheme.com
* @copyright Copyright (C) 2007 - 2014 RocketTheme, LLC
* @license   http://www.rockettheme.com/legal/license.php RocketTheme Proprietary Use License
*/

@import "variables.less";
@import "/jui/less/mixins.less";
@import "mixins/index.less";

.gf-menu {
	// Menu positioning
	margin: 0 auto;
	list-style: none;

	// Clears
	&:after {
		display: table;
		content: '';
		clear: both;
	}

	ul {
		list-style: none;
		padding: 0;
		margin: 0;
	}

	// Default items
	li {
		float: left;
		display: block;
		text-align: center;
		position: relative;
		padding: 0;
		margin-right: 5px;
		border: none;
		border: 1px solid transparent;
		&:hover, &.active:hover {
			> .dropdown {
				left: 0;
				top: auto;
				opacity: 1;
			}
		}
	}

	// Basic font stuff
	.item {
		font-size: @menu-font-size;
		line-height: @menu-line-height;
		padding: 3px 8px;
		text-align: left;
		text-decoration: none;
		display: block;
		height: auto;
		outline: 0;
		cursor: pointer;
		.transition(background 0.2s ease-out, border 0.2s ease-out);

		// Subtext styling
		&.subtext {
			line-height: 15px;
			> em {
				display: block;
				font-size: @menu-font-size - 4;
				text-align: left;
				font-style: normal;
				position: relative;
				top: -2px;
			}
		}

		// Menu icon tweaks
		&.icon {
			[class^="icon-"], [class*= " icon-"] {
				background-image: none !important;
				width: auto;
				font-family: inherit;

				&:before {
					text-indent: 0;
					margin-right: 5px;
				}

			}
		}

		// Menu Image tweaks
		.menu-image {
			max-width: inherit;
			vertical-align: text-top;
			margin-top: -2px;
			margin-left: -2px;
		}
	}

	// Level 1 Style Overrides
	&.l1 {
		> li {
			> .item {
				font-size: @menu-font-size;
				padding: 0 15px;
				display: table-cell;
				vertical-align: middle;
				line-height: @menu-line-height;
				&.subtext {
					> em {
						position: relative;
						line-height: 10px;
						top: -4px;
					}
					&.icon {
						> em {
							margin-left: 18px !important;
						}
					}
				}

				.menu-image {
					margin-top: -1px;
				}
			}
			> .dropdown-spacer {
				width: 100%;
				height: @menu-dropdown-top-space;
			}
			> .dropdown {
				margin-top: @menu-dropdown-top-space;
			}
		}
	}

	// Parent items
	li.parent {

		> .item {
			position: relative;
			padding-right: 35px;

			&:after {
				position: absolute;
				right: 15px;
				top: 50%;
				margin-top: -12px;
				font-family: FontAwesome;
				content: "\f107"; // icon-angle-down: "\f107", icon-caret-down: "\f0d7", icon-chevron-down: "\f078"
				font-size: 18px;
				opacity: 0.5;
			}
		}
	}

	// Dropdown styling
	.dropdown-spacer {
		display: block;
		position: absolute;
		z-index: 100;
	}
	.dropdown {
		margin: 0 auto;
		padding: 5px 0;
		position: absolute;
		opacity: 0;
		left: -999em;
		text-align: left;
		.transition(opacity 0.2s ease-in-out);
		z-index: 100;
		-webkit-backface-visibility: hidden;
		backface-visibility: hidden;
		.flyout {
			display: block;
			margin-left: @menu-flyout-side-space;
		}

		li.parent {
			> .dropdown-spacer {
				top: 0;
				right: -@menu-flyout-side-space;
				width: 35px;
				height: 35px;
			}
		}

		// Flyout dropdowns (3rd Level +)
		li:hover > .flyout {
			left: 100%;
			top: -5px;
		}

		ul {
			li {
				display:block;
				float:none;
				margin: 5px 0;
				padding: 0 5px;
				border: 0;

				.item {
					border: 1px solid transparent;
				}

				&.parent {
					> .item:after {
						margin-top: -12px;
						font-family: FontAwesome;
						content: "\f105"; // icon-angle-right: "\f105", icon-caret-right: "\f0da", icon-chevron-right: "\f054"
						font-size: 18px;
						opacity: 0.5;
					}
				}

				&:first-child {
					margin-top: 0;
				}
				&:last-child {
					margin-bottom: 0;
				}
			}
		}

		// Grouped styling
		.grouped {
			&.parent {
				> .item {
					&:after {
						font-family: FontAwesome;
						content: "\f078"; // icon-chevron-down
						font-size: 12px;
					}
				}
			}
			ol {
				margin: 5px 0 0 0;
				padding: 5px;
				> li {
					padding: 0;
				}
			}
			&:hover {
				&:after {
					top: 39px;
				}
			}
		}

		// Module styling
		.modules {
			font-size: 90%;
			text-align: left;
			padding: 5px 0;
			.module-content {
				padding: 0 10px;
			}
		}

	}

	// Columns
	.column {
		float: left;
		position: relative;
	}

	// Alignment Helpers
	.position-left {
		float: left;
		margin-right: 15px;
	}

	.position-right {
		float: right;
		margin-left: 15px;
	}
}

// 3 lines toggle for tablets/mobile
.gf-menu-toggle {
	padding: 7px 10px;
	position: absolute;
	z-index: 3000;
	top: 10px;
	left: 10px;
	cursor: pointer;

	.icon-bar {
	    border-radius: 1px 1px 1px 1px;
	    display: block;
	    height: 2px;
	    width: 18px;

	    & + .icon-bar {
    		margin-top: 3px;
	    }
	}
}

// Mobile Specific Mode (Tree View)
@media (max-width: 767px) {
	.layout-mode-responsive {
		.gf-menu-device-wrapper {
			margin-bottom: 15px !important;
		}

		.gf-menu-device-container {

			padding: 5px;

			select {
				margin-bottom: 0;
				width: 100%;
			}
		}

		.gf-menu {
			background-image: url(../images/menu/tree-main.png) !important;
			background-repeat: repeat-y;
			background-clip: content-box;
			-webkit-background-clip: content-box;

			// everything else
			ul, ol {
				background: transparent url(../images/menu/tree-main.png) repeat-y !important;
			}

			li {
				background: url(../images/menu/tree-node.png) no-repeat;
				padding-left: 20px !important;
				margin-right: 0 !important;

				&.active {

					&.last {
						background: url(../images/menu/tree-node.png) no-repeat !important;
						border: 0 !important;
					}
				}

				.columns-1 > .col1,
				.columns-2 > .col2,
				.columns-3 > .col3,
				.columns-4 > .col4 {
					> ul > li:last-child {
						background: transparent url(../images/menu/tree-node-last.png) 0 -2px no-repeat !important;
					}
				}

				ol {
					> li:last-child {
						background: transparent url(../images/menu/tree-node-last.png) 0 -2px no-repeat !important;
					}
				}

				.item {
					padding: 2px 5px !important;
					height: inherit !important;
					&.subtext {
						em {
							display:none;
						}
					}

					&:after {
						content: '' !important;
					}
				}
			}

			// top level special cases
			> li:first-child, > li:first-child.active  {
				background: url(../images/menu/tree-node-first.png) no-repeat !important;
			}
			> li:last-child {
				background: transparent url(../images/menu/tree-node-last.png) 0 -2px no-repeat;
			}

			.dropdown {
				width: 100% !important;
				border: 0 !important;
				padding-top: 0 !important;
				padding-bottom: 0 !important;
				background: transparent !important;
				position: relative;
				left: inherit;
				top: inherit;
				opacity: 1;
				.clearfix();

				.flyout {
					display: block;
				}
				ul li {
					margin: 0;
				}

				// Flyout dropdowns (3rd Level +)
				li:hover > .flyout {
					left: inherit;
					top: inherit;
				}

				.column {
					width: 100% !important;
				}
				.grouped {
					ol {
						border: 0 !important;
						margin: 0 !important;
						padding: 0 !important;
					}
				}
				.modules {
					display: none;
				}
			}

			&.l1 {
				> li {
					float: none;
					margin-left: -1px;
					&.active {
						margin-left: 0px;
						background: transparent;
						border: 0;
					}
					> .item {
						font-size: @menu-font-size + 1;
					}
				}
			}
		}
	}
}

/* Start: Mobile sidemenu */
body.layout-mode-responsive {
    .transition(left 0.2s ease-out);
    position: relative;

    .gf-menu-device-wrapper-sidemenu  {
        left: -@menu-side-width;
        -webkit-overflow-scrolling: touch;
    }

    .gf-sidemenu-size-left {
        left: 0;
        .transition(left 0.2s ease-out);
    }
}

body.gf-sidemenu-size-marginleft {
    left: @menu-side-width;
    position: relative;
    overflow: hidden;
    .transition(left 0.2s ease-out);
}

@media (max-width: 767px) {
    .layout-mode-responsive {
	    .gf-menu-device-container.responsive-type-panel ~ ul.gf-menu {
	        display: none;
	    }
        .gf-menu-device-wrapper {
            &.gf-menu-device-wrapper-sidemenu {
                margin-bottom: 0 !important;
            }
        }
        // sidemenu

        .gf-menu-device-wrapper-sidemenu {
            .transition(left 0.2s ease-out);
            position: fixed !important;
            top: 0;
            left: -@menu-side-width;
            right: 0;
            bottom: 0;
            margin: 0 !important;
            z-index: 200;
            overflow: auto !important;
            border: 0;
            .border-radius(0);
            .box-sizing(border-box);
            padding: 0;
            width: @menu-side-width;

            .gf-menu-device-container {
                display: block;
                padding: 0;
                margin: 0;
                .border-radius(0);
                .box-shadow(none);
                border: 0;
                width: 100%;
            }
        }

    }
}

@media (min-width: 768px) {
    .layout-mode-responsive {
        .gf-menu-device-wrapper-sidemenu {
            left: -@menu-side-width;
        }
    }
    body.gf-sidemenu-size-marginleft {
        left: 0;
    }
}
/* End: Mobile sidemenu */