
//////////////////////////////////////////////////////////////////////
// Define the color palette
//////////////////////////////////////////////////////////////////////

@colorPrimaryText:  @white;
@colorPrimary:      @blue-500;
@colorPrimaryLight: @blue-100;
@colorPrimaryDark:  @blue-700;

@colorAccentText:   @white;
@colorAccent:       @pink-A200;

//////////////////////////////////////////////////////////////////////
// Include fusionCSS components
//////////////////////////////////////////////////////////////////////

@import "fusionCSS/fusionCSS.less";

//////////////////////////////////////////////////////////////////////
// Theme style
//////////////////////////////////////////////////////////////////////

@font-face {
	font-family: 'Roboto';
	font-style: normal;
	font-weight: 400;
	src: local('Roboto Regular'),
		local('Roboto-Regular'),
		url(Roboto-Regular.woff2) format('woff2'),
		url(Roboto-Regular.ttf) format('truetype');
}
@font-face {
	font-family: 'Roboto';
	font-style: normal;
	font-weight: 700;
	src: local('Roboto Bold'),
		local('Roboto-Bold'),
		url(Roboto-Bold.woff2) format('woff2'),
		url(Roboto-Bold.ttf) format('truetype');
}

html {
	font-size: 16px;

	@media (max-width: (@breakpoint-s - 1)) {
		font-size: 14px;
	}
}

//////////////////////////////////////////////////////////////////////
// Base

body {
	color: rgba(0, 0, 0, 0.87);
	background-color: #eee;
	font-family: 'Roboto', sans-serif;
	padding: 0;
}

// Style scroll bars on divs
div {
	&::-webkit-scrollbar-track {
		background-color: @black-alpha-5;
		background-clip: padding-box;
		padding: 1px;
	}
	&::-webkit-scrollbar-thumb {
		background-color: @black-alpha-26;
		border-radius: 5px;
		background-clip: padding-box;
		border: 2px solid @black-alpha-5;
	}
	&::-webkit-scrollbar {
		width: 10px;
		height: 10px;
	}
}

a {
	color: @blue-700;
	text-decoration: none;

	&:hover {
		text-decoration: underline;
	}
}

form fieldset[id*="leftcol"], form#contentform #content1-group, form#contentform #content3-group {
	padding: 0;
	margin: 0;
	border: none;

	@media (min-width: @breakpoint-s) {
		width: 50%;
		float: left;
		padding: 0 .75rem 0 0;
	}
}

form fieldset[id*="rightcol"], form#contentform #content2-group, form#contentform #content4-group {
	padding: 0;
	margin: 0;
	border: none;

	@media (min-width: @breakpoint-s) {
		width: 50%;
		float: right;
		padding: 0 0 0 .75rem;
	}
}

form fieldset[id*="fullcol"] {
	clear: both;
	padding: 0;
	margin: 0;
	border: none;
}

form dd:last-child { margin-bottom: .75rem; }

form#contentform {
	.pcontainerSelectControl {
		width: 70%;
		float: left;
	}

	#containerext-label {
		display: none;
	}

	input#containerext {
		width: 25%;
		float: right;
		margin-top: -1.1rem;
		margin-bottom: 4rem;
		padding-top: 1.5rem;
		padding-bottom: .5rem;
	}

	#content2-group + fieldset {
		clear: both;
	}

	#content-group, #breadcrumb-list {
		clear:both;
		border: none;
		padding: 0;
		margin: 0;
		width: 100%;
	}

	#folders-container {
		height: 300px;
		overflow: auto;
		border: 1px solid @colorDivider;
		padding: 5px;
		border-radius: @radius;

		label {
			padding-top: 0;
		}
	}

	#pcontainer-container {
		position: relative;

		.description {
			position: absolute;
			top: 4.5em;
		}
	}

	#container {
		width: 220px;
		margin-right: 10px;
		float: left;
	}

	#containerext-label {
		display: none;
	}

	#containerext {
		width: 60px;
		float: left;
		margin-top: -5px;
		margin-bottom: 4rem;
	}

	#content-group, #breadcrumb-list {
		clear:both;
		border: none;
		padding: 0;
		margin: 0;
		width: 100%;
	}

	#folders-container {
		height: 300px;
		overflow: auto;
		border: 1px solid @colorDivider;
		padding: 5px;
		border-radius: @radius;

		label {
			padding-top: 0;
		}
	}
}

