:root {
	--bg: #0b0f19;
	--panel: rgba(16, 24, 40, 0.65);
	--panel-hover: rgba(22, 34, 56, 0.8);
	--line: rgba(40, 215, 255, 0.12);
	--line-bright: rgba(40, 215, 255, 0.25);
	--text: #f3f7fc;
	--muted: #a0aec0;
	--cyan: #00f0ff;
	--blue: #3b82f6;
	--green: #10b981;
	--amber: #f59e0b;
	--red: #ef4444;
	--shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
	--glow-cyan: 0 0 15px rgba(0, 240, 255, 0.25);
	--glow-red: 0 0 15px rgba(239, 68, 68, 0.25);
	--glow-green: 0 0 15px rgba(16, 185, 129, 0.25);
}

* {
	box-sizing: border-box;
	transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

html {
	background: var(--bg);
	color: var(--text);
	font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	min-height: 100vh;
	background:
		radial-gradient(circle at 10% 15%, rgba(0, 240, 255, 0.08), transparent 45%),
		radial-gradient(circle at 85% 5%, rgba(59, 130, 246, 0.1), transparent 45%),
		linear-gradient(180deg, #070a12 0%, #0c0f17 100%);
	background-attachment: fixed;
}

body.rtl {
	direction: rtl;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
	width: 8px;
	height: 8px;
}
::-webkit-scrollbar-track {
	background: #070a12;
}
::-webkit-scrollbar-thumb {
	background: #1b253b;
	border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
	background: #2b3957;
}

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

.shell {
	display: grid;
	grid-template-columns: 300px minmax(0, 1fr);
	min-height: 100vh;
}

.sidebar {
	position: sticky;
	top: 0;
	height: 100vh;
	padding: 30px 24px;
	border-right: 1px solid var(--line);
	background: rgba(11, 15, 25, 0.75);
	backdrop-filter: blur(20px);
	overflow-y: auto;
}

.rtl .sidebar {
	border-right: 0;
	border-left: 1px solid var(--line);
}

.brand {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 30px;
}

.mark {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border: 1px solid var(--cyan);
	border-radius: 10px;
	background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(59, 130, 246, 0.15));
	color: var(--cyan);
	font-weight: 800;
	font-size: 18px;
	box-shadow: var(--glow-cyan);
}

.brand h1 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.02em;
}

.brand p {
	margin: 2px 0 0;
	color: var(--muted);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.search {
	position: relative;
	margin: 15px 0 25px;
}

.search input {
	width: 100%;
	padding: 12px 16px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: rgba(7, 10, 18, 0.6);
	color: var(--text);
	outline: none;
	font-size: 14px;
}

.search input:focus {
	border-color: var(--cyan);
	box-shadow: var(--glow-cyan);
	background: rgba(7, 10, 18, 0.9);
}

.results {
	display: none;
	position: absolute;
	z-index: 100;
	top: 52px;
	left: 0;
	right: 0;
	max-height: 350px;
	overflow: auto;
	border: 1px solid var(--line-bright);
	border-radius: 10px;
	background: rgba(13, 20, 35, 0.95);
	backdrop-filter: blur(20px);
	box-shadow: var(--shadow);
}

.results.active {
	display: block;
}

.result {
	display: block;
	padding: 14px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.result:hover {
	background: rgba(0, 240, 255, 0.06);
}

.result strong {
	display: block;
	font-size: 14px;
	color: var(--cyan);
}

.result span {
	display: block;
	margin-top: 4px;
	color: var(--muted);
	font-size: 12px;
	line-height: 1.5;
}

.nav {
	display: grid;
	gap: 8px;
}

.nav a,
.language-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	border: 1px solid transparent;
	border-radius: 10px;
	color: var(--muted);
	font-size: 14px;
	font-weight: 500;
}

.nav a:hover,
.nav a.active,
.language-link:hover {
	border-color: var(--line-bright);
	background: var(--panel-hover);
	color: var(--text);
}

.nav a.active {
	border-color: rgba(0, 240, 255, 0.3);
	color: var(--cyan);
	box-shadow: inset 4px 0 0 var(--cyan);
}

.rtl .nav a.active {
	box-shadow: inset -4px 0 0 var(--cyan);
}

.language-link {
	margin-top: 25px;
	border-color: var(--line);
	justify-content: center;
	font-weight: 600;
	background: rgba(255, 255, 255, 0.02);
}

.content {
	padding: 50px min(8vw, 90px) 100px;
	max-width: 1100px;
}

.hero {
	padding: 45px;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: linear-gradient(135deg, rgba(16, 24, 40, 0.7), rgba(10, 15, 28, 0.5));
	backdrop-filter: blur(12px);
	box-shadow: var(--shadow);
	margin-bottom: 40px;
	position: relative;
	overflow: hidden;
}

.hero::after {
	content: '';
	position: absolute;
	top: -50%;
	right: -30%;
	width: 250px;
	height: 250px;
	background: var(--cyan);
	filter: blur(140px);
	opacity: 0.15;
	pointer-events: none;
}

.hero h2 {
	margin: 0;
	font-size: clamp(28px, 4.5vw, 44px);
	line-height: 1.15;
	font-weight: 800;
	letter-spacing: -0.02em;
	background: linear-gradient(120deg, #fff, var(--cyan));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.hero p {
	margin: 20px 0 0;
	color: var(--muted);
	font-size: 16px;
	line-height: 1.8;
}

.hero-actions,
.language-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 30px;
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 24px;
	border: 1px solid rgba(0, 240, 255, 0.4);
	border-radius: 10px;
	background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(59, 130, 246, 0.2));
	color: var(--text);
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0, 240, 255, 0.1);
}

