/* Basic reset */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	line-height: 1.6;
	color: #333;
	background-color: #f4f4f4;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	background: white;
	box-shadow: 0 0 10px rgba(0,0,0,0.1);
	margin-top: 20px;
	margin-bottom: 20px;
}

header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-bottom: 20px;
	border-bottom: 2px solid #eee;
}

header h1 {
	color: #2c3e50;
}

.language-switcher {
	display: flex;
	align-items: center;
	gap: 10px;
}

.language-switcher select {
	padding: 5px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: white;
	cursor: pointer;
}

main {
	display: flex;
	margin-top: 30px;
	gap: 30px;
}

nav#toc {
	width: 280px;
	flex-shrink: 0;
	background: #f8f9fa;
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
	max-height: calc(100vh - 120px);
	overflow-y: auto;
	position: sticky;
	top: 20px;
}

nav#toc h2 {
	margin-top: 0;
	margin-bottom: 15px;
	color: #2c3e50;
	font-size: 1.2em;
}

nav#toc ul {
	list-style: none;
}

nav#toc li {
	margin-bottom: 8px;
}

nav#toc a {
	text-decoration: none;
	color: #3498db;
	font-weight: 500;
	display: block;
	padding: 5px 8px;
	border-radius: 4px;
	transition: background 0.2s, color 0.2s;
}

nav#toc a:hover {
	background: #ecf0f1;
}

nav#toc a.active {
	background: #3498db;
	color: white;
}

nav#toc ul ul {
	margin-left: 15px;
	margin-top: 3px;
}

nav#toc > ul > li > a {
	font-size: 0.95em;
	font-weight: 600;
	color: #2c3e50;
}

nav#toc ul ul a {
	font-size: 0.88em;
	color: #7f8c8d;
	padding: 3px 8px;
}

nav#toc ul ul a:hover {
	color: #3498db;
}

nav#toc ul ul a.active {
	color: white;
}

#content {
	flex: 1;
	min-width: 0;
}

#content h2 {
	color: #2c3e50;
	margin-bottom: 20px;
	padding-bottom: 10px;
	border-bottom: 2px solid #3498db;
	font-size: 1.6em;
}

#content h3 {
	color: #34495e;
	margin-top: 25px;
	margin-bottom: 12px;
	font-size: 1.25em;
}

#content h4 {
	color: #555;
	margin-top: 20px;
	margin-bottom: 8px;
	font-size: 1.1em;
}

#content p {
	margin-bottom: 12px;
	line-height: 1.7;
}

#content ul, #content ol {
	margin-bottom: 15px;
	margin-left: 20px;
}

#content li {
	margin-bottom: 6px;
	line-height: 1.6;
}

#content a {
	color: #3498db;
	text-decoration: none;
	border-bottom: 1px dotted #3498db;
}

#content a:hover {
	color: #2980b9;
	border-bottom-style: solid;
}

#content pre {
	background: #1e1e2e;
	color: #cdd6f4;
	padding: 18px;
	border-radius: 8px;
	overflow-x: auto;
	margin-bottom: 15px;
	font-size: 0.88em;
	line-height: 1.5;
	border: 1px solid #313244;
}

#content code {
	font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

#content pre code {
	background: none;
	padding: 0;
	color: inherit;
}

#content :not(pre) > code {
	background: #f0f0f0;
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 0.9em;
	color: #c0392b;
}

/* Scrollable nav on small screens */
nav#toc::-webkit-scrollbar {
	width: 4px;
}
nav#toc::-webkit-scrollbar-thumb {
	background: #bdc3c7;
	border-radius: 2px;
}

footer {
	text-align: center;
	padding: 20px;
	color: #7f8c8d;
	font-size: 0.9em;
	border-top: 1px solid #eee;
	margin-top: 40px;
}

/* Back link inside subsections */
.back-link {
	display: inline-block;
	margin-bottom: 20px;
	color: #3498db;
	text-decoration: none;
	font-size: 0.9em;
}
.back-link:hover {
	text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
	main {
		flex-direction: column;
	}
	nav#toc {
		width: 100%;
		margin-bottom: 20px;
		position: static;
		max-height: none;
	}
	.container {
		padding: 15px;
	}
}