.floatingLabels form {
	input[id^="disporder_"],
	input[id^="runorder_"] {
		padding-top: .5rem;
	}
}

@media (min-width: @breakpoint-s) {
	#submit-list {
		color: @white;
		background-color: @black;
		font-size: 1rem;
		padding: .5rem 1rem;
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		z-index: 9005;

		text-align: right;

		button,
		input[type=submit] {
			margin-bottom: 0;
			font-size: .85rem;
		}
	}

	#toast {
		&.exposed {
			bottom: 3rem;
		}
	}
}

//////////////////////////////////////////////////////////////////////
// Page layout

.logo {
	margin: 2rem 0;
	width: 100%;
}

.login-page {
	padding-top: 5rem;

	input[type="submit"] {
		width: 100%;
	}
}

.page-wrapper {
	padding-top: 3.5rem;
	padding-bottom: 3rem;

	&.exposed {
		.appbar {
			padding-left: 4rem;
		}
	}

	.appbar {
		.transition();
		padding-top: .25rem;
		padding-bottom: .25rem;

		.pull-left {
			width: 70%;
			text-overflow: ellipsis;
			white-space: nowrap;
			overflow: hidden;
		}
		.pull-right {
			width: 30%;
		}
	}

	// Show the sidebar on larger displays
	@media (min-width: @breakpoint-l) {
		padding-left: 3rem;
		.appbar {
			padding-left: 5rem;
		}

		.menu-expose {
			display: none;
		}
	}

	h2 {
		margin: 0 0 .5rem 0;
	}

	.block_title {
		font-size: 1.25rem;
		margin-bottom: .5rem;
	}
}

//////////////////////////////////////////////////////////////////////
// Appbar

.notify-icon {
	position: relative;
	cursor: pointer;

	#notifyCount {
		color: @white;
		background-color: rgba(0, 0, 0, .7);
		position: absolute;
		font-size: .75rem;
		top: 0;
		left: -.5rem;
		padding: 0 .2rem;
		opacity: .8;
	}
}

#cfNotifications {
	text-align: left;
	position: absolute;
	top: 2.45rem;
	right: -3rem;
	max-height: 14rem;
	padding: .5rem 1rem;
	overflow-y: auto;
	color: @colorText;
	background-color: @white;
	font-size: .85rem;
	width: 20rem;
	opacity: 1;
	.transition();
	.z-depth3();

	&.closed {
		opacity: 0;
		visibility: hidden;
	}

	a {
		display: inline;
		color: @blue-700;
		text-decoration: none;
		background-color: transparent;
		padding: 0;

		&:hover {
			color: @colorText;
		}
	}

	li {
		padding: .5rem 0;
		margin-right: 0;
		display: block;
		cursor: default;
		border-bottom: 1px solid @colorDivider;

		&:last-child {
			border-bottom: none;
		}
	}

	.msg {
		display: inline-flex;
		vertical-align: middle;
		line-height: 2rem;
	}

	b {
		color: @colorAccentText;
		background-color: @colorAccent;
		border-radius: 1rem;
		line-height: 1.25rem;
		padding: .125rem .75rem;
		margin: .25rem .5rem .25rem 0;
		white-space: nowrap;
	}

	.material-icons {
		font-size: 2rem;
		margin-right: .5rem;

		&.info {
			color: @blue-500;
		}
		&.warning {
			color: @amber-700;
		}
		&.error {
			color: @red-600;
		}
	}
}

//////////////////////////////////////////////////////////////////////
// Main menu

#mainMenuOverlay {
	display: none;
	position: fixed;
	z-index: 9010;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: @black-alpha-26;
	cursor: pointer;

	&.active {
		display: block;
	}
}

#mainMenuExpose {
	cursor: pointer;
}

#mainMenu {
	color: @white;
	background-color: @grey-900;
	position: fixed;
	left: 0;
	top: 0;
	height: 100%;
	z-index: 9020;
	width: 0;
	text-align: left;
	overflow-y: auto;
	box-shadow: 3px 0 6px rgba(0,0,0,0.16), 3px 0 6px rgba(0,0,0,0.23);
	.transition();

	&.exposed {
		width: 3rem;
	}

	// Show the sidebar on bigger windows
	@media (min-width: @breakpoint-l) {
		width: 3rem;
	}

	ul  {
		list-style: none;
		margin: 4rem 0 2rem 0;
	}
	li {
		font-size: 1.6rem;
		text-align: center;
		margin-bottom: .25rem;
		display: block;
		cursor: pointer;
	}
	a {
		color: @white;
		outline: none;
	}
	a:hover,
	li.active,
	li:hover {
		text-decoration: none;
	}

	#notifyIcon .fa {
		color: @colorAccent;
	}
}

