@import '~heading.less';
@import '../../resources/fontawesome/fontawesome.less';
@import '../../resources/fontawesome/solid.less';

.Spreadsheet {
	line-height: 1em;
	color: #000;
	user-select: none;
}

.Table {
	border: 0;
	border-top: solid 1px @greyLight;
	border-left: solid 1px @greyLight;
	overflow: visible !important;

	:global(.rt-table),
	:global(.rt-tbody) {
		overflow: visible !important;

		:global(.rt-thead) {
			&:global(.-header) {
				box-shadow: none !important;
				background: @background !important;
				border-bottom: solid 1px @greyLight;
			}

			:global(.rt-th) {
				outline: none;
				padding: 0 !important;
				border-right: solid 1px @greyLight !important;
				min-width: 50px !important;

				// &:global(:last-child) {
				// 	border-right: none !important;
				// }

				:global(.selected) {
					outline: none;
				}

				:global(.rt-resizer) {
					z-index: 5 !important;
				}
			}
		}

		:global(.rt-tr-group) {
			border: none !important;

			:global(.rt-td) {
				padding: 0 !important;
				border: none !important;
				min-width: 50px !important;
				overflow: visible !important;

				// &:global(:last-child) > div {
				// 	box-shadow: inset 0 -1px 0 @greyLight;
				// }

				:global(span) {
					user-select: none;
				}
			}
		}
	}

	&:global(.-striped) {
		:global(.rt-tr.-even) {
			background: @background;
		}

		:global(.rt-tr.-odd) {
			background: none !important;
		}
	}

	:global(.-pagination) {
		box-shadow: none;
		border: none;
		padding: 15px 20px;
		font-size: 13px;
		line-height: 13px !important;

		:global(.-previous),
		:global(.-next) {
			flex: 0 1;

			:global(button) {
				padding: 10px;
				background: @white !important;
				border: 1px solid @greyLight;
				border-radius: 0;
				color: @greyDark;
				line-height: 13px !important;
				font-size: 13px !important;
				height: 39px !important;
				width: 39px !important;

				&:global(:disabled) {
					opacity: 1;
					color: @greyLight !important;
				}

				&:global(:not([disabled]):hover) {
					color: @greyDark !important;
					border: 1px solid @greyMedium;
				}

				i {
					margin: 0 !important;
				}
			}
		}

		:global(.-center) {
			justify-content: center;

			> span {
				margin-top: 0;
				margin-bottom: 0;
			}

			input {
				background: @white !important;
				border: 1px solid @greyLight;
				border-radius: 0;
				color: @greyDark;
				line-height: 39px !important;
				height: 39px !important;
				margin: 0 5px;
				padding: 0;
			}

			select {
				background: @white !important;
				border: 1px solid @greyLight;
				border-radius: 0 !important;
				-webkit-appearance: none;
				-webkit-border-radius: 0 !important;
				-moz-border-radius: 0 !important;
				color: @greyDark;
				line-height: 38px !important;
				height: 39px !important;
				margin: 0 5px;
				padding: 0 4px 0 10px;
			}
		}

		:global(.-next) {
			:global(button) {
				content: " ";
			}
		}
	}
}

.Info {
	padding-bottom: 5px;
	color: #666;
	text-align: right;
}

.Options {
	padding-top: 5px;
	display: flex;
	justify-content: space-between;
	
	button {
		padding: 0 5px;
		height: 30px;
		min-width: 30px;
		background-color: #f5f8fa;
		border: 1px solid @greyLight;
		outline: none;
	}
	button:disabled {
		opacity: 0.5;
	}

	:global(.left) {
		display: flex;

		:global(.find) {
			display: flex;

			:global(.find-input) {
				display: flex;
				justify-content: space-between;
				border: 1px solid @greyLight;
				width: 180px;
				height: 30px;
				line-height: 30px;

				:global(.results) {
					margin: 0 0 0 5px;
					font-size: 0.8em;
					text-align: right;
					color: #999;
				}
			}

			input {
				flex: 1 1 auto;
				border: none;
				outline: none;
				padding: 0 5px;
				width: 120px;
			}

			button {
				margin-left: 5px;
			}

			:global(.replace) {
				display: flex;
			}
		}
	}
}

