@import "mixins";

/*-----------------------------------------------------------------------------------*/
/* Backend Global Stylesheet */
/*-----------------------------------------------------------------------------------*/

/* Font Awesome Icons */
@import 'fontawesome';

/* Info Boxes */
.info-box {
	background: #F2F2F2;
	border: 1px solid #CCCCCC;
	position: relative;
	left: -230px;
	padding: 0.1em 1em;
	margin-bottom: 1em;
	@include border_radius(5px);

	.title {
		margin-top: 1em;
	}

	.success {
		border-color: #E6DB55;
		background-color: #ffffe0;
	}

	.error {
		border-color: #cc0000;
		background-color: #ffebe8;
	}
}

/* Sensei Branding */
#message.sensei-message {
	.squeezer {
		max-width: 960px;
		margin: 0;
		padding: 0 10px;
		text-align: left;
		overflow: hidden;
	}

	li {
		list-style: none outside;
	}
}

#woothemes-sensei {
	.fl {
		float: left;
	}

	.fr {
		float: right;
	}

	h1 span.version {
		font-size: 0.4em;
		font-weight: bold;
		position: relative;
		top: -4px;
		left: 5px;
		padding: 2px 5px;
		border: 1px solid #ccc;
		background: #f5f5f5;
		@include border_radius(10px);
	}

	.extra-content {
		margin-top: 1em;
	}
}

#screen-meta-links .screen-meta-toggle {
	z-index: 2;
}

/* Analysis */
.wrap {
	.sensei-analysis {
		&__no-items-message {
			margin: 50px 0;
			text-align: center;
			font-size: 14px;
		}

		&__top-filters {
			float: left;
			display: flex;
			align-items: center;
			gap: 4px;
			margin-bottom: 14px;
		}
	}

	.sensei-date-picker {
		max-width: 100px;
	}

	#sensei-course-filter {
		float: none;
		margin-bottom: 4px;
	}

	.postbox {
		padding: 1em 0 0 1em;

		h2#add-student-to-course-header {
			padding: 0;
		}

		.inside {
			padding: 0;
		}
	}

	@media screen and (max-width: 782px) {
		.sensei-actions__always-visible {
			display: block !important;
		}
	}
}

.sensei-analysis-wrap {
	display: flex;
	gap: 20px;
	flex-flow: row;
	clear: both;

	@media (max-width: 850px) {
		flex-direction: column;
	}

	table {
		tr {
			td {
				padding: 10px 7px;
			}
		}
	}

	&.user-profile {
		margin-left: 0;
	}

	&.course-profile {
		margin-left: 0;
	}

	.sensei-analysis-main {
		flex: 1;
	}

	.sensei-analysis, .sensei-analysis-course {
		&__top-filters {
			float: left;
			display: flex;
			align-items: center;
			gap: 4px;
			margin-bottom: 14px;

			.sensei-date-picker {
				max-width: 100px;
			}
		}

		&__no-items-message {
			margin: 50px 0;
			text-align: center;
			font-size: 14px;
		}
	}

	.sensei-analysis-course {
		&__table-header {
			float: left;
		}

		&__submenu {
			list-style: none;
			margin: 0;
			padding: 0;
			font-size: 13px;
			color: #646970;

			a {
				line-height: 2;
				padding: .2em;
				text-decoration: none;
			}

			a.current {
				color: #000000;
				font-weight: 600;
				border: none;
			}

			li {
				display: inline-block;
				margin: 0;
				padding: 0;
				white-space: nowrap;
			}
		}

		&__top-filters {
			margin: 5px 0 7px;
		}
	}
}

/* Lesson Info */
#lesson-info {
	.inside {
		margin: 12px 0 8px;
	}

	label {
		display: inline-block;
		margin: 0 0 .53em;
	}

	.lesson-complexity-select {
		width: 300px;
		margin-bottom: 10px;
		display: block;
	}

	textarea {
		display: block;
		width: 98%;
		height: 60px;
	}
}

#course_prerequisite_options_chosen, #course_category_options_chosen, #course_woocommerce_product_options_chosen {
	width: 100% !important;
}

#course-video-embed {
	display: block;
	width: 98%;
	height: 60px;
}

/* ADD QUESTION */

