/* Table of Contents - Floating Button and Sidebar */

/* Floating Button */
.toc-floating-btn {
	position: fixed;
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 1000;
	background: #fff;
	border: 1px solid #ed1c24;
	border-radius: 50px;
	padding: 8px 16px;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	color: #ed1c24;
	font-size: 12px;
}

.toc-floating-btn:hover {
	background: #ed1c24;
	color: #fff;
	box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
	transform: translateY(-50%) scale(1.05);
}

.toc-floating-btn .toc-icon {
	width: 20px;
	height: 20px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.toc-floating-btn .toc-icon span {
	display: block;
	height: 2px;
	background: currentColor;
	border-radius: 1px;
	transition: all 0.3s ease;
}

.toc-floating-btn .toc-icon span:nth-child(1) {
	width: 100%;
}

.toc-floating-btn .toc-icon span:nth-child(2) {
	width: 80%;
}

.toc-floating-btn .toc-icon span:nth-child(3) {
	width: 100%;
}

.toc-floating-btn:hover .toc-icon span:nth-child(2) {
	width: 100%;
}

/* Overlay */
.toc-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
}

.toc-overlay.active {
	opacity: 1;
	visibility: visible;
}

/* Sidebar */
.toc-sidebar {
	position: fixed;
	top: 0;
	left: -320px;
	width: 320px;
	height: 100vh;
	background: #fff;
	z-index: 10000;
	transition: left 0.3s ease;
	overflow-y: auto;
	overflow-x: hidden;
}

.toc-sidebar.active {
	left: 0;
}

.toc-sidebar-header {
	padding: 12px;
	border-bottom: 2px solid #e5e5e5;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #f8f9fa;
	position: sticky;
	top: 0;
	z-index: 1;
}

.toc-sidebar-header p {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #333;
}

.toc-close-btn {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #666;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.3s ease;
}

.toc-content {
	padding: 10px;
}

.toc-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.toc-list .toc-item {
	margin-bottom: 8px;
}

.toc-list .toc-item-h2 {
	font-size: 14px;
	color: #333;
	padding: 10px 12px;
	border-left: 2px solid #ed1c24;
	margin-bottom: 4px;
	background: #f8f9fa;
	border-radius: 4px;
}

.toc-list .toc-item-h2 a {
	color: #333;
	text-decoration: none;
	display: block;
	transition: color 0.3s ease;
}

.toc-list .toc-item-h2 a:hover {
	color: #ed1c24;
}

.toc-list .toc-item-h3 {
	font-size: 13px;
	color: #666;
	padding: 8px 12px 8px 12px;
	border-left: 2px solid #ddd;
	margin-left: 8px;
	margin-bottom: 4px;
}

.toc-list .toc-item-h3 a {
	color: #666;
	text-decoration: none;
	display: block;
	transition: color 0.3s ease;
}

.toc-list .toc-item-h3 a:hover {
	color: #ed1c24;
	border-left-color: #ed1c24;
}

.toc-list .toc-item.active > a {
	color: #ed1c24;
}

/* Smooth scroll behavior */
html {
	scroll-behavior: smooth;
}

/* Mobile Responsive */
@media (max-width: 768px) {
	.toc-floating-btn {
		left: 10px;
		top: 9px;
		transform: none;
		padding: 8px 12px;
		font-size: 11px;
		z-index: 1000;
		border-radius: 5px;
	}

	.toc-floating-btn:hover {
		transform: scale(1.05);
	}

	.toc-floating-btn .toc-icon {
		width: 18px;
		height: 18px;
	}

	.toc-sidebar {
		width: 300px;
		left: -300px;
	}
}

@media (max-width: 480px) {
	.toc-floating-btn {
		left: 10px;
		top: 12px;
		transform: none;
		padding: 6px 10px;
		font-size: 10px;
		gap: 6px;
		border-radius: 5px;
	}

	.toc-floating-btn:hover {
		transform: scale(1.05);
	}

	.toc-floating-btn .toc-icon {
		width: 16px;
		height: 16px;
	}

	.toc-floating-btn .toc-text {
		font-size: 10px;
	}
}

