$icon-font-path: "../bower/bootstrap-sass-official/assets/fonts/bootstrap/";
$brand-primary: #428bca;
// $brand-primary: #993636;
@import "../bower/bootstrap-sass-official/assets/stylesheets/bootstrap";
@import "gandhi-list";

.btn {
	line-height: 1.42857143 !important;
}

.table > thead > tr > td.active,
.table > thead > tr > th.active,
.table > thead > tr.active > td,
.table > thead > tr.active > th,
.table > tbody > tr > td.active,
.table > tbody > tr > th.active,
.table > tbody > tr.active > td,
.table > tbody > tr.active > th,
.table > tfoot > tr > td.active,
.table > tfoot > tr > th.active,
.table > tfoot > tr.active > td,
.table > tfoot > tr.active > th {
	background-color: scale-color($brand-primary, $lightness: 85%);
}



html {
	min-height: 100%;
	background-color: rgb(253, 253, 253);
	// background-color: rgb(248, 248, 248);
}

body {
	background-color: transparent !important;
	margin: 0;

	// ckeditor styles
	.cke_chromeless .cke_chrome {
		border: 0 none;
		-webkit-box-shadow: none;
		box-shadow: none;
	}

	// ace styles
	.ace_editor { height: 200px; }
	td .ace_editor { height: 80px; }

	// bootstrap styles

	.btn .glyphicon {
		top: 2px;
	}

	.input-xs {
		height: 22px;
		padding: 5px 5px;
		font-size: 12px;
		line-height: 1.5;
		border-radius: 3px;
	}

	.table + .panel-body,
	.table-responsive + .panel-body,
	gandhi-permissions + .panel-body {
		padding-top: 0;
	}

	.panel {
		border-width: 0;
		-webkit-box-shadow: 0px 2px 1px rgba(0, 0, 0, 0.1);
		box-shadow: 0px 2px 1px rgba(0, 0, 0, 0.1);
	}

	.panel-default > .panel-heading {
		background-color: #fafafa;
		border-bottom: 2px solid #f5f5f5;
		font-weight: 300;
	}

	.panel-title {
		font-size: 14px;
	}

	// Button area inside a tab bar
	.tab-bar {
		padding-top: 10px;
		padding-right: 10px;
		position: relative;
		float: right;
		z-index: 1;
	}

	// Tabs
	// ----

	.nav-tabs {
		position: relative;
		z-index: auto;

		+ * {
			position: relative;
			z-index: auto;
		}

		> li > a {
			border-radius: 0;
			border-color: transparent;
		}

		> li.active > a,
		> li.active > a:hover,
		> li.active > a:focus {
			border-style: solid;
			border-color: $brand-primary;
			-webkit-box-shadow: 0px 2px 1px rgba(0, 0, 0, 0.1);
			box-shadow: 0px 2px 1px rgba(0, 0, 0, 0.1);
		}

		> li > a:hover {
			background-color: transparent;
			border-color: transparent;
		}

	}

	// Top Tabs
	.nav-tabs:not(.tabs-left):not(.tabs-right) {
		border-bottom: 1px solid transparent;

		> li > a {
			border-width: 2px 0 0 0;
		}

		+ .panel {
			border-top-left-radius: 0;
			border-top-right-radius: 0;
		}
	}

	// Left Tabs
	.nav-tabs.tabs-left {
		border-right: 1px solid transparent;
		padding-right: 0;

		> li > a {
			border-width: 0 0 0 2px;
		}

		> li.active::after {
			content: "";
			display: block;
			position: absolute;
			top: 0;
			right: -1px;
			width: 2px;
			background: #fff;
			bottom: 0;
		}

		+ .panel {
			padding-left: 0;
			border-top-left-radius: 0;
		}
	}

	// Right Tabs
	.nav-tabs.tabs-right {
		border-left: 1px solid transparent;
		padding-left: 0;

		> li > a {
			border-width: 0 2px 0 0;
		}

		> li.active::after {
			content: "";
			display: block;
			position: absolute;
			top: 0;
			left: -1px;
			width: 2px;
			background: #fff;
			bottom: 0;
		}
	}

	// because there's no way to do look-behind in CSS,
	// any panel that belongs to a .tabs-right will need
	// the class "tabs-right-panel"
	.tabs-right-panel {
		padding-right: 0;
		border-top-right-radius: 0;
	}

	.panel {
		
		.tabs-left, .tabs-right {
			border-bottom: none;
			padding-top: 2px;
		}
		.tabs-left {
			border-right: 1px solid #ddd;
		}
		.tabs-right {
			border-left: 1px solid #ddd;
		}
		.tabs-left>li, .tabs-right>li {
			float: none;
			margin-bottom: 2px;
		}
		.tabs-left>li {
			margin-right: -1px;
		}
		.tabs-right>li {
			margin-left: -1px;
		}
		.tabs-left>li.active>a,
		.tabs-left>li.active>a:hover,
		.tabs-left>li.active>a:focus {
			border-color: #ddd;
			border-right-color: transparent;
			border-width: 1px;
		}

		.tabs-right>li.active>a,
		.tabs-right>li.active>a:hover,
		.tabs-right>li.active>a:focus {
			border-bottom: 1px solid #ddd;
			border-left-color: transparent;
		}
		.tabs-left>li>a {
			border-radius: 4px 0 0 4px;
			margin-right: 0;
			display:block;
		}
		.tabs-right>li>a {
			border-radius: 0 4px 4px 0;
			margin-right: 0;
		}
		.vertical-text {
			margin-top:50px;
			border: none;
			position: relative;
		}
		.vertical-text>li {
			height: 20px;
			width: 120px;
			margin-bottom: 100px;
		}
		.vertical-text>li>a {
			border-bottom: 1px solid #ddd;
			border-right-color: transparent;
			text-align: center;
			border-radius: 4px 4px 0px 0px;
		}
		.vertical-text>li.active>a,
		.vertical-text>li.active>a:hover,
		.vertical-text>li.active>a:focus {
			border-bottom-color: transparent;
			border-right-color: #ddd;
			border-left-color: #ddd;
		}
		.vertical-text.tabs-left {
			left: -50px;
		}
		.vertical-text.tabs-right {
			right: -50px;
		}
		.vertical-text.tabs-right>li {
			-webkit-transform: rotate(90deg);
			-moz-transform: rotate(90deg);
			-ms-transform: rotate(90deg);
			-o-transform: rotate(90deg);
			transform: rotate(90deg);
		}
		.vertical-text.tabs-left>li {
			-webkit-transform: rotate(-90deg);
			-moz-transform: rotate(-90deg);
			-ms-transform: rotate(-90deg);
			-o-transform: rotate(-90deg);
			transform: rotate(-90deg);
		}
	}

	td.handle {
		cursor: move;
		position: relative;
		background: rgba(89, 89, 89, 0.07);
		width: 20px;

		&::after {
			content: "";
			position: absolute;
			top: 50%;
			left: 4px;
			right: 4px;
			height: 6px;
			display: block;
			border: solid rgba(115, 115, 115, 0.3);
			border-width: 2px 0;
			margin-top: -4px;
		}
	}

	tr.ui-sortable-helper {
		display: table;
		opacity: .5;
		td {

		}
	}

}