#mainMenuLevel2 {
	background-color: @white;
	position: fixed;
	left: 3rem;
	top: 0;
	width: 0;
	height: 100%;
	z-index: 9020;
	text-align: left;
	max-width: 20rem;
	overflow: hidden;
	.transition();

	&.active {
		display: block;
		width: 50%;
		overflow-y: auto;
		box-shadow: 3px 0 6px rgba(0,0,0,0.16), 3px 0 6px rgba(0,0,0,0.23);
	}
	ul {
		list-style: none;
		margin-left: 0;
		margin-top: 1rem;
		margin-bottom: 2rem;
		display: none;

		&.active {
			display: block;
		}
	}

	a {
		color: @colorText;
		margin: 0;
		display: block;
		padding: .5rem 1rem;
		outline: none;

		&:hover {
			background-color: @grey-200;
			text-decoration: none;
		}
	}

	strong {
		margin: 0;
		display: block;
		padding: .5rem 1rem;
		outline: none;
		font-size: 1.3rem;
		text-align: center;
	}

	img {
		width: 32px;
		margin-right: .5rem;
	}
}

#mainMenuTip {
	display: none;
	white-space: nowrap;
	color: @white;
	position: absolute;
	font-size: 1rem;
	font-weight: 400;
	background-color: @grey-900;
	padding: .25rem 1em;
	left: 3.5rem;
	border-radius: @radius;
	z-index: 9010;
	.z-depth3();
}

//////////////////////////////////////////////////////////////////////
// Styling for sidebar

#sidebar {
	&.sidebarFixed {
		position: fixed;
		top: 0;
	}

	.treeviewwidgetContainer,
	.content {
		height: 100%;
		overflow: auto;
	}

	.treeviewwidgetContainer {
		margin: -1rem;
		padding: 1rem;
	}
}

//////////////////////////////////////////////////////////////////////
// Floating action menu/button

.fam, .fab {
	display: inline-block;
	position: fixed;
	top: 4.5rem;
	right: 1rem;
	z-index: 5;
}

//////////////////////////////////////////////////////////////////////
// Toolbar menu

ul.toolbarwidget {
	margin: 0;
	list-style: none;

	&:after {
		.clearfix();
	}

	li {
		a {
			padding: 5px;
			margin: 3px 2px;
			display: block;
			float: left;
			border: 2px solid #fff;
			border-radius: @radius;
			background-color: #f5f5f5;
			.transition();

			&:hover {
				box-shadow: 0 2px 5px #aaa;
			}
		}

		img {
			float: left;
		}
	}
}

//////////////////////////////////////////////////////////////////////
// Tree view

#treeviewDragOverlay {
	display: none;
	position: absolute;
	color: @white;
	background-color: @black;
	padding: .25rem .5rem;
	z-index: 9005;
	margin-left: 1rem;
	margin-top: -1rem;
	.z-depth1();
	border-radius: 3px;
	opacity: .6;

	&.active {
		display: block;
	}
}

#treeviewDragBusy {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: @black-alpha-26;
	cursor: wait;
	z-index: 9010;

	&.treeviewDragBusyShow {
		display: block;
	}

	.treeviewDragBusyIcon {
		display: inline-block;
		font: normal normal normal 14px/1 FontAwesome;
		font-size: inherit;
		text-rendering: auto;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
		-webkit-animation: fa-spin 2s infinite linear;
		animation: fa-spin 2s infinite linear;
		color: @white;
		font-size: 4rem;
		position: absolute;
		top: 50%;
		left: 50%;
		.translate(-50%, -50%);

		&:before {
			content: "\f110";
		}
	}
}

