/* =========================================
 GLOBAL VARIABLES (DARK THEME)
 ========================================= */
:root {
	--accent-color: #FF375F; /* Vibrant accent color for call-to-actions and links */
	
	--bg-primary: #1e1e1e;   /* Main background for textual content */
	--bg-secondary: #252526; /* Background for sidebar, header, and segment boxes */
	
	--text-primary: #e0e0e0; /* High contrast text */
	--text-secondary: #9e9e9e; /* Support text (e.g., captions) */
	
	--border-color: #333333; /* Color for all divider lines and borders */
}

/* =========================================
 BASE STRUCTURE AND PANEL LAYOUT
 ========================================= */
body {
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	height: 100vh; /* Lock height to viewport */
	overflow: hidden; /* Prevent entire window from scrolling */
	background-color: var(--bg-primary);
	color: var(--text-primary);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.6;
}

/* =========================================
 TOP BAR (HEADER)
 ========================================= */
.manual-header {
	height: 100px;
	flex-shrink: 0; /* Prevent top bar from shrinking */
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 30px;
	background-color: var(--bg-secondary);
	border-bottom: 1px solid var(--border-color);
}

.header-left, .header-right {
	display: flex;
	align-items: center;
	height: 100%;
	width: 200px; /* Fixed width to perfectly center the title */
}

.header-right {
	justify-content: flex-end;
}

.header-center {
	text-align: center;
	flex: 1;
}

.header-app-icon, .header-app-logo {
	max-height: 70px;
	width: auto;
	object-fit: contain;
}

.header-app-name {
	font-size: 1.6em;
	font-weight: 700;
	color: var(--text-primary);
	margin-bottom: 2px;
}

.header-manual-title {
	color: var(--accent-color);
	font-size: 0.85em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1.5px;
}

/* =========================================
 COLUMNS: SIDEBAR AND MAIN CONTENT
 ========================================= */
.manual-body-container {
	display: flex;
	flex: 1;
	overflow: hidden; /* Contains the scrollable columns */
}

/* Left sidebar */
.manual-sidebar {
	width: 280px;
	flex-shrink: 0;
	background-color: var(--bg-secondary);
	border-right: 1px solid var(--border-color);
	overflow-y: auto; /* Independent scrolling */
	padding: 30px 0;
}

.sidebar-nav-title {
	padding: 0 30px;
	font-size: 0.75em;
	font-weight: 800;
	color: var(--text-secondary);
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 12px;
}

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

.sidebar-nav-item {
	margin: 0;
}

.sidebar-nav-link {
	display: block;
	padding: 10px 30px;
	color: var(--text-primary);
	text-decoration: none;
	font-size: 0.95em;
	transition: all 0.2s ease;
}

.sidebar-nav-link:hover {
	color: var(--accent-color);
	background-color: rgba(255, 107, 0, 0.08); /* Very light orange background on hover */
	border-right: 3px solid var(--accent-color);
}

/* Right HTML content */
.manual-main-content {
	flex: 1;
	overflow-y: auto; /* Main scrolling */
	padding: 40px;
	scroll-behavior: smooth;
}

.manual-container {
	max-width: 860px; /* Optimal width for reading */
	margin: 0 auto;
}

/* =========================================
 TYPOGRAPHY AND TEXT BLOCKS
 ========================================= */
h1, h2, h3, h4, h5, h6 {
	color: var(--text-primary);
}

h2 {
	font-size: 2em;
	margin-top: 0;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--border-color);
}

h3.subsection-title {
	font-size: 1.4em;
	margin-top: 40px;
	margin-bottom: 20px;
	color: var(--accent-color);
}

.section-divider {
	border: 0;
	border-top: 1px solid var(--border-color);
	margin: 60px 0;
}

p, li {
	font-size: 1.05em;
	color: var(--text-primary);
}

a {
	color: var(--accent-color);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

.index-list {
	list-style: none;
	padding: 0;
	margin: 20px 0;
}

.index-list li {
	margin-bottom: 10px;
	font-size: 1.1em;
}

.note {
	background-color: var(--bg-secondary);
	border-left: 4px solid var(--accent-color);
	padding: 16px 20px;
	margin-bottom: 24px;
	border-radius: 0 6px 6px 0;
}

.note p:last-child {
	margin-bottom: 0;
}

/* =========================================
 MAIN IMAGES (OPTION B - FLAT)
 ========================================= */
.image-container {
	margin: 30px 0;
	text-align: center;
}

.manual-image {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	border: 1px solid var(--border-color); /* Integrated and flat design */
	display: block;
	margin: 0 auto;
}

.image-description {
	margin-top: 12px;
	font-size: 0.95em;
	color: var(--text-secondary);
	text-align: left;
	padding: 0 10px;
}

/* =========================================
 SEGMENTS AND CROPS (NATIVE & CLEAN)
 ========================================= */
.segments-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 24px;
	margin-bottom: 48px;
}

.segment-item {
	display: flex;
	flex-direction: column; /* Changed to column to always place image above text */
	gap: 20px;
	background-color: var(--bg-secondary);
	border: 1px solid var(--border-color);
	border-radius: 10px;
	padding: 20px;
}

.segment-crop-container {
	width: 100%; /* Takes the full width of the segment box */
	background-color: var(--bg-primary);
	border: 1px solid var(--border-color);
	border-radius: 6px;
	padding: 10px;
	box-sizing: border-box;
	display: flex;
	justify-content: center; /* Centers the image if it's smaller than the container */
	align-items: center;
}

.segment-crop {
	max-width: 100%;
	height: auto;
	display: block;
	border-radius: 4px;
}

.segment-content {
	width: 100%;
}

.segment-title {
	font-weight: 700;
	font-size: 1.15em;
	color: var(--accent-color);
	margin-bottom: 12px;
}

.segment-description {
	color: var(--text-primary);
	line-height: 1.5;
	margin: 0;
}

.segment-description p {
	font-size: 0.95em;
	margin-top: 0;
}

.segment-description ul {
	margin-bottom: 0;
	padding-left: 20px;
}

/* =========================================
 INLINE MARKDOWN FORMATTING
 ========================================= */
strong {
	font-weight: 700;
	color: #ffffff; /* Makes bold text stand out against normal text */
}

code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	background-color: rgba(255, 255, 255, 0.1);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 0.9em;
	color: #ffffff;
}