// structure

#main{
	margin-top: 40px;

	&::after {
		background: rgba(0, 0, 0, .75);
		bottom: 0;
		content: "";
		display: block;
		left: 0;
		opacity: 0;
		position: absolute;
		right: 0;
		top: 0;
		transition: visibility 0s 0.5s, opacity 0.5s;
		visibility: hidden;
		z-index: 9;
	}
}



#sidebar {
	background: #FFFFFF;
	box-shadow: 0 0 7px rgba(0, 0, 0, 0.4);
	left: 0;
	max-height: 40px;
	overflow: hidden;
	position: fixed;
	top: 0;
	transition: left .5s, max-height .5s;
	width: 100%;
	z-index: 10;

	display: -ms-flex;
	display: -moz-flex;
	display: -webkit-flex;
	display: flex;
	-ms-flex-direction: column;
	-moz-flex-direction: column;
	-webkit-flex-direction: column;
	flex-direction: column;

	> .control {
		display: none;
	}

	nav {
		line-height: 1.4em;
		transition: visibility 0s 0.5s;
		visibility: hidden;

		display: -ms-flex;
		display: -moz-flex;
		display: -webkit-flex;
		display: flex;
		-ms-flex-direction: column;
		-moz-flex-direction: column;
		-webkit-flex-direction: column;
		flex-direction: column;

		a {
			border-left: 2px solid transparent;
			display: block;
			&.active {
				border-left-color: $brand-primary;
			}
			&:hover {
				background-color: #f5f5f5;
				text-decoration: none;
			}
		}

		> a:last-child {
			border-top: 2px solid #f5f5f5;
			bottom: 0;
			left: 0;
			padding: 0.8em 1.8em 0.8em 1em;
			right: 0;
		}

		> a, > ul > li > a {
			background-color: #fff;
			border-bottom: 1px solid #f5f5f5;
			font-weight: 300;
			padding: 0.8em 1.8em 0.8em 1em;
			position: relative;
			text-overflow: ellipsis;
			white-space: nowrap;

			> .glyphicon {
				position: absolute;
				right: 0.5em;
				top: 1em;

				&.glyphicon-chevron-down, &.glyphicon-chevron-right {
					display: none;
					font-size: 0.5em;
					left: 1.5em;
					right: auto;
					top: 2.5em;
				}
			}
		}

		> ul {
			border-bottom: 1px solid #f5f5f5;
			border-top: 2px solid #f5f5f5;
			bottom: auto;
			left: 0;
			margin: 0;
			overflow-x: hidden;
			overflow-y: auto;
			padding: 0;
			right: 0;
			top: 0;

			-ms-flex: 1;
			-moz-flex: 1;
			-webkit-flex: 1;
			flex: 1;

			> li > ul {
				background: rgb(250, 250, 250);
				border-bottom: 1px solid #f5f5f5;
				border-top: 2px solid #f5f5f5;
				font-size: 0.85em;
				list-style: none;
				padding: 0.5em 0;

				a {
					color: rgb(124, 124, 124);
					display: block;
					line-height: 1.3em;
					padding: 0.4em 0.8em 0.4em 2em;

					&.active {
						background-color: scale-color($brand-primary, $saturation: -70%, $lightness: 85%);
					}
				}
			}
		}
	}

	.navbar-default {
		text-align: right;
		min-height: 40px;

		.navbar-toggle {
			float: none;
			margin: 6px;
			padding: 6px 8px;
		}
	}
}