.post-type-question {
	#post-body-content {
		display: none;
	}
}

/* Grading & Student Management */

.grading-selects, .learners-selects {
	.subsubsub {
		float: none;
	}

	@include clearfix();

	.select-box {
		float: left;
		width: 290px;
		margin: 5px 20px 0 0;

		label {
			font-weight: bold;
			display: inline-block;
			margin: 0 0 5px;
		}

		&.reset-filter {
			margin-top: 1px;

			a {
				display: inline-block;
				margin: 0;
			}
		}
	}
}

table.wp_list_table_grading_mains, {
	td {
		padding: 12px 7px 12px;
	}

	.user_status {
		span {
			display: inline-block;
			padding: 5px 10px;
			@include border_radius(3px);
			white-space: nowrap;
		}
	}

	.enrolment_status {
		span {
			display: inline-block;
			@include border_radius(3px);
			white-space: nowrap;
		}

		.not-enrolled {
			background: darken($bg_light, 5%);
		}

		.enrolled {
			background: $success;
			color: #fff;
		}
	}

	.row-actions {
		a {
			cursor: pointer;
		}
	}
}

table.wp_list_table_grading_mains {
	.user_status {
		.ungraded {
			background: darken($bg_light, 5%);
		}

		.in-progress {
			background: #ffffe0;
		}

		.graded {
			background: #52a8e8;
			color: #fff;
		}

		.passed {
			background: $success;
			color: #fff;
		}

		.failed {
			background: #ed6c6c;
			color: #fff;
		}
	}
}

table.wp_list_table_sensei_learner_admins {
	.user_status {
		span {
			padding: 0 10px;
		}

		.in-progress::before, .graded::before, .not-started::before {
			font-family: FontAwesomeSensei;
			font-size: 14px;
			margin-right: 5px;
		}

		.in-progress {
			&:before {
				content: "\f042";
				display: inline-block;
				transform: rotate(90deg);
			}
		}

		.graded {
			&:before {
				content: "\f058";
			}
		}

		.not-started {
			&:before {
				content: "\f10c";
			}
		}
	}
}

.wrap {
	.select2-container--default .select2-selection--single {
		min-height: 30px;
	}

	.sensei-learners-extra {
		.add-student-form-container {
			&.student-search-empty .select2-selection:before {
				position: absolute;
				font-family: dashicons;
				content: "\f179";
				font-size: 200%;
				z-index: 1;
				top: 0;
				color: #9b9b9b;
				padding: 1px 0 0 5px;
				height: 100%;
				display: flex;
				flex-direction: row;
				align-items: center;
				justify-content: center;
			}

			label {
				display: block;
			}

			.select2-search__field {
				padding-left: 2.2em;
			}
		}

		.select2-selection__rendered li {
			margin-bottom: 0;
		}

		.postbox {
			padding: 1em 0 0 1em;

			h2#add-student-to-course-header {
				padding: 0;
			}

			.inside {
				padding: 0;
			}
		}

		#add_learner_submit[disabled] {
			background-color: #037ABA !important;
			color: #66AFD6 !important;
			border-color: #037ABA !important;
		}
	}
}

.enrolment-helper {
	.provides-enrolment {
		color: $success;

		&:before {
			font-family: dashicons;
			content: "\f12a";
			font-size: 150%;
			vertical-align: middle;
		}
	}

	.does-not-provide-enrolment {
		color: darken($bg_light, 40%);

		&:before {
			font-family: dashicons;
			content: "\f159";
			font-size: 150%;
			vertical-align: middle;
		}
	}
}

.sensei-ui-tooltip {
	padding: 5px;
	position: absolute;
	z-index: 9999;
	max-width: 300px;
	border-width: 2px;
}

.sensei-learners-main {
	.components-popover {
		&:not( [data-y-axis='middle'] )[data-x-axis='left'] {
			> .components-popover__content {
				margin-right: -18px;
			}
		}
	}

	.column-actions {
		width: 2.2em;
	}

	.tablenav {
		height: auto;

		&.top {
			@media screen and (max-width: 782px) {
				.sensei-student-bulk-actions__wrapper {
					display: none;
				}
			}

			.tablenav-pages {
				margin: 0 0 5px 0;
			}
		}
	}

	@media screen and (max-width: 782px) and (min-width: 480px) {
		.tablenav.bottom .displaying-num {
			position: relative;
			top: -20px;
			display: block;
			text-align: right;
		}
	}

	@media screen and (max-width: 480px) {
		.tablenav.bottom .displaying-num {
			top: -20px;
		}
	}
}

