* {
	box-sizing: border-box;
}

body {
	background-color: #212121;
	color: #fff;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		Helvetica, Arial, sans-serif;
	margin: 0;
	margin-top: 90px;

	/* Scrollbar styles for WebKit browsers */
	&::-webkit-scrollbar {
		width: 12px;
	}

	&::-webkit-scrollbar-track {
		background: #333;
		border-radius: 10px;
	}

	&::-webkit-scrollbar-thumb {
		background: #555;
		border-radius: 10px;
		border: 3px solid #333;
	}

	/* Scrollbar styles for Firefox */
	scrollbar-color: #555 #333;
	scrollbar-width: thin;
}

header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 20px; /* Reduced padding for 10-15% height reduction */
	background-color: #212121;
	border-bottom: 1px solid #333; /* Darker border */
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 1000;
	box-sizing: border-box;
}

.header-left {
	display: flex;
	align-items: center; /* Changed back to center for better default alignment */
}

.header-left h1 a {
	text-decoration: none; /* Remove underline for header link */
	color: #fff; /* Set color to white */
}

.header-left h1 a:hover {
	text-decoration: none; /* Ensure no underline on hover */
	color: #fff; /* Ensure color remains white on hover */
}

.header-left h1 {
	font-size: 1.8em; /* Increased font size */
	margin: 0; /* Remove default margin */
	padding-top: 0; /* Remove padding-top */
	padding-bottom: 2px; /* Adjust for visual alignment of uppercase text */
	display: flex;
	align-items: center;
}

.lesson-name-sub {
	color: #bbb; /* Slightly darker color for lesson name */
}

.header-right {
	text-align: right;
	align-self: center; /* Align text to the center */
}

.logo {
	height: 44px; /* Increased by 10% */
	margin-right: 10px;
	border-radius: 50%; /* Make logo circular */
}

.signature {
	font-size: 0.88em; /* Increased by 10% */
	color: #757575;
	line-height: 1.2;
}

.lessons-main {
	max-width: 1000px; /* Adjust as needed */
	margin: 20px auto 20px auto; /* Center content and add top padding */
	padding: 0 20px;
	padding-top: 2px;
}

.lessons-main h1 {
	text-align: center;
	font-size: 2.5em; /* Larger font size */
	margin-bottom: 30px;
	border-bottom: none;
	padding-bottom: 0;
}

.lessons-main ul {
	padding: 0;
	list-style: none;
}

.lessons-main li {
	background-color: #2a2a2a; /* Slightly lighter background for list items */
	margin-bottom: 10px;
	border-radius: 8px;
	padding: 15px; /* Равномерный padding */
	transition: background-color 0.3s ease;
	display: flex; /* Use flexbox for alignment */
	align-items: center; /* Vertically align items */
}

.lessons-main li.read {
	opacity: 0.5; /* Dim the read items */
	text-decoration: none; /* Strikethrough for read items */
}

.lessons-main .lesson-item-content {
	display: flex;
	align-items: center;
	width: 100%;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.lessons-main label.custom-checkbox-label {
	position: relative;
	padding-left: 35px; /* Пространство для кастомного чекбокса */
	cursor: pointer;
	display: flex;
	align-items: center;
	flex-grow: 1;
}

.lessons-main label.custom-checkbox-label::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 24px;
	height: 24px;
	border: 1px solid #424242; /* Темная рамка для выключенного состояния */
	background-color: #2a2a2a; /* Темный фон для выключенного состояния */
	border-radius: 4px;
	transition: all 0.2s ease;
}

.lessons-main .lesson-checkbox:checked + label.custom-checkbox-label::before {
	background-color: #9e9e9e; /* Светло-серый цвет фона при включении */
	border-color: #c0c0c0; /* Светло-серый цвет рамки при включении */
}

.lessons-main .lesson-checkbox:checked + label.custom-checkbox-label::after {
	content: "";
	position: absolute;
	left: 9px; /* Позиция галочки: 0 (левый край ::before) + 24px/2 (центр ::before) = 9px */
	top: calc(
		50% - 8px
	); /* Позиция галочки: 50% (центр ::before) - 12px/2 (половина высоты галочки) = 50% - 6px */
	transform: rotate(45deg); /* Только поворот */
	width: 6px; /* Скорректированный размер галочки */
	height: 12px; /* Скорректированный размер галочки */
	border: solid rgb(31, 31, 31); /* Черный цвет галочки */
	border-width: 0 2px 2px 0;
}

.lessons-main li a {
	color: #a0a0a0; /* Более разборчивый цвет */
	font-size: 1.3em; /* Крупнее шрифт */
	text-decoration: none;
	flex-grow: 1; /* Позволяет ссылке занимать доступное пространство */
	padding: 0; /* Убедимся, что нет лишнего padding */
}