.Header {
	background: @background;
	padding: 10px 3px 10px 10px;
	min-height: 36px;
	text-align: left;
	color: @greyDark;
	display: flex;
	justify-content: space-between;
	align-items: center;
	outline: none;
	
	&:global(.selected) {
		background: darken(@background, 3%);
	}

	&:global(.align-center) {
		text-align: center;
	}

	&:global(.align-right) {
		text-align: right;
	}

	:global(span) {
		flex: 1 0 auto;
	}

	:global(.lock) {
		opacity: 0.5;
		margin-left: 8px;
	}

	:global(.sort) {
		opacity: 0.5;
	}

	:global(.sort-direction) {
		opacity: 1;
	}

	&:global(.toggle) {
		padding: 10px;

		> :global(span) {
			text-align: center;
		}
	}
}

.IndexCell {
	background: @background;
	padding: 0 10px;
	min-height: 36px;
	box-shadow:
		inset 0 -1px 0 @greyLight,
		inset -1px 0 0 @greyLight;
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: @greyMedium;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;

	&:global(.selected) {
		background: darken(@background, 3%);
	}

	:global(.caret) {
		font-size: 24px;
	}

	:global(.delete) {
		font-size: 18px;
		color: #CC0033;
		cursor: pointer;
	}

	:global(.index) {
		flex: 1 1 auto;
		text-align: right;
		font-size: 12px;
		line-height: 24px;
	}
}