.sensei-grading-main {
	.question_box {
		@include clearfix();

		&.ungraded {
			.grading-mark.icon_right,
			.grading-mark.icon_wrong {
				&:after {
					@include opacity(0.2);
				}
			}
		}

		&.user_right {
			.grading-mark.icon_right {
				&:after {
					color: darken($success, 15%) !important;
				}
			}

			.grading-mark.icon_wrong {
				&:after {
					@include opacity(0.2);
				}
			}
		}

		&.user_wrong {
			.grading-mark.icon_wrong {
				&:after {
					color: darken($error, 15%) !important;
				}
			}

			.grading-mark.icon_right {
				&:after {
					@include opacity(0.2);
				}
			}
		}

		&.zero-graded {
			.grading-mark.icon_wrong,
			.grading-mark.icon_right {
				&:after {
					@include opacity(0.2);
				}
			}
		}

		&.essay-paste {
		}
	}

	.sensei-grading-answer {
		float: right;
		padding: 20px 0;
		@include calc_width("100% - 110px");

		h4 {
			border-bottom: 1px dashed $border_main;
			font-size: 16px;
		}

		.user-answer {
			padding: 5px;
			font-size: 1.2em;
			display: block;
			max-height: 200px;
			width: 100%;
		}

		.right-answer {
			border: 1px solid $border_main;
			padding: 15px 20px;
			margin-right: 15px;
			background: #fff;
			@include border_radius(5px);
			display: inline-block;
			width: 43%;
			vertical-align: top;

			h5 {
				display: inline-block;
				border-bottom: 1px solid $border_main;
				margin: 0 0 10px;
				padding: 0 0 4px;
				font-size: 14px;
			}

			.correct-answer {
				display: block;
			}
		}

		.answer-notes {
			border: 1px solid $border_main;
			padding: 15px 20px;
			background: #fff;
			@include border_radius(5px);
			display: inline-block;
			width: 43%;
			vertical-align: top;

			h5 {
				display: inline-block;
				border-bottom: 1px solid $border_main;
				margin: 0 0 10px;
				padding: 0 0 4px;
				font-size: 14px;
			}

			textarea {
				display: block;
				width: 100%;
			}
		}
	}

	.sensei-grading-actions {
		float: left;
		width: 85px;
		margin: 0 -1px 0 3px;
		min-height: 90px;

		.actions {
			padding: 20px 0 0;
			text-align: center;

			input[type="radio"] {
				position: relative;
				z-index: 9999;
				width: 28px;
				height: 28px;
				@include opacity(0);
				cursor: pointer;
			}

			.grading-mark {
				position: relative;
				display: inline-block;
				margin: 0 5px;
				width: 28px;
				height: 28px;
				cursor: pointer;

				&:after {
					@include iconafter();
					position: absolute;
					top: 0;
					left: 0;
					z-index: 1;
					margin: 0;
					width: 28px;
					height: 28px;
					line-height: .9;
					font-size: 31px;
				}

				&.icon_right {
					&:after {
						content: "\f058";
						color: $success;
					}

					&:hover {
						&:after {
							color: darken($success, 7%);
						}
					}
				}

				&.icon_wrong {
					&:after {
						content: "\f057";
						color: $error;
					}

					&:hover {
						&:after {
							color: darken($error, 7%);
						}
					}
				}
			}

			.question-grade {
				display: inline-block;
				width: 100%;
				text-align: center;
				font-size: 200%;
				margin: 10px 0;
			}

			.question-grade-total {
				display: inline-block;
				font-size: 250%;
				border-top: 2px solid #000;
				padding-top: 15px;
				width: 100%;
			}
		}
	}

	h4 {
		padding: 0 0 5px 0;
		margin: 0;
	}

	.highlight {
		background: #E6DB55;
		padding: 1px 5px;
		margin: 0;
	}

	.total_grade_display {
		display: inline-block;
		font-size: 30px;
		line-height: 45px;
		color: #000;
		margin-bottom: 20px;
		border-left: 0;
		border-right: 0;
		@include border_radius(0);

		#total_grade_total {
			font-weight: 700;
		}
	}
}

