@import "variables.less";

.form-print-wrapper {
	border: 1px solid @border-color;
	border-top: none;
}

.print-preview-wrapper {
	padding: 30px 0px;
	background-color: @navbar-bg;
}

.print-toolbar {
	margin: 0px;
	padding: 10px 0px;
	border-bottom: 1px solid @border-color;

	> div {
		padding-right: 0px;
	}
	> div:last-child {
		padding-right: 15px;
	}
}

.form-inner-toolbar {
	padding: 10px 15px 0px;
	background-color: @light-bg;
	text-align: right;

	.btn {
		margin-bottom: 10px;
	}
}

.form-clickable-section {
	border-top: 1px solid @border-color;
	padding: 10px 15px;
	background-color: @panel-bg;
}

.form-page.second-page {
	border-top: 1px solid @border-color;
}

.form-message {
	padding: 15px 30px;
	border-bottom: 1px solid @border-color;
}

.form-message.yellow {
	background-color: @light-yellow;
}

.form-message.blue {
		background-color: @blue-extra-light;
}

.form-message.red {
		background-color: @red-extra-light;
}

.form-message.green {
		background-color: @green-extra-light;
}

.document-flow-wrapper {
	padding: 40px 15px 30px;
	font-size: @text-medium;
	border-bottom: 1px solid @light-border-color;

	.document-flow {
		display: inline-block;
		position: relative;
		left: 50%;
		transform: translateX(-50%);

		.document-flow-link-wrapper {
			width: 140px;
			display: inline-block;
		}


		.document-flow-link-wrapper:not(:last-child) {
			border-top: 1px solid @indicator-darkgrey;
			// padding-left: 20px;
			// padding-right: 20px;
			margin-right: -4px;
		}

		.document-flow-link-wrapper:first-child {
			// padding-left: 0px;
		}

		.document-flow-link-wrapper:last-child {
			// padding-right: 0px;
			margin-right: -140px;
		}

		.document-flow-link {
			margin-top: -10px;
			display: inline-block;
		}

		.document-flow-link:not(.disabled):hover,
		.document-flow-link:not(.disabled):focus,
		.document-flow-link:not(.disabled):active {
			.document-flow-link-label {
				text-decoration: underline;
			}
		}

		.document-flow-link-label {
			display: inline-block;
			margin-left: -50%;
			margin-top: 5px;
		}
	}
}

@media(max-width: @screen-xs) {
	.document-flow-wrapper {
		display: none;
	}
}

.form-dashboard {
	background-color: @light-bg;
}

.form-dashboard-wrapper {
	margin: -15px 0px;
}

.form-documents h6 {
	margin-top: 15px;
}

.form-dashboard-section {
	margin: 0px -15px;
	padding: 15px 30px;
	border-bottom: 1px solid @light-border-color;
}

.form-dashboard-section:first-child {
	padding-top: 0px;
}

.form-dashboard-section:last-child {
	border-bottom: none;
}

.form-heatmap {
	padding: 0px 30px 15px 30px;

	.heatmap {
		display: flex;
		justify-content: center;

		// excessive whitespace around the chart
		.chart-container {
			margin: 0px;
		}

		// don't show the less..more legend
		.chart-legend {
			display: none;
		}
	}

	@media (max-width: @screen-sm) {
		overflow: hidden;
		overflow-x: scroll;
	}
}

.inline-graph {
	.inline-graph-half {
		width: 48%;
		display: inline-block;
		position: relative;
		height: 30px;

		.inline-graph-count {
			font-size: 10px;
			position: absolute;
			left: 0;
			right: 0;
			top: 3px;
			padding: 0px 5px;
			text-align: left;
		}
		.inline-graph-bar {
			position: absolute;
			left: 0;
			right: 0;
			top: 20px;
		}
		.inline-graph-bar-inner {
			display: block;
			float: left;
			background-color: @border-color;
			height: 6px;
			border-radius: 0px 3px 3px 0px;
		}
		.inline-graph-bar-inner.dark {
			background-color: @text-color;
		}

	}
	.inline-graph-half:first-child {
		border-right: 1px solid @border-color;
		margin-right: -3px;

		.inline-graph-count {
			text-align: right;
		}

		.inline-graph-bar-inner {
			float: right;
			border-radius: 3px 0px 0px 3px;
		}
	}
}

.frappe-rtl .inline-graph {
	direction: ltr;
	display: block;
	transform: scaleX(-1);
	.inline-graph-count {
		transform: scaleX(-1);
		text-align: right;
	}
	.inline-graph-half:first-child .inline-graph-count {
		text-align: left;
	}
}