.treeviewwidget {
	overflow: initial;
	margin-left: -.5rem;
	margin-right: -.5rem;

	.dragBefore {
		border-top: 2px solid @black;
	}
	.dragAfter {
		border-bottom: 2px solid @black;
	}
	.dragInto {
		color: @colorPrimaryText;
		background-color: @colorPrimary;
		padding-top: .125rem;
		padding-bottom: .125rem;
		border-radius: @radius;
		.transition();
	}

	a {
		color: @colorText;
		text-decoration: none;

		// Stop drag
		user-drag: none;
		user-select: none;
		-moz-user-select: none;
		-webkit-user-drag: none;
		-webkit-user-select: none;
		-ms-user-select: none;

		&:hover {
			color: @black-alpha-54;
		}
	}

	ol {
		margin: 0 0 .25rem 0;
		list-style: none;

		ol {
			margin: 0;
			padding-top: 1.25rem;
			margin-top: -1.25rem;
			padding-left: .5rem;;
			display: none;

			li {
				padding-left: 1rem;
			}
		}
	}

	li {
		white-space: nowrap;

		b {
			display: inline-block;
			width: 0;
			height: 0;
			border-top: 6px solid transparent;
			border-left: 6px solid @black;
			border-bottom: 6px solid transparent;
			cursor: pointer;
			margin-right: 6px;
		}

		&.open {
			& > b {
				width: 0;
				height: 0;
				border: none;
				border-bottom: 8px solid @black;
				border-left: 8px solid transparent;
				margin-right: 4px;
			}

			& > ol {
				display: block;
			}
		}

		& > span,
		& > a {
			margin-left: 1rem;
		}

		& > b + a,
		& > b + span {
			margin-left: 0;
		}

		&.container > span,
		&.container > a > span {
			background-image: url(../../../libs/Widget/images/folder_closed.svg);
		}
		&.container.open > span,
		&.container.open > a > span {
			background-image: url(../../../libs/Widget/images/folder.svg);
		}
		&.containeropen > span,
		&.containeropen > a > span {
			background-image: url(../../../libs/Widget/images/folder.svg);
		}
		&.doc > span,
		&.doc > a > span {
			background-image: url(../../../libs/Widget/images/document.svg);
		}
		&.link > span,
		&.link > a > span {
			background-image: url(../../../libs/Widget/images/link.svg);
		}
		&.video > span,
		&.video > a > span {
			background-image: url(../../../libs/Widget/images/video.svg);
		}
		&.image > span,
		&.image > a > span {
			background-image: url(../../../libs/Widget/images/image.svg);
		}
		&.sound > span,
		&.sound > a > span {
			background-image: url(../../../libs/Widget/images/sound.svg);
		}
		&.pref > span,
		&.pref > a > span {
			background-image: url(../../../libs/Widget/images/preferences.svg);
		}
		&.code > span,
		&.code > a > span {
			background-image: url(../../../libs/Widget/images/code.svg);
		}
		&.php > span,
		&.php > a > span {
			background-image: url(../../../libs/Widget/images/code_php.svg);
		}
		&.js > span,
		&.js > a > span {
			background-image: url(../../../libs/Widget/images/code_js.svg);
		}
		&.css > span,
		&.css > a > span {
			background-image: url(../../../libs/Widget/images/code_css.svg);
		}
		&.xml > span,
		&.xml > a > span {
			background-image: url(../../../libs/Widget/images/code_xml.svg);
		}
		&.plugin > span,
		&.plugin > a > span {
			background-image: url(../../../libs/Widget/images/plugin.svg);
		}
		&.snippet > span,
		&.snippet > a > span {
			background-image: url(../../../libs/Widget/images/snippet.svg);
		}
		&.template > span,
		&.template > a > span {
			background-image: url(../../../libs/Widget/images/template.svg);
		}
		&.chunk > span,
		&.chunk > a > span {
			background-image: url(../../../libs/Widget/images/chunk.svg);
		}
		&.resource > span,
		&.resource > a > span {
			background-image: url(../../../libs/Widget/images/resource.svg);
		}
		&.field > span,
		&.field > a > span {
			background-image: url(../../../libs/Widget/images/field.svg);
		}
		&.task > span,
		&.task > a > span {
			background-image: url(../../../libs/Widget/images/task.svg);
		}
		&.node > span,
		&.node > a > span {
			background-image: url(../../../libs/Widget/images/node.svg);
		}
	}

	em {
		font-weight: normal;
		font-style: normal;
		padding: .125rem .25rem;
		border-radius: @radius;
		color: @colorAccentText;
		background-color: @colorAccent;
		.transition();

		&:hover {
			.z-depth1();
		}
	}

	.unpublished {
		> a {
			color: @colorAccent;
			font-style: italic;

			em {
				font-style: italic;
			}
		}
	}

	span {
		background-repeat: no-repeat;
		background-position: 0 50%;
		background-size: 16px 16px;
		padding: 0 0 0 20px;
		font-size: .95rem;
	}
}

