@import '~@wordpress/base-styles/breakpoints';
@import '../notices';

body.sensei-course-theme {
	& > .sensei-message {
		display: none;
	}
}

/* All notices */
.sensei-course-theme .sensei-lms-notice {
	background-color: var(--wp--preset--color--foreground, #f6f7f7);
	color: var(--wp--preset--color--background, #1e1e1e);
	padding: 24px;

	@media (min-width: $break-medium) {
		padding-bottom: 24px;
	}
}

/* Quiz notice on lesson page */
.sensei-course-theme-lesson-quiz-notice {
	display: flex;
	flex-flow: wrap;
	font-size: 1.125rem;
	gap: 15px;
	justify-content: space-between;

	&__content {
		display: flex;
		align-items: center;
	}

	&__title {
		flex-shrink: 0;
		margin-right: 15px;
		text-transform: uppercase;
		font-size: inherit;
		font-weight: 400;
	}

	&__text {
		margin: 0 15px 0 0;
	}

	&__actions {
		display: flex;
		list-style: none;
		margin: 0;
		padding: 0;
		align-items: center;

		>li:not(:last-child) {
			margin-right: 12px;
		}
	}

	&__action {
		align-items: center;
		color: inherit;
		display: flex;

		&.sensei-course-theme__button.is-link {
			display: flex;
		}

		&:active {
			background-color: inherit;
		}
	}

	&__link-chevron {
		width: 24px;
		height: 24px;
	}

	@media screen and (max-width: $break-medium) {
		flex-wrap: nowrap;
		gap: 0;

		&__content {
			flex-direction: column;
			align-items: start;
		}
	}
}

@mixin sensei-lm-notice-styles {
	/* --content-padding comes from mobile.scss */
	margin-left: calc(var(--content-padding) * -1);
	margin-right: calc(var(--content-padding) * -1);
	padding-bottom: 36px;

	@media (min-width: $break-medium) {
		margin-left: 0;
		margin-right: 0;
	}

	&__title {
		margin: 0 0 10px 0;
	}

	&__text {
		margin: 0 0 20px;
	}

	&__actions {
		align-items: center;
		display: flex;
		flex-direction: column;
		gap: 16px;

		.wp-block-button__link {
			display: inline-block;
		}

		@media (min-width: $break-medium) {
			flex-direction: row;
		}
	}
}

/* Quiz notice on quiz page */
.sensei-course-theme-quiz-graded-notice {
	@include sensei-lm-notice-styles;

	&__pending-grade {
		opacity: 0.6;

		.wp-block-button__link:hover {
			cursor: default;
		}
	}

	&__reset-quiz-form {
		margin-bottom: 0;

		.sensei-course-theme__button {
			background-color: transparent;
			border: none;
			color: inherit;
			font-family: var(--wp--preset--font-family--body-font);
			font-size: 18px;
		}

		@media (min-width: $break-medium) {
			margin-left: auto;
		}
	}
}

/* Locked lesson notice */
.sensei-course-theme-locked-lesson-notice {
	@include sensei-lm-notice-styles;

	&__header {
		display: flex;
		padding-bottom: 18px;
		align-items: center;
	}

	&__title {
		margin: 0;
		padding: 0;
		font-size: 14px;
		text-transform: uppercase;
	}

	&__icon {
		padding-right: 14px;

		svg {
			display: block;
			width: 12px;
			height: 12px;
		}
	}

	& > &__text {
		font-size: 24px;
		font-weight: 700;
		line-height: 1.3;
		margin-bottom: 20px;

		a {
			color: inherit;
			text-decoration: underline;
		}
	}

	&__actions {
		font-size: 18px;

		@media (min-width: $break-medium) {
			justify-content: space-between;
		}

		.is-secondary.sensei-course-theme__button {
			background-color: transparent;
			border: none;
			display: block;
			font-family: var(--wp--preset--font-family--body);
			text-transform: none;
			font-weight: normal;
			font-size: 18px;
		}
	}
}