.progress-area {
	padding-top: 15px;
	padding-bottom: 15px;
}

.form-links {
	.document-link {
		margin-bottom: 10px;
		height: 22px;
	}

	.document-link:hover .badge-link {
		text-decoration: underline;
	}

	.document-link:hover .badge-link[disabled='disabled'] {
		text-decoration: none;
	}

	.count {
		display: inline-block;
		margin-left: 5px;
		margin-right: 5px;
	}
}

h6.uppercase, .h6.uppercase {
	font-size: 11px;
	font-weight: normal;
	letter-spacing: 0.4px;
	text-transform: uppercase;
}

.form-section {
	margin: 0px;
	padding: 15px;


	.form-section-description {
		margin-bottom: 10px;
	}

	.form-section-heading {
		margin: 10px 0px;
	}

	.section-head {
		margin: 0px 0px 15px 15px;
		cursor: pointer;

		.collapse-indicator {
			color: @text-extra-muted;
			margin-left: 10px;
			position: relative;
			bottom: -1px;
		}

		.collapse-indicator.octicon-chevron-up {
			bottom: -2px;
		}
	}
	.section-head.collapsed {
		margin-bottom: 0px;
	}
}

.form-section:not(:last-child),
.form-inner-toolbar {
	border-bottom: 1px solid @border-color;
}

.empty-section {
	display: none !important;
}

.shaded-section {
	//background-color: @light-bg;
}

.modal {
	.form-layout {
		margin: -15px;
	}

	.form-grid .form-layout {
		margin: 0px;
	}

	.form-section {
		padding: 15px 7px;
	}
}

.help ol {
	padding-left: 19px;
}

.field_description_top {
	margin-bottom: 3px;
}

.user-actions {
	margin-bottom: 15px;
}
.user-actions a {
	font-weight: bold;
}

.badge-important {
	background-color: #e74c3c;
}

.address-box {
	background-color: @light-bg;
	padding: 0px 15px;
	margin: 15px 0px;
	border: 1px solid @border-color;
	border-radius: 3px;
	font-size: 12px;
}

.timeline {
	margin: 30px 0px;

	.timeline-head {
		.comment-input {
			height: auto;
		}
	}
}

.timeline-item {
	margin-top: 0px;

	b {
		color: @text-light !important;
	}

	blockquote {
		font-size: 14px;
		padding-top: 0px;
		padding-bottom: 0px;
		margin: 0px;
	}

	.btn-more {
		margin-left: 65px;
	}

	.gmail_extra {
		display: none;
	}
}

.timeline-item[data-communication-type="Comment"] {
	.reply {
		background-color: @light-yellow;
	}
}

.timeline-items {
	position: relative;

	.timeline-item-content {
		max-height: 400px;
		overflow: auto;
	}
}

.timeline-item-content .mention {
	background-color: transparent;
	padding: 0;
	font-weight: bold;

	span {
		margin: 0;
	}
}

.timeline {
	position: relative;
}

.timeline::before {
	content: " ";
	border-left: 1px solid @border-color;
	position: absolute;
	top: 0px;
	bottom: -124px;
	left: 43px;
	z-index: 0;
}

.timeline.in-dialog::before {
	bottom: 0px;
}

@media(max-width: @screen-sm) {
	.timeline::before {
		bottom: -64px;
	}
}

.timeline-item .media-body {
	max-width: 100%;
}