.sensei-options-panel {
	.options_group {
		.form-field {
			margin: 10px 0 10px 300px !important;

			.label {
				float: left;
				display: inline-block;
				width: 300px;
				margin: 0 0 0 -300px;
			}

			input[type="checkbox"], input[type="radio"] {
				width: auto;
			}

			&.disabled {
				@include opacity(0.3);
			}
		}
	}
}

.sensei-student-bulk-actions {
	&__filters {
		display: flex;
		flex-direction: row;
	}

	@media screen and (max-width: 1400px) {
		&__filters {
			flex-direction: column-reverse;
		}
	}

	@media screen and (max-width: 782px) {
		&__filters {
			flex-direction: column;
		}
	}

	@media screen and (max-width: 1400px) {
		&__wrapper {
			height: 30px;
			margin-bottom: 10px
		}
	}

	&__button {
		margin-left: 6px;
	}

	@media screen and (max-width: 782px) {
		&__button {
			margin-top: 6px;
			margin-left: 4px;
		}
	}

	&__bulk_actions_container {
		display: flex;
		margin-right: 22px;
	}

	&__bulk_actions_container &__button {
		height: 30px;
	}
}

.sensei-student-bulk-actions__wrapper .sensei-student-bulk-actions__filters .sensei-student-bulk-actions__placeholder-dropdown {
	max-width: 200px;
	margin-bottom: 10px;
	font-size: 13px;
	background: white;
	min-height: 28px;
	height: 28px;
	padding-top: 1px;
	border: 1px solid #aaa;
	margin-left: 0;
	margin-right: 0;
}

.sensei-grading-filters__reset-button {
	width: 200px;
	margin-bottom: 10px;

	&.disabled {
		margin-bottom: 10px;
	}

	@media screen and (min-width: 782px) {
		width: auto;
		margin-bottom: auto;
	}
}

@media screen and (max-width: 782px) {
	.sensei-student-bulk-actions__container .select2 {
		margin-top: 6px;
		width: 190px !important;
		font-size: 16px;
	}
	.sensei-student-bulk-actions__container .select2-selection__rendered {
		line-height: 40px !important;
	}
	.sensei-student-bulk-actions__container .select2-container .select2-selection--single {
		height: 40px !important;
	}
	.sensei-student-bulk-actions__container .select2-selection__arrow {
		height: 40px !important;
	}

	.sensei-student-bulk-actions__wrapper .sensei-student-bulk-actions__filters .sensei-student-bulk-actions__placeholder-dropdown {
		max-width: 190px;
		margin-bottom: 10px;
		font-size: 16px;
		background: white;
		min-height: 40px;
		height: 40px;
		padding-top: 6px;
		border: 1px solid #aaa;
		margin-top: 6px;
		margin-left: 0;
		margin-right: 0;
	}
}

/* Sensei Promo */

@font-face {
	font-family: 'Reforma 1918-Blanca';
	src: url('../css/fonts/Reforma1918-Blanca.otf');
	font-weight: normal;
	font-style: normal;
}

.sensei-promo-banner {
	display: flex;
	flex-direction: column;
	margin-top: 10px;
}

@media screen and (min-width: 1100px) {
	.sensei-promo-banner {
		display: flex;
		flex-direction: row;
		margin-top: 20px;
	}
}