.Cell {
	padding: 10px 0 10px 10px;
	min-height: 36px;
	height: 100%;
	line-height: 16px;
	font-size: 14px;
	background-color: #FFF;
	color: #000;
	box-shadow:
		inset 0 -1px 0 @greyLight,
		inset -1px 0 0 @greyLight;
	position: relative;
	top: 0;
	left: 0;
	outline: none;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;

	&:global(.align-center) {
		padding: 10px 1px 10px 0;
		text-align: center;
	}

	&:global(.align-right) {
		padding: 10px;
		text-align: right;
	}

	&:global(.not-editable) {
		color: #333;
		background-color: #FDFDFD;
	}

	&:global(.disabled) {
		color: #CCC;

		&:global(.togglable) {
			text-decoration: line-through;
		}

		&:global(.toggle) {
			color: #CC0033;
		}
	}

	&:global(.toggle) {
		color: #00CC99;
	}

	&:global(.match) {
		background-color: #FEFEC0;

		&:global(.current) {
			background-color: #FEFE60;
		}
	}

	&:global(.selected) {
		background: fadeout(@primary, 97%);
		outline: none;

		&:global(.top) {
			box-shadow:
				inset 0 1px 0 @primary,
				inset -1px 0 0 @greyLight,
				inset 0 -1px 0 @greyLight;

			&:global(.right) {
				box-shadow:
					inset 0 1px 0 @primary,
					inset -1px 0 0 @primary,
					inset 0 -1px 0 @greyLight;

				&:global(.bottom) {
					box-shadow:
						inset 0 1px 0 @primary,
						inset -1px 0 0 @primary,
						inset 0 -1px 0 @primary;

					&:global(.left) {
						box-shadow:
							inset 0 1px 0 @primary,
							inset -1px 0 0 @primary,
							inset 0 -1px 0 @primary,
							inset 1px 0 0 @primary;
					}
				}

				&:global(.left) {
					box-shadow:
						inset 0 1px 0 @primary,
						inset -1px 0 0 @primary,
						inset 1px 0 0 @primary,
						inset 0 -1px 0 @greyLight;
				}
			}

			&:global(.bottom) {
				box-shadow:
					inset 0 1px 0 @primary,
					inset 0 -1px 0 @primary,
					inset -1px 0 0 @greyLight;

				&:global(.left) {
					box-shadow:
						inset 0 1px 0 @primary,
						inset 0 -1px 0 @primary,
						inset 1px 0 0 @primary,
						inset -1px 0 0 @greyLight;
				}
			}

			&:global(.left) {
				box-shadow:
					inset 0 1px 0 @primary,
					inset 1px 0 0 @primary,
					inset 0 -1px 0 @greyLight,
					inset -1px 0 0 @greyLight;
			}
		}

		&:global(.right) {
			box-shadow:
				inset -1px 0 0 @primary,
				inset 0 -1px 0 @greyLight;

			&:global(.left) {
				box-shadow:
					inset -1px 0 0 @primary,	
					inset 1px 0 0 @primary,
					inset 0 -1px 0 @greyLight;
			}
		}

		&:global(.bottom) {
			box-shadow:
				inset 0 -1px 0 @primary,
				inset -1px 0 0 @greyLight;

			&:global(.right) {
				box-shadow:
					inset -1px 0 0 @primary,
					inset 0 -1px 0 @primary;
			}

			&:global(.right.left) {
				box-shadow:
					inset -1px 0 0 @primary,
					inset 0 -1px 0 @primary,
					inset 1px 0 0 @primary;
			}

			&:global(.left) {
				box-shadow:
					inset 0 -1px 0 @primary,
					inset 1px 0 0 @primary,
					inset -1px 0 0 @greyLight;
			}
		}

		&:global(.left) {
			box-shadow:
				inset 1px 0 0 @primary,
				inset -1px 0 0 @greyLight,
				inset 0 -1px 0 @greyLight;
		}
	}

	> span {
		display: block;
		overflow: hidden;
	}

	> input {
		background-color: transparent;
		border: none;
		font-size: 1em;
		outline: none;
		padding: 0;
		color: @primary;
		width: 100%;
	}

	:global(.selection) {

		&:global(.dropdown) {
			position: absolute !important;
			left: 0px !important;
			right: 0px !important;
			margin: -9px 0 !important;
			padding: 0px !important;
			border-radius: unset !important;
			border: unset !important;
			background-color: fadeout(@primary, 97%);
			min-height: 34px !important;
			min-width: unset!important;
			width: 100% !important;
			box-shadow:
				inset -1px 0 0 @primary,
				inset 1px 0 0 @primary !important;

			> i {
				padding: 10px 10px 10px 0 !important; 
			}

			> a {
				margin: 5px 0 0 5px !important;
				padding: 5px !important;
				font-size: 12px;
				font-weight: 400;
				border-radius: 0;
			}

			> :global(.text) {
				position: unset !important;
				padding: 9px 10px !important;
				font-size: 14px !important;
				line-height: 16px !important;
			}

			&::global(.multiple) {
				:global(.text) {
					position: absolute !important;
					margin: 0 !important;
					padding: 9px 10px !important;
					font-size: 14px !important;
					line-height: 16px !important;
				}
			}
		}
	}

	

	:global(.menu) {
		left: 0px !important;
		top: calc(100% - 1px) !important;
		margin: 0 !important;
		border-radius: unset !important;
		border: unset !important;
		min-width: unset !important;
		width: 100% !important;
		box-shadow:
			0 2px 3px 0 rgba(34,36,38,.15),
			inset -1px 0 0 @primary,
			inset 0 -1px 0 @primary,
			inset 1px 0 0 @primary !important;

		:global(.item) {
			padding: 8px 10px !important;
			font-size: 12px !important;
			border-top: 0 !important;
		}
	}

	

	.message {
		margin: 0 !important;
		padding: 10px !important;
	}

	:global(.search) {
		margin: 0 !important;
		padding: 9px !important;
		font-size: 14px;
		line-height: 16px !important;
		color: @primary;
		width: 100% !important;
	}
}

.Empty {
	text-align: center;
	padding: 50px;
	color: @greyMedium;

	i {
		font-size: 100px;
		color: lighten(@greyMedium, 20%);
	}

	h2 {
		margin: 20px 0 10px;
	}
}