.timeline-item.user-content {
	margin: 30px 0px 30px 27px;

	.media-body {
		border: 1px solid @border-color;
		border-radius: 3px;
		margin-left: -7px;
		position: relative;
		max-width: calc(~"100% - 50px");
		padding-right: 0px;
		// to display the triangle beside the box
		overflow: visible;
	}

	.avatar-medium {
		margin-right: 10px;
		height: 45px;
		width: 45px;
	}

	.action-btns {
	    position: absolute;
	    right: 0;
		padding: 8px 15px 0 5px;
		.edit-btn-container {
			margin-right: 13px;
		}
	}

	.comment-header {
		background-color: @light-bg;
		padding: 10px 15px 8px 13px;
		margin: 0px;
		color: @text-muted;
		border-bottom: 1px solid @light-border-color;
		&.links-active {
			padding-right: 77px;
		}
		.asset-details {
			display: inline-block;
			width: 100%;
			.btn-link {
				border: 0;
				border-radius: 0;
				padding: 0;
				&:hover {
					text-decoration: none;
				}
			}
		}
		.commented-on-small {
			display: none;
		}

		.octicon-heart {
			color: @heart-color;
			cursor: pointer;
		}
	}

	.reply {
		padding: 15px;
		overflow: auto;

		& > div > p:first-child {
			margin-top: 0px;
		}

		& > div > p:last-child {
			margin-bottom: 0px;
		}

		hr {
			margin: 10px 0px;
		}
	}

	.close-btn-container {
		.close {
			color: inherit;
			opacity: 1;
			padding: 0;
			font-size: 18px;
		}
	}

	.edit-btn-container {
		padding: 0;

		.edit {
			color: inherit;
			font-size: 21px;
			line-height: 1;

			.octicon-check {
				font-size: 1em;
			}

			&:hover, &:focus {
				color: #000;
			}
		}
	}

	.comment-likes {
		margin-left: 5px;
	}

	.media-body:after, .media-body:before {
		right: 100%;
		top: 15px;
		border: solid transparent;
		content: " ";
		height: 0;
		width: 0;
		position: absolute;
		pointer-events: none;
	}

	.media-body:after {
		border-color: rgba(136, 183, 213, 0);
		border-right-color: #fafbfc;
		border-width: 6px;
		margin-top: -6px;
	}
	.media-body:before {
		border-color: rgba(194, 225, 245, 0);
		border-right-color: @border-color;
		border-width: 7px;
		margin-top: -7px;
	}
}

.timeline-item.notification-content {
	padding-left: 30px;
	margin: 30px 0px;
	position: relative;
	color: @text-muted;

	* {
		color: @text-muted;
	}

	.fa-fw {
		margin-left: 36px;
	}

	div.small {
		padding-left: 40px;

		.fa-fw {
			margin-left: 0px;
		}
	}

	.octicon-heart {
		color: @heart-color !important;
	}
}

.timeline-indicator() {
	content: " ";
	width: 7px;
	height: 7px;
	background-color: @border-color;
	// background-color: white;
	// border: 1px solid @border-color;
	position: absolute;
	left: 40px;
	border-radius: 50%;
	top: 5px;
}

.timeline-item.notification-content::before {
	.timeline-indicator();
}

.timeline-item {
	.reply-link, .reply-link-all {
		margin-left: 15px;
		font-size: 12px;
	}
}

.timeline-item.notification-content.dark::before {
	background-color: @text-color;
}

.timeline-head {
	background-color: white;
	// padding: 15px 30px;
	border: 1px solid @border-color;
	border-radius: 3px;
	position: relative;
	z-index: 1;

	.comment-input-header {
		background-color: @light-bg;
		padding: 7px 15px;
		border-bottom: 1px solid @light-border-color;
	}

	.comment-input-container {
		padding: 15px;

		.awesomplete > ul {
			min-width: 200px;
		}
	}

	.comment-input {
		border-color: @light-border-color;
		max-width: 100%;

		&:focus {
			box-shadow: none;
		}
	}
}

@media(max-width: @screen-xs) {
	.timeline-head {
		border-left: none;
		border-right: none;
		border-radius: 0px;
	}
}

.timeline-futur span{
	color: @orange !important;
}

.signature-field {
	min-height: 300px;
	background: #fff;
	border: 1px solid @border-color;
	border-radius: 3px;
	position: relative;
	margin-top: -10px;
}
.signature-display {
	margin: 7px 0px;
	background: #fff;
}
.signature-btn-row {
	position: absolute;
	bottom: 12px;
	right: 12px;
}
.signature-reset {
	z-index: 10;
	height: 30px;
	width: 30px;
	padding: 4px 0px;
}

.signature-img {
	background: #fff;
	border-radius: 3px;
	margin-top: 5px;
	max-height: 150px;
}


.timeline-new-email {
	margin: 30px 0px;
	padding-left: 70px;
	position: relative;
}

.timeline-new-email::before {
	.timeline-indicator();
}

.form-footer h5 {
	margin: 15px 0px;
	font-weight: bold;
}

.control-label, .grid-heading-row {
	color: @text-muted;
	font-size: 12px;
}

.control-label {
	margin-bottom: 5px;
	font-weight: normal;
}

.like-disabled-input {
	margin-bottom: 7px;
	border-radius: 3px;
	min-height: 30px;
	font-weight: bold;
	background-color: @navbar-bg;
	padding: 5px 10px;
	border-radius: 3px;
}

.disabled-check {
	color: @navbar-bg;
	margin-right: 5px;
	margin-bottom: -2px;
}

.like-disabled-input.for-description {
	font-weight: normal;
	font-size: 12px;
}