.lessons-main li a:hover {
	color: #fff; /* White on hover for better contrast */
	text-decoration: none;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	gap: 20px;
	height: calc(100vh - 110px); /* Adjust 100px based on header height */
}

.content-panel {
	flex: 2;
	overflow-y: auto;

	/* Scrollbar styles for WebKit browsers */
	&::-webkit-scrollbar {
		width: 12px;
	}

	&::-webkit-scrollbar-track {
		background: #333;
		border-radius: 10px;
	}

	&::-webkit-scrollbar-thumb {
		background: #555;
		border-radius: 10px;
		border: 3px solid #333;
	}

	/* Scrollbar styles for Firefox */
	scrollbar-color: #555 #333;
	scrollbar-width: thin;
}

.gallery-panel {
	flex: 1;
	overflow-y: auto;

	/* Scrollbar styles for WebKit browsers */
	&::-webkit-scrollbar {
		width: 12px;
	}

	&::-webkit-scrollbar-track {
		background: #333;
		border-radius: 10px;
	}

	/* Scrollbar styles for Firefox */
	scrollbar-color: #555 #333;
	scrollbar-width: thin;
}

h1 {
	color: #fff;
	padding-bottom: 10px;
}

a {
	color: #8774e1;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

ul {
	list-style: none;
	padding: 0;
}

li {
	padding: 10px 0;
	border-bottom: 1px solid #424242;
}

.lesson-content {
	line-height: 1.6;
	white-space: pre-wrap;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.gallery-item {
	background-color: #424242;
	border-radius: 8px;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative; /* Для позиционирования значка Play */
}

.gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gallery-item span {
	font-weight: bold;
	cursor: pointer;
}

.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}

.modal-content {
	width: 80%;
	max-width: 900px;
}

.lesson-title-mobile {
	display: none; /* Hidden by default */
	font-size: 1.5em; /* Adjust as needed */
	margin-bottom: 15px; /* Space below the title */
	color: #fff; /* White color */
}

/* Video thumbnail specific styles */
.video-thumbnail-container {
	position: relative;
	width: 100%;
	height: 100%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.video-thumbnail {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: filter 0.3s ease;
}

.video-thumbnail-container:hover .video-thumbnail {
	filter: brightness(0.7); /* Затемнение при наведении */
}

.play-icon {
	position: absolute;
	width: 60px; /* Ширина круга */
	height: 60px; /* Высота круга */
	background-color: rgba(0, 0, 0, 0.5); /* Полупрозрачный черный фон */
	border-radius: 50%; /* Круглая форма */
	display: flex;
	align-items: center;
	justify-content: center;
}

.play-icon::after {
	content: "";
	width: 0;
	height: 0;
	border-top: 10px solid transparent;
	border-bottom: 10px solid transparent;
	border-left: 15px solid white; /* Белый треугольник */
	transform: translateX(
		2px
	); /* Небольшое смещение для визуального центрирования треугольника */
}

/* Mobile adaptations */
@media (max-width: 768px) {
	body {
		padding: 10px;
		padding-top: 0px;
		margin-top: 80px;
	}

	header {
		padding: 8px 10px; /* Reduce header padding */
		height: 60px; /* Set a fixed height for the header */
		justify-content: center; /* Center content horizontally */
	}

	main {
		padding-top: 0; /* Remove padding-top from main on mobile */
	}

	.header-left {
		padding-left: 0; /* Remove left padding */
	}

	.logo {
		margin-right: 5px; /* Reduce margin next to logo */
	}

	.header-left h1 {
		font-size: 1.2em; /* Smaller font size for header title */
		margin-left: 0.25em;
	}

	.lessons-main {
		padding: 0 10px; /* Reduce padding for lessons list */
		margin-top: 0; /* Remove margin-top as padding-top on body handles it */
	}

	.lessons-main li a {
		font-size: 1em; /* Smaller font size for lesson titles */
		color: #fff; /* White color for better readability on mobile */
	}

	.container {
		flex-direction: column; /* Stack panels vertically */
		height: auto; /* Allow height to adjust */
		gap: 10px; /* Reduce gap between stacked panels */
	}

	.content-panel,
	.gallery-panel {
		flex: none; /* Remove flex grow */
		width: 100%; /* Take full width */
		overflow-y: visible; /* Allow content to expand */
	}

	.modal-content {
		width: 95%; /* Make modal wider on small screens */
		height: auto; /* Allow height to adjust */
		max-height: 90vh; /* Limit max height */
	}

	#media-container video,
	#media-container img {
		max-width: 100%;
		max-height: 80vh;
	}

	.gallery {
		grid-template-columns: repeat(
			4,
			1fr
		); /* 4 columns for gallery on mobile */
	}

	.lesson-title-mobile {
		display: block; /* Show on mobile */
	}
}
