@import "variables.less";
@import "mixins.less";

html {
	min-height: 100%;
}

body {
	height: 100%;
	 // The html and body elements cannot have any padding or margin. 
	margin: 0px;
	padding: 0px !important;
}

html,
body {
	overflow-x: hidden;  //Prevent scroll on narrow devices 
}

@media(max-width: 991px) {
	.intro-area,
	.footnote-area {
		padding: 15px;
	}

	.grid-row-open {
		top: 0;
	}

	.layout-main {
		position: relative;
	}

	body[data-route^="Form"] {
		.page-title h1 {
			margin-top: 12px;
		}

		.page-title .indicator {
			display: inline-block;
			margin-top: 12px;
		}

		.page-actions {
			padding-top: 20px !important;
			padding-bottom: 0px !important;
			padding-left: 0px !important;
		}

		.page-head .sub-heading {
			font-weight: normal;
			font-size: 10px;
			display: block;
			position: absolute;
			right: 140px;
			min-width: 200px;
		}

		.title-text {
			margin-top: 10px;
			//margin-left: 10px;
		}
	}

	// navbar & breadcrumbs
	.toggle-navbar-new-comments {
		padding: 8px 0px !important;
	}

	.navbar > .container > .navbar-header {
		float: left;
		width: 80%;
	}

	.navbar > .container > .navbar-right {
		float: right;
	}

	.module-item {
		padding: 7px 0px !important;

		h4 {
			font-weight: normal;
		}
	}

	#navbar-breadcrumbs {
		margin: 0px;
		display: inline-block;

		li {
			max-width: 150px;
			white-space: nowrap;
			overflow: hidden;
		}
	}

	#navbar-breadcrumbs > li,
	#navbar-breadcrumbs > li > a {
		display: inline-block;
		vertical-align: middle;
	}

	#navbar-breadcrumbs > li > a:before {
		.breadcrumb-divider-left();
	}

	// select all except last 2
	#navbar-breadcrumbs li:not(:nth-last-child(-n+1)) {
		display: none;
	}

	.navbar-nav {
		margin: 0px;
	}

	.sidebar .form-group {
		margin-bottom: 0px;
	}

	#sidebar-search {
		height: 27px;
	}

	.sidebar .navbar-search-icon {
		float: right;
		color: @navbar-default-color;
		font-size: inherit;
		position: relative;
		right: 7px;
		top: -20px;
		height: 0;
	}

	.sidebar form {
		padding: 7px;
	}

	.sidebar .main-menu {
		position: absolute;
		left: 0;
		right: 0;
		top: 0;
		bottom: 41px;
		overflow-y: auto;
	}

	.sidebar .user-menu {
		padding: 9px 14px;
		background-color: @navbar-default-bg;

		position: absolute;
		left: 0;
		bottom: 0;
		right: 0;
	}

	.sidebar .user-menu,
	.sidebar .user-menu .octicon {
		color: @navbar-default-color;
	}

	.sidebar .user-menu img {
		margin-top: -1px;
	}

	// navbar center
	body[data-route^="Module"] {
		.navbar-center-show;
	}

	// show home when no breadcrumbs
	body.no-breadcrumbs .navbar .navbar-home& {
		display: inline-block !important;
		padding-left: 0px;
		margin-left: 0px;
		padding-top: 6px;

		&:before {
			.breadcrumb-divider();
			.breadcrumb-divider-left();
		}

		&:hover:before,
		&:focus:before,
		&:active:before {
			color: @text-color !important;
		}
	}

	body[data-route=""],
	body[data-route="desktop"] {
		.navbar .navbar-home {
			// display: none !important;
			padding: 8px 10px;
			&:before {
				display: none;
			}
			img {
				margin-top: 0;
			}
		}

		.toggle-sidebar {
			display: none !important;
		}
	}

	body[data-sidebar="0"] {
		.toggle-sidebar {
			display: none !important;
		}
		#navbar-breadcrumbs, .navbar-home {
			margin-left: 15px !important;
		}
	}

	.linked-with-dialog {
		width: 100% !important;
	}
}

@media(max-width: 767px) {
	.modal {
		.modal-dialog {
			margin: 0px;
			padding: 0px;
			width: 100%;
			height: 100%;

			position: fixed;
			top: 0px;
			bottom: 0px;
			left: 0px;
			right: 0px;
			overflow-y: auto;
			background-color: #fff;
		}

		.modal-content {
			border-radius: 0px;
			border: none;
			box-shadow: none;
			height: 100%;
		}

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

		.file-upload {
			.input-upload {
				width: 100%;
				text-align: center;

				.btn-browse {
					width: 100%;
				}
			}

			.web-link-wrapper {
				display: block;
				width: 100% !important;
				text-align: center;

				.file-upload-or {
					display: block;
					margin: 15px 24px;
				}

				.input-link {
					width: 100% !important;
				}
			}
		}
	}

	.layout-main-section-wrapper {
		padding: 0px;
	}

	.layout-main-section {
		border-left-color: transparent !important;
		border-right-color: transparent !important;
	}

	// listviews
	.list-row {
		padding: 13px 15px !important;
	}

	.doclist-row& {
		position: relative;
		padding-right: 10px;

		.list-id {
			font-weight: normal;
		}

		.list-row-id {
			left: 18px;
			text-align: left;
			margin-top: 3px;
		}

		&.has-checkbox .list-row-id {
			left: 40px;
		}

		.list-row-indicator {
			position: absolute;
			right: 0px;
			top: -20px;
		}

		.list-row-modified {
			margin-right: -10px;
		}

		.list-row-left {
			z-index: 1;
		}

		.list-row-right {
			float: right;

			.list-row-indicator {
				top: 4px;

				// bigger indicators for list
				.indicator::before, .indicator::after {
					height: 12px;
					width: 12px;
					border-radius: 12px;
				}

			}

		}

		.list-row-right.no-right-column {
			position: absolute;
			top: 0;
			right: 10px;
			left: -10px;
			width: 100%;

		}
	}

	// chat
	body[data-route^="chat"] {
		.navbar-center-show;
	}

	#page-chat {
		.layout-side-section {
			position: relative;
			left: 0px;
			border-right: 1px solid @border-color;
			padding-left: 0px;
			float: left;

			// hack! to prevent overlap of borders
			width: 76px;
		}

		.layout-main-section-wrapper {
			position: absolute;
			left: 75px;
			right: 0px;
			border-left: 1px solid @border-color;
			float: left;
		}

		.module-sidebar-item {
			margin: 0px;

			.chat-sidebar-link {
				padding: 15px;
			}
		}

		.timeline-head {
			padding: 15px 15px 7px;
		}

		.list-row {
			padding: 7px 0px;
		}

		.message-row-right {
			margin-top: 10px;
			text-align: left;
		}
	}

	#page-setup-wizard {
		.form-section:first-child .form-column:first-child .frappe-control:first-child {
			border-top: 1px solid @border-color;
		}

		.form-section:last-child .form-column:last-child .frappe-control:last-child {
			border-bottom: 1px solid @border-color;
		}

		.setup-wizard-slide .form {
			border: none;
		}
	}

	body[data-route^="Form"] {
		.page-head .sub-heading {
			right: 90px;
		}
	}
}
