// ------------ Aloha styles for adding/editing tables ------------ //

$alohaTableOptionsHeight: 25px;
$alohaTableOptionsWidth: 25px;

.aloha-table {
	tr.aloha-table-selectcolumn {
		line-height: 0.01em;
		height: $alohaTableOptionsHeight !important;
	}

	td.aloha-table-selectrow {
		width: $alohaTableOptionsWidth !important;
	}
}

.aloha-editable div.aloha-table-wrapper,
.aloha-table-wrapper div.aloha-table-cell-editable,
.aloha-table-wrapper .aloha-table-leftuppercorner div,
.aloha-table-wrapper tr.aloha-table-selectcolumn td,
.aloha-table-wrapper td.aloha-table-selectrow,
.aloha-table-wrapper div.aloha-editable-caption {
	margin: 0;
	padding: 0;
	border-color: #444;
	background: 0;
	outline: 0 solid transparent;
	zoom: 1;
}

div.aloha-table-cell-editable {
	height: 100%;
	min-height: 100%;
	width: 100%;
	z-index: 99999;
}

tr.aloha-table-selectcolumn td,
td.aloha-table-selectrow {
	visibility: hidden;
}

.aloha-editable-active {
	tr.aloha-table-selectcolumn td,
	td.aloha-table-selectrow {
		visibility: visible;
	}
}

.aloha-cell-selected {
	background-color: $blue !important;
	color: $textOnGray;
}

.aloha-table {
	td.aloha-table-selectrow,
	tr.aloha-table-selectcolumn td {
		background-color: #444;

		&:hover {
			background-color: $blue;
		}
	}

	td .aloha-table-cell-editable {
		cursor: text !important;
	}

	tr.aloha-table-selectcolumn td {
		cursor: s-resize;
	}

	td.aloha-table-selectrow {
		cursor: e-resize;
	}
}

.aloha-table-textarea {
	width: 90%;
	height: 100px;
	margin-left: 5px;
	margin-right: 5px;
}

.aloha-table-label {
	margin-left: 5px;
}

.aloha-block:hover > .aloha-block-draghandle,
.aloha-block-active > .aloha-block-draghandle {
	display: block;
}

.aloha-block-droppable {
	border-left: 1px solid $warning;
	margin-left: -1px;
}

.aloha-ie7 .aloha-block-droppable {
	margin-left: 0;
}

.aloha-block-droppable.aloha-block-droppable-right {
	margin-left: 0 !important;
	border-left: none !important;
	margin-right: -1px;
	border-right: 1px solid $warning;
}

.aloha-block-droppable-blocklevel {
	position: relative;
}

.aloha-block-blockleveldragdropline {
	position: absolute;
	width: 100%;
	height: 2px;
	background-color: $warning;
	bottom: 0;
}

.aloha-block .aloha-editable {
	cursor: auto;
}

.aloha-block {
	position: relative;
}

.aloha-block:hover>.aloha-block-draghandle, .aloha-block-active>.aloha-block-draghandle {
	display: block;
}

.aloha-block-draghandle {
	@extend .fas;
	position: absolute;
	left: 0px;
	top: 0px;
	padding: 5px 0px 0px 5px;
	@include box-sizing(border-box);
	height: $alohaTableOptionsHeight !important;
	width: $alohaTableOptionsWidth !important;
	overflow: hidden;
	display: hidden;
	line-height: 1em;
	font-size: 16px;
	cursor: pointer;
	color: $textOnGray;

	&:hover {
		color: $blue;
	}

	&:before {
		text-decoration: inherit;
		display: inline-block;
		speak: none;
		content: fa-content($fa-var-arrows-alt);
		font-weight: 900;
	}
}

.aloha-table-wrapper .aloha-table-leftuppercorner {
	.aloha-wai-red,
	.aloha-wai-green {
		display: none;
	}

	&:hover {
		background: #444 !important;
		cursor: pointer !important;
	}
}

.aloha-block.ui-draggable-dragging .aloha-block-draghandle {
	display: none;
}

.aloha-block-editor label {
	display: block;
}

.aloha-block-dropInlineElementIntoEmptyBlock {
	border: 1px solid $warning;
}

.aloha-block-dropzone {
	background-color: #CCC;
}

.neos-backend {
	.ui-widget-overlay {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: $zindexModalBackdrop;
		background: none;
		background-color: $black;
		@include opacity(.35);
	}

	// Base modal
	.ui-dialog {
		position: fixed;
		top: 120px !important;
		left: 50% !important;
		z-index: $zindexModal;
		margin: 0px 0px 0px -17.5%;
		color: $textOnGray;
		background: $grayDark;
		border: 1px solid $grayLight;
		padding: 0px;
		width: 35% !important;
		@include border-radius(0);
		@include font();
		// Remove focus outline from opened modal
		outline: none;

		.ui-widget-header {
			padding: 0px;
			border: 0px;
			background: none;
			color: #fff;
			font-weight: normal;

			.ui-button {
				@extend .fas;
				position: absolute;
				right: 0;
				top: 16px;
				margin: 0;
				color: #fff;
				font-size: 18px;
				line-height: 100%;
				width: $unit;
				height: $unit;
				margin-left: $defaultMargin;
				margin-top: -$defaultMargin;
				background: none;
				border: none;
				@include text-shadow(none);
				@include opacity(1);
				@include box-sizing(border-box);

				span {
					display: none;
				}

				&:before {
					content: fa-content($fa-var-times);
				}

				&:hover {
					background: $blue;
				}
			}

			span {
				font-size: 16px;
				margin: $defaultMargin;
				line-height: $unit / 2;
				@include box-sizing(border-box);
			}
		}

		// Footer area
		.ui-dialog-buttonpane {
			background: transparent;
			@include box-shadow(0px 0px 0px transparent);
			@include border-radius(0px);
			border: 0px;
			padding: $defaultMargin;
			text-align: right;
			@include clearfix(); // clear it in case folks use .neos-pull-* classes on buttons

			// Properly space out buttons
			.ui-button {
				display: inline-block;
				padding: 0 $defaultMargin;
				margin-left: 5px;
				margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs
				@include font;
				color: #fff;
				font-size: $generalFontSize;
				text-align: center;
				vertical-align: middle;
				cursor: pointer;
				width: auto;
				height: $unit;
				line-height: $unit;
				background-color: $grayLight;
				background-image: none;
				border: none;
				@include text-shadow(none);
				@include box-shadow(none);
				@include box-sizing(border-box);
				@include transition(all 0 ease 0);

				&:focus {
					@include tab-focus();
					outline: 1px dotted #fff;
					outline-offset: 0;
				}

				&:hover,
				&:active {
					color: #fff;
					background-color: $blue;
					text-decoration: none;
				}
			}
		}
	}
}