#body {
	margin-left: 0;
	margin-right: 1px;
	padding: 1em;
	transition: margin-left .5s;
	z-index: 0;
}

// table[gandhi-admin-table] {
// 	th, td {
// 		max-width: 200px;
// 	}
// }


@media (max-width: 767px) {
	html.show-navigation {
		height: 100%;
		overflow: hidden;
		width: 100%;

		body {
			height: 100%;
			overflow-y: hidden;
		}

		#sidebar {
			box-shadow: 0 0 20px rgba(0, 0, 0, 1);
			max-height: 100%;
			overflow-y: auto;

			> nav {
				transition: visibility 0s 0s;
				visibility: visible;
			}
		}

		#main::after {
			opacity: 1;
			transition-delay: 0s;
			visibility: visible;
		}

	}
}


@media (min-width: 768px) {

	#main {
		margin-top: 0;
	}

	#sidebar {
		bottom: 0;
		box-shadow: 2px 0px 1px rgba(0, 0, 0, 0.1);
		max-height: 100%;
		width: 210px;

		> .control {
			background: rgb(219, 219, 219);
			border-radius: 3px 0 0 3px;
			color: rgb(126, 126, 126);
			cursor: pointer;
			display: block;
			font-family: "Glyphicons Halflings";
			font-size: 8px;
			line-height: 40px;
			margin-top: -20px;
			opacity: .5;
			padding-left: 1px;
			position: absolute;
			right: 0;
			top: 50%;
			transition: opacity .2s;
			vertical-align: middle;

			&:hover {
				opacity: 1;
			}
		}

		nav {
			transition: visibility 0s 0s;
			visibility: visible;
			
			-ms-flex: 1;
			-moz-flex: 1;
			-webkit-flex: 1;
			flex: 1;
		}
	}

	#body {
		margin-left: 210px;
	}

	.collapse-sidebar {

		#sidebar {
			left: -180px;

			> .control {
				opacity: 0;
			}

			nav > ul > li > ul {
				transition: all 0.8s;
				max-height: 400px;
				overflow-y: auto;
			}

			&:not(:hover) {
				nav > ul > li > ul {
					border-width: 0;
					margin: 0;
					max-height: 0;
					overflow-y: hidden;
					padding: 0;
				}
			}

			&:hover {
				left: 0px;

				> .control {
					opacity: 1;
				}
			}
		}

		#body {
			margin-left: 30px;
		}
	}
}