.button:hover {
	transform: translateY(-2px);
	box-shadow: var(--glow-cyan);
	border-color: var(--cyan);
}

.button.secondary {
	border-color: var(--line);
	background: rgba(16, 24, 40, 0.8);
	color: var(--muted);
	box-shadow: none;
}

.button.secondary:hover {
	border-color: var(--line-bright);
	color: var(--text);
	background: var(--panel-hover);
}

.section {
	margin-top: 40px;
	padding: 35px;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: var(--panel);
	backdrop-filter: blur(12px);
	box-shadow: var(--shadow);
}

.section h3 {
	margin: 0 0 20px;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -0.01em;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	padding-bottom: 12px;
}

.section p,
.section li {
	color: var(--muted);
	font-size: 15px;
	line-height: 1.8;
}

.section ul, .section ol {
	padding-left: 20px;
	margin-bottom: 0;
}

.rtl .section ul, .rtl .section ol {
	padding-left: 0;
	padding-right: 20px;
}

.section li {
	margin-bottom: 10px;
}

.grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 20px;
	margin-top: 15px;
}

.card {
	padding: 24px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: rgba(13, 20, 35, 0.4);
}

.card:hover {
	border-color: var(--line-bright);
	background: rgba(13, 20, 35, 0.7);
	transform: translateY(-3px);
}

.card h4 {
	margin: 0 0 10px;
	font-size: 16px;
	font-weight: 700;
	color: var(--cyan);
}

.code {
	overflow: auto;
	padding: 20px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: #05070c;
	color: #d8f7ff;
	font-family: 'Fira Code', Consolas, Monaco, monospace;
	font-size: 13.5px;
	line-height: 1.75;
	white-space: pre;
	margin: 15px 0;
}

/* Blueprint Node Styling */
.node-flow {
	display: grid;
	gap: 8px;
	margin-top: 20px;
	max-width: 600px;
}

.node {
	position: relative;
	border: 1px solid rgba(0, 240, 255, 0.25);
	border-radius: 6px;
	background: #09192f;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow);
	padding: 0;
	overflow: hidden;
}

.node::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 5px;
	background: var(--blue);
}

.rtl .node::before {
	left: auto;
	right: 0;
}

.node-header {
	padding: 8px 12px;
	font-weight: 700;
	font-size: 13px;
	background: rgba(59, 130, 246, 0.15);
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: #fff;
}

.node-body {
	padding: 12px;
	font-size: 13px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	color: #cbd5e1;
}

.node-pin-in, .node-pin-out {
	display: flex;
	align-items: center;
	gap: 6px;
}

.pin-exec {
	width: 9px;
	height: 9px;
	border: 1px solid #fff;
	background: transparent;
	transform: rotate(45deg);
	display: inline-block;
}

.pin-data {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--cyan);
	display: inline-block;
}

/* Node Variants */
.node.event {
	border-color: rgba(239, 68, 68, 0.35);
	background: #250912;
}

.node.event::before {
	background: var(--red);
}

.node.event .node-header {
	background: rgba(239, 68, 68, 0.18);
	color: #fca5a5;
}

.node.action {
	border-color: rgba(16, 185, 129, 0.35);
	background: #092019;
}

.node.action::before {
	background: var(--green);
}

.node.action .node-header {
	background: rgba(16, 185, 129, 0.18);
	color: #a7f3d0;
}

.arrow {
	color: var(--cyan);
	font-weight: 800;
	text-align: center;
	font-size: 20px;
	margin: 4px 0;
	opacity: 0.7;
}

.toc {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 20px;
	margin-top: 30px;
}

.toc a {
	padding: 24px;
	border: 1px solid var(--line);
	border-radius: 16px;
	background: var(--panel);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.toc a:hover {
	border-color: var(--cyan);
	box-shadow: var(--glow-cyan);
	transform: translateY(-4px);
}

.toc strong {
	display: block;
	margin-bottom: 8px;
	font-size: 16px;
	color: #fff;
}

.toc span {
	color: var(--muted);
	font-size: 14px;
	line-height: 1.6;
}

/* Hero Center Box for index.html */
.content-center {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 20px;
}

.hero-center {
	max-width: 650px;
	width: 100%;
	text-align: center;
}

.hero-center .brand {
	justify-content: center;
	margin-bottom: 35px;
}

.hero-center .brand h1 {
	font-size: 24px;
}

@media (max-width: 900px) {
	.shell {
		grid-template-columns: 1fr;
	}

	.sidebar {
		position: relative;
		height: auto;
		border-right: 0;
		border-left: 0;
		border-bottom: 1px solid var(--line);
		padding: 25px 20px;
	}

	.content {
		padding: 30px 20px 60px;
	}

	.hero {
		padding: 30px;
	}

	.section {
		padding: 25px;
	}
}