//////////////////////////////////////////////////////////////////////
// Table widget

.tablewidget {
	.allleft td:last-child {
		text-align: left;
	}

	tr.separator {
		td {
			border-top: 3px solid @colorAccent;
		}
		&:first-child td {
			border-top: none;
		}
	}

	td:last-child,
	&.center td { text-align: center; }

	&.allleft {
		td {
			text-align: left;
		}
	}

	tr td:last-child a {
		.button();
		.button.primary();
		padding: .25rem 1rem;
	}
}

//////////////////////////////////////////////////////////////////////
// Tav widget

.tabwidget {
	margin-left: -.75rem;
	margin-right: -.75rem;
}

//////////////////////////////////////////////////////////////////////
// Dashboard icons

.icons {
	list-style: none;
	margin: 0;
	position: relative;

	[class^="span"] {
		padding-left: 0;
		padding-right: 0;
	}

	li {
		a {
			color: @colorText;
			display: block;
			text-decoration: none;
			font-size: .85rem;
			text-align: center;
			white-space: nowrap;
			overflow: hidden;
			border: 1px solid transparent;
			padding: .5rem 0;
			.user-select();
			.transition();

			&:hover {
				border-color: @colorDivider;
			}

			img {
				display: block;
				width: 2.5rem;
				margin: 0 auto .125rem auto;
			}

			:after {
				.clearfix();
			}

		}

		div {
			display: none;
			white-space: nowrap;
			color: @white;
			background-color: @grey-900;
			position: absolute;
			top: -3.25rem;
			right: 0;
			padding: .25rem 1em;
			border-radius: @radius;
			.z-depth3();
		}

		&:hover {
			div {
				display: block;
			}
		}
	}
}

//////////////////////////////////////////////////////////////////////
// Suggestion widget
.suggestwidget {
	position: relative;
}
.suggestwidgetpopup {
	color: @colorText;
	background-color: @white;
	position: absolute;
	overflow: auto;
	width: 100%;
	max-height: 15rem;
	margin-bottom: 1rem;
	border-top: none;
	z-index: 9100;
	.z-depth1();

	ul {
		list-style: none;
		margin-left: 0;
	}
	li {
		padding: .5rem 1rem;
		cursor: pointer;

		&:hover {
			background-color: @checklistHoeverBg;
		}
	}
}

//////////////////////////////////////////////////////////////////////
// File manager

iframe.filemanager {
	width: 100%;
	height: 490px;
	border: solid 1px @colorDivider;
}

#browserpane {
	background-color: @white;

	.fam, .fab {
		top: inherit;
		bottom: 1rem;
	}

	#browserform {
		padding: 10px;

		#submit-list {
			background-color: transparent;
			right: 0;
			left: inherit;
			width: auto;
		}
	}

	#browserform-list {
		margin: 1rem;

		dd {
			margin-bottom: 0;
		}

		.uploadButton {
			margin-bottom: 0;
		}

		#submit-container {
			margin-top: 1rem;
		}
	}

	p {
		margin-bottom: 0;

		&:first-child {
			margin-top: 1rem;
		}
	}

	img {
		margin-top: 1.5rem;
	}

	.treeviewwidget {
		overflow: auto;
		position: absolute;
		top: 0;
		margin-left: 0;
		margin-right: 0;
		padding-top: .5rem;
	}

	.filename_title {
		font-size: 1.6rem;
		margin-top:.5rem;
		margin-bottom: .5rem;
		word-wrap: break-word;
	}
}

//////////////////////////////////////////////////////////////////////
// Search rebuild
#completedbar {
	width: 100%;
	background-color: @black-alpha-5;

	strong {
		display: block;
		overflow: hidden;
		text-align: center;
		font-weight: normal;
		color: @colorAccentText;
		background-color: @colorAccent;
	}
}

//////////////////////////////////////////////////////////////////////
// Style for audit log
.auditlog {
	tr {
		th,
		td:nth-child(2) {
			white-space: nowrap;
		}
	}
}