#woothemes-sensei .sensei-promo-banner {
	&__body {
		color: #FFFFFF;
		font-size: 16px;
		font-style: normal;
		font-weight: 400;
		line-height: 26px;
		letter-spacing: 0em;
		text-align: left;
		margin-bottom: 20px;
		max-width: 420px;
	}

	&__header {
		color: #6fcfb2;
		font-family: 'Reforma 1918-Blanca';
		font-size: 32px;
		font-style: normal;
		font-weight: 400;
		line-height: 45px;
		letter-spacing: 0em;
		text-align: left;
		margin-bottom: 16px;
	}

	&__background {
		background-color: #26212e;
		display: flex;
		flex-direction: column;
		max-height: 269px;
		box-sizing: border-box;
		padding: 24px;
	}

	@media screen and (min-width: 1500px) {
		&__background-large {
			padding: 48px;
		}
	}

	&__redirect-button {
		align-items: center;
		background-color: #6fcfb2;
		border-color: #6fcfb2;
		border-radius: 4px;
		box-shadow: none;
		color: #000;
		display: flex;
		height: 36px;
		justify-content: center;
		outline: none;
		width: 180px;
	}

	&__background-image {
		max-height: 137px;
	}

	@media screen and (min-width: 600px) {
		&__background-image {
			max-height: 269px;
		}
	}

	@media screen and (max-width: 1100px) {
		&__side-background {
			background-color: #43af99;
			padding: 26px;
			display: flex;
			align-content: center;
			justify-content: center;
			align-items: center;
			box-sizing: border-box;
		}
	}
}

/* Sensei Promo Groups*/

@font-face {
	font-family: 'Inter';
	src: url('../css/fonts/Inter.otf');
	font-weight: normal;
	font-style: normal;
}

$promo_highlight: #43af99;

#woothemes-sensei .sensei-promo-groups {
	&__wrapper {
		display: flex;
		margin-top: 20px;
	}

	@media screen and (max-width: 1007px) {
		&__wrapper {
			flex-direction: column;
		}
	}

	&__content-wrapper {
		display: flex;
		flex-direction: column;
		gap: 24px;
		box-sizing: border-box;
		padding: 48px 44px;
		background-color: #26212e;
	}

	@media screen and (min-width: 640px) {
		&__content-wrapper {
			width: 622px;
			height: 500px;
		}
	}

	@media screen and (max-width: 640px) {
		&__content-wrapper {
			padding: 48px 24px;
		}
	}

	@media screen and (max-width: 1007px) {
		&__content-wrapper {
			min-width: 402px;
			width: 100%;
		}
	}

	&__header {
		font-family: 'Inter';
		font-size: 40px;
		color: white;
		line-height: 130%;
		padding-top: 0;
	}

	&__body {
		font-family: 'Inter';
		font-size: 18px;
		line-height: 155%;
		color: white;
		max-width: 420px;
		margin: 0;
	}

	&__list {
		font-family: 'Inter';
		font-size: 18px;
		line-height: 155%;
		color: white;
		margin: 0;
	}

	@media screen and (min-width: 1007px) {
		&__image {
			height: 500px;
		}
	}
	@media screen and (max-width: 1007px) {
		&__image {
			width: 100%;
			min-width: 402px;
		}
	}

	&__list_item {
		display: flex;
		align-items: center;
		gap: 6px;
		margin: 0;
	}

	&__important-info {
		font-family: 'Inter';
		font-size: 24px;
		line-height: 130%;
		color: $promo_highlight;
		margin: 0;
	}

	&__price-period {
		display: block;
		font-size: 14px;
	}

	&__actions {
		display: flex;
		gap: 14px;
	}

	&__primary-action {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 200px;
		height: 48px;
		background: $promo_highlight;
		border-color: $promo_highlight;
		font-family: 'Inter';
		border-radius: 0;
		color: #26212E;
	}

	&__secondary_action {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 200px;
		height: 48px;
		font-family: 'Inter';
		font-size: 13px;
		line-height: 150%;
		color: white;
		text-decoration: none;
	}
}

.sensei-settings-tab {
	&__badge {
		background-color: var(--wp-admin-theme-color);
		color: white;
		font-size: 11px;
		height: 16px;
		line-height: 16px;
		border-radius: 12px;
		padding: 1px 5px 3px;
	}
}

.sensei-settings {
	&__description--small {
		max-width: 320px;
	}

	.sensei-link-navigation {
		display: flex;
		flex-wrap: wrap;
		gap: 20px;
		margin-top: 10px;
		font-size: 13px;

		a {
			text-decoration: none;
		}
	}

	.sensei-mailpoet-icon {
		width: 20px;
		height: 20px;
		margin-left: 10px;
		position: absolute;
	}

	.sensei-woo-icon {
		width: 29px;
		height: 20px;
		margin-left: 10px;
		position: absolute;
	}
}
