@import (less) "../node_modules/normalize.css/normalize.css";

@import "mixins/bfc.less";
@import "mixins/clearfix.less";
@import "mixins/user-select.less";

@import "variables.less";

@blueText:        #3B48F6;
@containerWidth:  600px;


.clearfix {
	.clearfix();
}

.hide { display: none !important; }

body {
	font-family: @fontSans;
	font-size: 16px;
	line-height: 1.4;
	color: #333;
	-webkit-font-smoothing: antialiased;
}

input {
	color: #333;
}
a:link {
	color: @blueText;
}
button.input-button {
	color: @blueText;
	outline: none;
	background: transparent;
	border: none;
	height: 32px;
	cursor: pointer;
	.user-select(none);
}

.container {
	margin-left: auto;
	margin-right: auto;
	max-width: @containerWidth;
}

div.header {
	background-image: linear-gradient(270deg, #BEFF00 0%, #FFCF00 100%);
	padding: 16px 0;
	.header-container {
		.clearfix();
		max-width: 80%;
		margin: auto;
		.title {
			font-weight: bold;
			font-size: 20px;
			line-height: 24px;
			float: left;
		}
		.links {
			float: right;
			img {
				margin-left: 14px;
			}
			a:hover {
				opacity: 0.8;
			}
		}
	}
}

div.subheader {
	background-color: #F6F6F6;
	padding-top: 10px;
	padding-bottom: 2px;
	.box {
		.clearfix();
		margin: 18px 0;
	}
	.box1 {
		margin-bottom: 8px;
	}
	.title {
		float: left;
		font-weight: bold;
		margin-bottom: 10px;
	}
	div.links {
		float: left;
		a {
			margin-left: 28px;
			text-decoration: none;
			color: @blueText;
			img {
				vertical-align: sub;
				height: 20px;
				margin-left: 4px;
			}
			&:hover {
				opacity: 0.8;
			}
		}
	}
	.gauge {
		.clearfix();
		padding: 14px 0;
		.gauge-el-wrapper {
			cursor: pointer;
			position: relative;
			box-sizing: border-box;
			float: left;
			width: 33.33%;
			padding-right: 6px;
			&:nth-child(1) .gauge-el {
				background-image: linear-gradient(90deg, #FF2300 0%, #FF7E00 100%);
			}
			&:nth-child(2) .gauge-el {
				background-color: orange;
			}
			&:nth-child(3) .gauge-el {
				background-image: linear-gradient(90deg, #FFCF00 0%, #BEFF00 100%);
			}
		}
		.gauge-el {
			height: 5px;
			border-radius: 10px;
			background-color: red;
		}
		.legend {
			.user-select(none);
			font-size: 11px;
			font-weight: bold;
			position: absolute;
			transition: all 0.2s ease;
			top: 0px;
			opacity: 0;
		}
		&:hover, &.active {
			.legend {
				top: 10px;
				opacity: 1;
			}
		}
	}
}

div.decoder-settings {
	background-color: #ececec;
	position: fixed;
	bottom: 0;
	width: 140px;
	padding: 2px 6px;
	.title {
		font-size: 11px;
		img {
			margin-left: 4px;
			vertical-align: middle;
			opacity: 0.5;
			&:hover {
				opacity: 0.8;
			}
		}
	}
	.setting {
		.desc {
			font-size: 11px;
			font-weight: bold;
		}
		.js-val {
			margin-left: 3px;
			&.green  { color: rgb(109, 144, 6); }
			&.orange { color: #FF7E00; }
			&.red    { color: red; }
		}
	}
	.slider {
		width: 100%;
	}
}

div.chat-container {
	position: relative;
	.messages-gradient {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		height: 30px;
		background-image: linear-gradient(180deg, #FFFFFF 0%, rgba(255,255,255,0.00) 100%);
	}
	.placeholder-start {
		position: absolute;
		top: 45%;
		left: 0; right: 0;
		.inner {
			width: 260px;
			margin: auto;
			text-align: center;
			font-size: 14px;
			color: #777777;
		}
	}
	.messages {
		height: 200px;
		overflow: auto;
		.message {
			.clearfix();
			margin-top: 12px;
			&.incoming .message-inner {
				background-color: white;
				border: 1px solid #ccc;
				float: left;
			}
			&.outgoing .message-inner {
				background-color: #f1f0f0;
				float: right;
			}
		}
		.message-inner {
			border-radius: 14px;
			padding: 6px 14px;
			&.typing-indicator {
				padding: 8px;
			}
			img.typing-indicator {
				width: 32px;
			}
		}
	}
}

div.chat-input {
	margin-top: 20px;
	padding: 12px 20px;
	border: 1px solid #a7a7a7;
	border-radius: 6px;
	box-shadow: 0px 2px 4px 1px rgba(0, 0, 0, 0.2);
	.input-wrapper {
		.clearfix();
		position: relative;
		width: 100%;
		.input-message-wrapper {
			position: absolute;
			left: 0;
			right: 50px;
			input.input-message {
				width: 100%;
				outline: none;
				border: none;
				height: 32px;
				padding: 0;
				background-color: transparent;
			}
		}
		button.input-button {
			float: right;
		}
	}
}
div.chat-suggestion {
	margin-top: 8px;
	margin-bottom: 10px;
	font-size: 14px;
	color: #777777;
	.js-loading {
		font-size: 12px;
	}
}


span.attention-level {
	background-color: rgba(0, 0, 0, 0.4);
	&.level0 { background-color: #FF2300; }
	&.level1 { background-color: #FF7E00; }
	&.level2 { background-color: orange; }
	&.level3 { background-color: #FFCF00; }
	&.level4 { background-color: #BEFF00; }
}


/**
 * Media queries
 */

@media (max-width: 630px) {
	div.decoder-settings {
		position: static;
		margin-top: 32px;
		width: initial;
	}
}

@media (min-height: 800px) {
	/// would probably be way better with css variables
	div.chat-container .messages {
		height: 300px;
	}
}