.frappe-control& {
	margin-bottom: 15px;

	.help-box {
		margin-top: 3px;
	}

	pre {
		white-space: pre-wrap;
		background-color: inherit;
		border: none;
		padding: 0px;
		margin: 0px;
	}
}

.flex-justify-center {
	display: flex;
    justify-content: center;
}

.flex-justify-end {
	display: flex;
    justify-content: flex-end;
}

.hide-control {
	display: none !important;
}

.shared-user {
	margin-bottom: 10px;
}

.attach-missing-image,
.attach-image-display {
	cursor: pointer;
}

select.form-control {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

.form-control.bold {
	color: #000;
	font-weight: bold;
	background-color: @extra-light-yellow;
}

.form-control[data-fieldtype="Password"] {
	position: inherit;
}

.password-strength-indicator {
	float: right;
	padding: 15px;
	margin-top: -41px;
	margin-right: -7px;
}

.password-strength-message {
	margin-top: -10px;
}

.control-code, .control-code.bold {
	height: 400px;
	font-family: Monaco, "Courier New", monospace;
	color: @text-color;
	font-size: 12px;
	line-height: 1.7em;
	margin-bottom: 10px !important;
}

.delivery-status-indicator {
	display: inline-block;
	margin-top: -3px;
	margin-left: 1px;
	font-weight: 500;
	color: @text-muted;
}

.attach-btn {
	margin-top: 10px;
}

// above mobile
@media (min-width: 768px) {
	.layout-main .form-column.col-sm-12 > form > .input-max-width {
		max-width: 50%;
		padding-right: 15px;
	}

	// don't max-width when in form-grid with half width
	.col-sm-6 .form-grid .form-column.col-sm-12 > form > .input-max-width {
		max-width: none;
		padding-right: 0px;
	}

	.form-column.col-sm-6 textarea[data-fieldtype="Code"] {
		height: 120px !important;
	}
}

// upto tablets
@media (max-width: @screen-sm) {
	.form-section .form-section-heading {
		margin-top: 10px;
	}
}

// mobile
@media (max-width: @screen-xs) {
	// padding to form section on mobile
	.form-section {
		.section-head {
			padding: 15px 15px 15px 0px;
		}
		.section-body {
			margin-top: -15px;
		}
		.section-body .form-column:first-child{
			.radio, .checkbox{
				margin-top: 0;
			}
		}
	}

	.form-column {
		border-bottom: 1px solid @light-border-color;
		padding-top: 15px;
		padding-bottom: 15px;
	}

	.form-column:last-child {
		border-bottom: 0px;
	}

	.form-section {
		padding-left: 0px !important;
		padding-right: 0px !important;
	}

	// forms

	.form-page {
		.form-section {
			padding: 0px 15px;
		}

		.frappe-control& {
			padding: 7px 15px;
			border-bottom: 1px solid @light-border-color;
			margin: 0px -15px;

			.link-btn {
				top: -2px;
			}

			.like-disabled-input {
				min-height: 0px !important;
			}

			&:last-child {
				margin-bottom: 0px;
			}
		}

		.frappe-control:last-child {
			border-bottom: 0px;
		}

		.frappe-control[data-fieldtype="Table"] {
			padding: 0px 15px;
			margin-top: -1px;
			margin-left: -17px;
			margin-right: -17px;
			border-bottom: none;

			label {
				margin-top: 7px;
			}
		}

		.form-control {
			height: auto;
			margin-bottom: 7px;

			// make all fields left-aligned!
			text-align: left !important;
		}

		.form-control:focus {
			box-shadow: none;
		}
	}
}

/* goals */
.goals-page-container {
	background-color: #fafbfc;
	padding-top: 1px;

	.goal-container {
		background-color: #fff;
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
		border-radius: 2px;
		padding: 10px;
		margin: 10px;
	}
}

body[data-route^="Form/Communication"] textarea[data-fieldname="subject"] {
	height: 80px !important;
}

.frappe-control[data-fieldtype="Attach"], .frappe-control[data-fieldtype="Attach Image"] {
	.attached-file {
		position: relative;
		padding: 6px 10px;
		background: @light-bg;
		border-radius: 4px;
		border: 1px solid @border-color;
		font-size: @text-medium;
	}
}

.followed-by-label{
	margin-top: 30px;
}

// Data Import

.map-columns .form-section {
	padding: 0 7px 7px;
	border-bottom: none;

	.clearfix {
		display: none;
	}
}

.map-columns .form-section:first-child {
	padding-top: 7px;
}
