.rtl {
	direction: rtl;

	// Mix-ins
	.right(@right) {
		right: @right;
		left: auto;
	}

	.left(@left) {
		left: @left;
		right: auto;
	}

	.margin-right(@margin-right) {
		margin-right: @margin-right;
		margin-left: auto;
	}

	.margin-left(@margin-left) {
		margin-left: @margin-left;
		margin-right: auto;
	}

	.padding-right(@padding-right) {
		padding-right: @padding-right;
		padding-left: 0;
	}

	.padding-left(@padding-left) {
		padding-left: @padding-left;
		padding-right: 0;
	}

	button {
		text-align: right;
	}

	.text-right {
		text-align: left;
	}

	.side-nav {
		.right(0);

		.header {
			.right(0);

			.account-box {
				.info {
					padding: 10px 18px 10px 0;

					.thumb {
						float: right;
					}

					.thumb::after {
						.right(-14px);
					}

					.data {
						float: right;
						padding: 0 10px 0 25px;

						.wrp {
							text-align: right;
						}
					}
				}

				.options {
					.right(0);

					.status {
						.padding-right(38px);
					}

					span.soon {
						.left(-30px);
					}

					.status::after {
						.right(18px);
					}
				}

				.options._hidden {
					transform: translateX(100%);
				}
			}
		}

		> .arrow {
			.left(8px);
		}

		.arrow {
			transform: rotateY(180deg);
		}

		.footer {
			.right(0);
		}

		.rooms-list {
			direction: ltr;

			> .wrapper {
				direction: rtl;
				.padding-right(8px);

				h3.add-room {
					i {
						.left(6px);
					}
				}

				h3 {
					.padding-right(10px);
				}

				ul a {
					padding: 6px 6px 7px 25px;
				}
			}
		}

		.more {
			padding: 4px 10px 4px 0;
		}

		.empty {
			.padding-right(10px);
		}

		ul .opt {
			.left(0);
			.padding-left(10px);
			text-align: left;
		}

		.flex-nav {
			.right(0);

			> section {
				.right(0);
			}

			header {
				.right(0);
				.padding-right(15px);

				> div {
					text-align: right;
				}
			}

			.content {
				> .wrapper {
					direction: rtl;
				}
			}

			.input-submit {
				margin: 35px -4px 0 0;
			}

			.button::before {
				.right(0);
			}

			footer {
				.right(0);
				text-align: right;

				> div {
					text-align: right;
				}
			}

			&.animated-hidden {
				.transform(translateX(100%));

				header,
				footer,
				.content {
					.transform(translateX(100%));
				}
			}
		}

		.search-form {
			.search {
				.padding-right(25px);
			}

			.margin-left(20px);
		}

		h3 {
			.padding-right(10px);

			&.add-room {
				i {
					.left(6px);
				}
			}
		}

		.unread {
			.left(6px);
		}
	}

	.side-nav::before {
		.right(8px);
	}

	.main-content {
		left: 0;
		right: @rooms-box-width;
		transition: left 0.25s cubic-bezier(0.5, 0, 0.1, 1);

		&.flex-opened {
			left: @flex-tab-width + 40px;
		}
	}

	.page-settings {
		.content {
			> .info {
				padding-left: 20px;
			}
		}

		.section {
			border-right: none;
			border-left: 1px solid #dddddd;

			.section-content {
				.input-line {
					> label {
						text-align: right;
					}
				}
			}
		}
	}

	.messages-box {
		margin: 60px 0 0 20px;

		.new-message {
			.right(50%);
		}
	}

	.terminal {
		direction: ltr;
	}

	.container-bars {
		.upload-progress {
			.upload-progress-progress {
				.right(0);
			}

			.upload-progress-text {
				> a {
					float: left;
				}
			}
		}

		.unread-bar {
			> a.mark-read {
				float: left;
			}

			> a.jump-to {
				float: right;
			}
		}
	}

	.messages-container {
		.right(0);

		.edit-room-title {
			.margin-right(4px);
		}

		.wrapper {
			.right(0);
		}

		.footer {
			.right(0);
		}

		.message-form {
			> div {
				.input-message-container {
					.inner-left-toolbar {
						.right(13px);
					}
				}
			}

			textarea {
				padding-right: 49px;
				padding-left: 8px;
				text-align: right;
				border-width: 0 0 0 1px;
				border-right-width: 0;
			}

			> .stream-info {
				float: right;
			}

			> .formatting-tips {
				float: left;
				position: relative;
				right: auto;

				q {
					padding: 0 3px 0 0;
					border-right: 3px solid;
					border-left: 0 none;
					// border-right-color: #cccccc;
				}
			}
		}
	}

	.account-box {
		.options {
			direction: ltr;

			> .wrapper {
				direction: rtl;
			}
		}
	}

	.flex-tab-container {
		border-width: 0 1px 0 0;
	}

	.flex-tab-bar {
		.tab-button {
			&.active {
				.margin-right(-1px);
				border-left: 3px solid #ff0000;
				border-right: unset;
			}
		}
	}

	.flex-tab {
		.control {
			text-align: right;
			padding: 12px 30px;

			> a,
			> form {
				float: right;
			}

			.more {
				.right(0);
				.transform(translateX(27px));
			}

			.search-form {
				padding: 0 0 0 4px;
				width: 100%;

				.icon-plus {
					.right(4px);
				}
			}

			.info-tabs {
				text-align: left;
				.left(20px);
			}
		}
	}

	.flex-opened {
		.flex-tab {
			.control {
				.more {
					.transform(translateX(0));
				}
			}
		}
	}

	.input-line {
		&.search {
			.icon-spin {
				.left(5px);
			}

			.icon-search,
			.icon-right-open-small {
				.right(2px);
			}

			input {
				padding-right: 20px;
				padding-left: 8px;
				text-align: right;
			}
		}

		> div {
			.right {
				.left(10px);
			}
		}

		&.double-col {
			> label {
				float: right;
				.padding-left(20px);
				text-align: left;
				padding: 10px 0 10px 20px;
			}

			> div {
				float: right;

				label {
					.margin-left(4px);

					&:nth-last-child(1) {
						.margin-left(0);
					}

					input {
						.margin-left(4px);
					}
				}
			}
		}
	}

	.user-image {
		.avatar {
			&::after {
				.right(-12px);
			}
		}
	}

	.lines .user-image {
		button {
			> div {
				float: right;
			}
		}

		p {
			float: right;
			.padding-right(10px);
		}
	}

	.user-view {
		nav {
			.margin-right(-4px);

			.back {
				float: left;
			}
		}

		.stats {
			li {
				border-right: unset;
				border-left: 2px;
			}
		}
	}

	@media all and(max-width: 1100px) {
		#rocket-chat {
			.flex-opened {
				left: 0;
				right: @rooms-box-width;

				.flex-tab {
					.transform(translateX(calc(~'100% + 40px')));
				}
			}
		}
	}

	@media all and(max-width: 780px) {
		#rocket-chat {
			.main-content {
				right: 0;
			}

			.fixed-title h2 {
				margin-right: 45px;
			}
		}
	}

	.burger {
		.margin-right(7px);
		.right(0);

		.unread-burger-alert {
			.left(4px);
		}

		&.menu-opened {
			i {
				&:nth-child(1) {
					.transform(translate(25%, 3px) rotate(45deg) scale(0.5, 1));
				}

				&:nth-child(3) {
					.transform(translate(25%, -3px) rotate(-45deg) scale(0.5, 1));
				}
			}
		}
	}

	.arrow {
		&::before,
		&::after {
			.calc(right, ~"50% - 5px");
		}

		&::before {
			.transform(rotate(135deg) translateX(4px));
		}

		&::after {
			.transform(rotate(-135deg) translateX(4px));
		}

		&.left {
			&::before {
				.transform(rotate(-45deg) translateY(-4px));
			}

			&::after {
				.transform(rotate(45deg) translateY(4px));
			}
		}

		&.top {
			&::before {
				.transform(rotate(45deg) translateX(-2px) translateY(2px));
			}

			&::after {
				.transform(rotate(-45deg) translateX(2px) translateY(2px));
			}
		}

		&.bottom {
			&::before {
				.transform(rotate(-45deg) translateX(-2px) translateY(-2px));
			}

			&::after {
				.transform(rotate(45deg) translateX(2px) translateY(-2px));
			}
		}

		&.close {
			&::before {
				.transform(rotate(-45deg));
			}

			&::after {
				.transform(rotate(45deg));
			}
		}
	}

	.message {
		padding-left: 20px;
		padding-right: 70px;

		.message-dropdown {
			.right(-2px);

			ul {
				li {
					&:first-child {
						padding-right: 6px;
						padding-left: 8px;
						border-left: 1px solid #eeeeee;
						border-right: unset;
					}

					&:last-child {
						padding-left: 13px;
						padding-right: 8px;
					}
				}
			}
		}

		.user {
			margin-left: 5px;
			margin-right: 0;
		}

		.thumb {
			.right(20px);
		}

		.info {
			.edited {
				border-right: 1px dotted #bab8d8;
				border-left: unset;
				.padding-right(3px);
				.margin-right(3px);
			}
		}

		.private {
			.margin-right(10px);
			//
		}

		&.sequential {
			padding-top: 4px;

			.info {
				text-align: left;
				.right(5px);

				.edited {
					border-right: 0;
					.margin-right(0);
					.padding-right(0);
				}

				.message-action {
					float: right;
					//
					.margin-right(1px);
					//
				}
			}
		}
	}

	blockquote {
		.padding-right(10px);

		&::before {
			.right(0);
		}
	}

	.first-unread {
		.body {
			&::before {
				right: 20px;
				left: 0;
			}

			&::after {
				.left(0);
			}
		}
	}

	.ticks-bar {
		.left(2px);
	}

	.fixed-title {
		padding: 0 20px 0 10px;
		.right(0);
	}

	.list-view {
		> .title {
			.see-all {
				float: left;
			}
		}

		&.uploaded-files-list {
			a {
				direction: ltr;
			}

			i {
				float: right;
				.margin-left(10px);
			}
		}
	}

	.page-list {
		.list {
			a {
				.info {
					ul {
						.margin-right(3px);
					}
				}
			}

			.user-image {
				float: left;
				.margin-right(12px);
			}

			table {
				thead {
					th {
						text-align: right;
					}
				}
			}
		}
	}

	.statistics-table {
		th,
		td {
			text-align: right;
		}
	}

	.code-mirror-box {
		direction: ltr;

		.buttons {
			text-align: left;
		}

		&.code-mirror-box-fullscreen {
			left: 40px;
			right: 260px;

			.title {
				padding-right: 10px;
				padding-left: unset;
				direction: rtl;
			}
		}
	}

	@media all and (max-width: 780px) {
		.code-mirror-box {
			&.code-mirror-box-fullscreen {
				right: 0;
			}
		}
	}

	.rocket-form {
		legend {
			&::after {
				right: 0;
			}
		}

		.logoutOthers {
			text-align: left;
		}

		.submit {
			text-align: left;
		}
	}

	/* Override toastr messages to show on hte left side */
	.toast-top-right {
		.left(12px);
	}

	.toolbar-search__icon {
		right: 0;
	}

	.toolbar-search__icon--cancel {
		right: auto;
		left: 0;
	}

	.message-popup.search-results-list {
		direction: ltr;
		text-align: right;
		padding: 25px 8px 0 0;

		.popup-item {
			direction: rtl;
		}
	}
}
