/* =============================================================================
   KMB ConnectUC User Guide — Frontend Styles
   Brand Palette:
     --brand:      #1D1B4C  deep navy
     --brand-mid:  #1E73BE  primary blue
     --brand-lt:   #D4E8F7  light blue
     --brand-xlt:  #EBF5FD  extra-light blue
     --accent:     #4E97D8  secondary blue
     --text:       #333333  body text
   Fonts: Poppins (headings/UI), Open Sans (body)
   =========================================================================== */

/* ── CSS Custom Properties ──────────────────────────────────────────────── */
.kmb-guide-wrap,
.kmb-float-btn,
.kmb-float-drawer {
	--brand:      #1D1B4C;
	--brand-mid:  #1E73BE;
	--brand-lt:   #D4E8F7;
	--brand-xlt:  #EBF5FD;
	--accent:     #4E97D8;
	--text:       #333333;
	--text-light: #666666;
	--white:      #FFFFFF;
	--border:     #D0DEE9;
	--radius:     6px;
	--shadow:     0 2px 12px rgba(30,115,190,0.12);
	--shadow-lg:  0 8px 32px rgba(29,27,76,0.18);
	--note-bg:    #EDF3FB;
	--note-bdr:   #1E73BE;
	--tip-bg:     #EAF5EA;
	--tip-bdr:    #2E8B57;
	--warn-bg:    #FFF8E1;
	--warn-bdr:   #F59E0B;
	font-family: 'Open Sans', Arial, sans-serif;
	color: var(--text);
	box-sizing: border-box;
}

*, *::before, *::after { box-sizing: inherit; }

/* ── Search Bar ─────────────────────────────────────────────────────────── */
.kmb-guide-search-bar {
	display: flex;
	align-items: center;
	background: var(--white);
	border: 2px solid var(--brand-mid);
	border-radius: 30px;
	padding: 8px 16px;
	margin-bottom: 20px;
	gap: 8px;
	box-shadow: var(--shadow);
}

.kmb-guide-search-bar .dashicons {
	color: var(--brand-mid);
	font-size: 18px;
	flex-shrink: 0;
}

.kmb-guide-search-bar input {
	flex: 1;
	border: none;
	outline: none;
	font-family: 'Open Sans', Arial, sans-serif;
	font-size: 15px;
	color: var(--text);
	background: transparent;
}

.kmb-guide-search-bar input::placeholder {
	color: var(--text-light);
}

.kmb-guide-search-clear {
	background: none;
	border: none;
	color: var(--text-light);
	cursor: pointer;
	font-size: 16px;
	padding: 0 4px;
	display: none;
	line-height: 1;
}

.kmb-guide-search-clear:hover {
	color: var(--brand-mid);
}

.kmb-guide-search-results {
	background: var(--white);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	display: none;
	margin-bottom: 20px;
	max-height: 300px;
	overflow-y: auto;
}

.kmb-guide-search-results.kmb-has-results {
	display: block;
}

.kmb-search-result-item {
	padding: 12px 16px;
	border-bottom: 1px solid var(--brand-xlt);
	cursor: pointer;
	transition: background 0.15s;
}

.kmb-search-result-item:last-child {
	border-bottom: none;
}

.kmb-search-result-item:hover {
	background: var(--brand-xlt);
}

.kmb-search-result-item .kmb-result-title {
	font-family: 'Poppins', sans-serif;
	font-size: 14px;
	font-weight: 600;
	color: var(--brand-mid);
}

.kmb-search-result-item .kmb-result-excerpt {
	font-size: 13px;
	color: var(--text-light);
	margin-top: 2px;
}

.kmb-search-result-item .kmb-result-excerpt mark {
	background: var(--brand-lt);
	color: var(--brand);
	padding: 0 2px;
	border-radius: 2px;
}

.kmb-search-no-results {
	padding: 16px;
	color: var(--text-light);
	font-size: 14px;
	text-align: center;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.kmb-guide-wrap {
	max-width: 1200px;
	margin: 0 auto;
}

.kmb-guide-layout {
	display: flex;
	gap: 32px;
	align-items: flex-start;
}

/* ── Sidebar Navigation ─────────────────────────────────────────────────── */
.kmb-guide-sidebar {
	width: 260px;
	flex-shrink: 0;
	position: sticky;
	top: 80px;
	max-height: calc(100vh - 100px);
	overflow-y: auto;
	background: var(--brand);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	scrollbar-width: thin;
	scrollbar-color: var(--brand-mid) var(--brand);
}

.kmb-guide-sidebar::-webkit-scrollbar {
	width: 5px;
}
.kmb-guide-sidebar::-webkit-scrollbar-track {
	background: var(--brand);
}
.kmb-guide-sidebar::-webkit-scrollbar-thumb {
	background: var(--brand-mid);
	border-radius: 4px;
}

.kmb-guide-sidebar-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 18px 20px 14px;
	border-bottom: 1px solid rgba(255,255,255,0.1);
	font-family: 'Poppins', sans-serif;
	font-size: 13px;
	font-weight: 600;
	color: var(--brand-lt);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.kmb-guide-sidebar-header .dashicons {
	font-size: 18px;
	color: var(--brand-lt);
}

.kmb-guide-sidebar ul {
	list-style: none;
	margin: 0;
	padding: 8px 0;
}

.kmb-guide-sidebar ul li {
	margin: 0;
	padding: 0;
}

.kmb-guide-sidebar ul li a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 20px;
	font-size: 14px;
	color: rgba(255,255,255,0.80);
	text-decoration: none;
	transition: background 0.15s, color 0.15s, padding-left 0.15s;
	border-left: 3px solid transparent;
	line-height: 1.4;
}

.kmb-guide-sidebar ul li a .dashicons {
	font-size: 16px;
	flex-shrink: 0;
	opacity: 0.75;
}

.kmb-guide-sidebar ul li a:hover {
	background: rgba(255,255,255,0.08);
	color: var(--white);
	padding-left: 26px;
}

.kmb-guide-sidebar ul li a:hover .dashicons {
	opacity: 1;
}

.kmb-guide-sidebar ul li a.kmb-nav-active {
	background: rgba(78,151,216,0.25);
	color: var(--white);
	border-left-color: var(--accent);
	font-weight: 600;
}

.kmb-guide-sidebar ul li a.kmb-nav-active .dashicons {
	opacity: 1;
	color: var(--accent);
}

/* ── Main Content ───────────────────────────────────────────────────────── */
.kmb-guide-content {
	flex: 1;
	min-width: 0;
}

.kmb-guide-intro {
	background: var(--brand-xlt);
	border-left: 4px solid var(--brand-mid);
	border-radius: var(--radius);
	padding: 18px 22px;
	margin-bottom: 32px;
	font-size: 15px;
	color: var(--text);
	line-height: 1.7;
}

/* ── Section Cards ──────────────────────────────────────────────────────── */
.kmb-guide-section {
	background: var(--white);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	margin-bottom: 28px;
	overflow: hidden;
	transition: box-shadow 0.2s;
}

.kmb-guide-section:target,
.kmb-guide-section.kmb-section-active {
	box-shadow: 0 0 0 3px var(--accent), var(--shadow);
}

.kmb-guide-section-header {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px 24px;
	background: linear-gradient(135deg, var(--brand) 0%, #2A2870 100%);
	cursor: pointer;
	user-select: none;
}

.kmb-section-icon {
	font-size: 22px !important;
	color: var(--brand-lt);
	flex-shrink: 0;
}

.kmb-section-title {
	font-family: 'Poppins', sans-serif;
	font-size: 18px;
	font-weight: 700;
	color: var(--white) !important;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1.3;
	flex: 1;
}

/* Collapse toggle arrow */
.kmb-guide-section-header::after {
	content: '\f142'; /* dashicons-arrow-down-alt2 */
	font-family: dashicons;
	font-size: 20px;
	color: rgba(255,255,255,0.6);
	transition: transform 0.25s;
	margin-left: auto;
	flex-shrink: 0;
}

.kmb-guide-section.kmb-collapsed .kmb-guide-section-header::after {
	transform: rotate(-90deg);
}

.kmb-guide-section-body {
	padding: 24px;
	line-height: 1.75;
	font-size: 15px;
}

.kmb-guide-section.kmb-collapsed .kmb-guide-section-body {
	display: none;
}

/* Body typography */
.kmb-guide-section-body h3 {
	font-family: 'Poppins', sans-serif;
	font-size: 15px;
	font-weight: 700;
	color: var(--brand);
	margin: 24px 0 10px;
	padding-bottom: 6px;
	border-bottom: 2px solid var(--brand-lt);
}

.kmb-guide-section-body h3:first-child {
	margin-top: 0;
}

.kmb-guide-section-body p {
	margin: 0 0 14px;
}

.kmb-guide-section-body ul,
.kmb-guide-section-body ol {
	margin: 0 0 14px 0;
	padding-left: 24px;
}

.kmb-guide-section-body li {
	margin-bottom: 6px;
}

.kmb-guide-section-body a {
	color: var(--brand-mid);
	text-decoration: underline;
}

.kmb-guide-section-body a:hover {
	color: var(--brand);
}

.kmb-guide-section-body code {
	background: var(--brand-xlt);
	border: 1px solid var(--brand-lt);
	border-radius: 3px;
	padding: 2px 6px;
	font-family: 'Courier New', monospace;
	font-size: 0.9em;
	color: var(--brand);
}

.kmb-guide-section-body strong {
	color: var(--brand);
}

/* ── Callout Boxes ──────────────────────────────────────────────────────── */
.kmb-callout {
	border-radius: var(--radius);
	padding: 14px 18px;
	margin: 18px 0;
	font-size: 14px;
	line-height: 1.6;
	border-left: 4px solid;
}

.kmb-callout strong:first-child {
	display: block;
	margin-bottom: 4px;
	font-family: 'Poppins', sans-serif;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.kmb-note {
	background: var(--note-bg);
	border-color: var(--note-bdr);
	color: #1a3a5c;
}

.kmb-note strong:first-child {
	color: var(--note-bdr);
}

.kmb-tip {
	background: var(--tip-bg);
	border-color: var(--tip-bdr);
	color: #1a3d2b;
}

.kmb-tip strong:first-child {
	color: var(--tip-bdr);
}

.kmb-warning {
	background: var(--warn-bg);
	border-color: var(--warn-bdr);
	color: #5a3a00;
}

.kmb-warning strong:first-child {
	color: var(--warn-bdr);
}

/* ── Feature Card Grid ──────────────────────────────────────────────────── */
.kmb-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 14px;
	margin: 18px 0;
}

.kmb-card {
	background: var(--brand-xlt);
	border: 1px solid var(--brand-lt);
	border-radius: var(--radius);
	padding: 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	transition: box-shadow 0.2s, transform 0.2s;
}

.kmb-card:hover {
	box-shadow: var(--shadow);
	transform: translateY(-2px);
}

.kmb-card .dashicons {
	font-size: 22px;
	color: var(--brand-mid);
}

.kmb-card strong {
	font-family: 'Poppins', sans-serif;
	font-size: 13px;
	font-weight: 600;
	color: var(--brand);
}

.kmb-card p,
.kmb-card span {
	font-size: 13px;
	color: var(--text-light);
	margin: 0;
	line-height: 1.5;
}

@media (max-width: 600px) {
	.kmb-card-grid {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 380px) {
	.kmb-card-grid {
		grid-template-columns: 1fr;
	}
}

/* ── Quick Reference Table ──────────────────────────────────────────────── */
.kmb-quick-ref .kmb-guide-section-header {
	background: linear-gradient(135deg, #1D4E72 0%, #1E73BE 100%);
}

.kmb-quick-ref-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	margin-top: 8px;
}

.kmb-quick-ref-table thead th {
	background: var(--brand);
	color: var(--white);
	font-family: 'Poppins', sans-serif;
	font-size: 13px;
	font-weight: 600;
	padding: 10px 16px;
	text-align: left;
}

.kmb-quick-ref-table thead th:first-child {
	border-radius: var(--radius) 0 0 0;
}

.kmb-quick-ref-table thead th:last-child {
	border-radius: 0 var(--radius) 0 0;
}

.kmb-quick-ref-table tbody tr:nth-child(odd) {
	background: var(--white);
}

.kmb-quick-ref-table tbody tr:nth-child(even) {
	background: var(--brand-xlt);
}

.kmb-quick-ref-table tbody tr:hover {
	background: var(--brand-lt);
}

.kmb-quick-ref-table tbody td {
	padding: 10px 16px;
	border-bottom: 1px solid var(--border);
	vertical-align: top;
}

.kmb-quick-ref-table tbody td:first-child {
	font-weight: 600;
	color: var(--brand);
	white-space: nowrap;
}

/* ── Floating Help Button ───────────────────────────────────────────────── */
.kmb-float-btn {
	position: fixed;
	z-index: 99998;
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--brand);
	color: var(--white);
	border: none;
	border-radius: 30px;
	padding: 12px 20px;
	font-family: 'Poppins', sans-serif;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: var(--shadow-lg);
	transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.kmb-float-btn:hover {
	background: var(--brand-mid);
	transform: translateY(-2px);
	box-shadow: 0 12px 36px rgba(29,27,76,0.25);
}

.kmb-float-btn .dashicons {
	font-size: 18px;
}

/* Position variants */
.kmb-float-btn.kmb-pos-bottom-right { bottom: 28px; right: 28px; }
.kmb-float-btn.kmb-pos-bottom-left  { bottom: 28px; left: 28px; }
.kmb-float-btn.kmb-pos-top-right    { top: 90px;    right: 28px; }
.kmb-float-btn.kmb-pos-top-left     { top: 90px;    left: 28px; }

/* ── Floating Drawer ────────────────────────────────────────────────────── */
.kmb-float-drawer {
	position: fixed;
	z-index: 99997;
	bottom: 90px;
	right: 28px;
	width: min(420px, calc(100vw - 40px));
	max-height: 75vh;
	background: var(--white);
	border-radius: 12px;
	box-shadow: var(--shadow-lg);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform: translateY(20px);
	opacity: 0;
	pointer-events: none;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.kmb-float-drawer.kmb-float-open {
	transform: translateY(0);
	opacity: 1;
	pointer-events: auto;
}

/* Reposition if button is bottom-left */
.kmb-float-btn.kmb-pos-bottom-left ~ .kmb-float-drawer {
	left: 28px;
	right: auto;
}

.kmb-float-drawer-header {
	background: var(--brand);
	color: var(--white);
	padding: 16px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.kmb-float-drawer-header h3 {
	margin: 0;
	font-family: 'Poppins', sans-serif;
	font-size: 16px;
	font-weight: 700;
	color: var(--white);
}

.kmb-float-drawer-close {
	background: none;
	border: none;
	color: rgba(255,255,255,0.7);
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
	padding: 0;
	transition: color 0.15s;
}

.kmb-float-drawer-close:hover {
	color: var(--white);
}

.kmb-float-drawer-search {
	padding: 12px 16px;
	border-bottom: 1px solid var(--border);
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.kmb-float-drawer-search input {
	flex: 1;
	border: 1px solid var(--border);
	border-radius: 20px;
	padding: 8px 14px;
	font-size: 14px;
	font-family: 'Open Sans', Arial, sans-serif;
	outline: none;
	color: var(--text);
}

.kmb-float-drawer-search input:focus {
	border-color: var(--brand-mid);
}

.kmb-float-drawer-search .dashicons {
	color: var(--brand-mid);
}

.kmb-float-drawer-body {
	overflow-y: auto;
	flex: 1;
	padding: 0;
}

/* Section list in drawer */
.kmb-drawer-section-list {
	list-style: none;
	margin: 0;
	padding: 8px 0;
}

.kmb-drawer-section-list li a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 20px;
	color: var(--text);
	text-decoration: none;
	font-size: 14px;
	border-bottom: 1px solid var(--brand-xlt);
	transition: background 0.15s;
}

.kmb-drawer-section-list li a:hover {
	background: var(--brand-xlt);
	color: var(--brand-mid);
}

.kmb-drawer-section-list li a .dashicons {
	color: var(--brand-mid);
	font-size: 16px;
	flex-shrink: 0;
}

.kmb-drawer-full-guide {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 16px;
	background: var(--brand-xlt);
	border-top: 1px solid var(--border);
	text-decoration: none;
	color: var(--brand-mid);
	font-family: 'Poppins', sans-serif;
	font-size: 14px;
	font-weight: 600;
	transition: background 0.15s;
	flex-shrink: 0;
}

.kmb-drawer-full-guide:hover {
	background: var(--brand-lt);
}

/* ── Empty State ────────────────────────────────────────────────────────── */
.kmb-guide-empty {
	background: var(--brand-xlt);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 24px;
	color: var(--text-light);
	text-align: center;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
	.kmb-guide-layout {
		flex-direction: column;
	}

	.kmb-guide-sidebar {
		width: 100%;
		position: static;
		max-height: none;
	}

	/* Collapsible sidebar on mobile */
	.kmb-guide-sidebar.kmb-sidebar-collapsed ul {
		display: none;
	}

	.kmb-guide-sidebar-header {
		cursor: pointer;
	}

	.kmb-guide-sidebar-header::after {
		content: '\f140'; /* dashicons-arrow-down */
		font-family: dashicons;
		font-size: 18px;
		color: var(--brand-lt);
		margin-left: auto;
		transition: transform 0.2s;
	}

	.kmb-guide-sidebar.kmb-sidebar-collapsed .kmb-guide-sidebar-header::after {
		transform: rotate(-90deg);
	}
}

@media (max-width: 600px) {
	.kmb-guide-section-body {
		padding: 16px;
	}

	.kmb-guide-section-header {
		padding: 14px 16px;
	}

	.kmb-section-title {
		font-size: 16px !important;
	}

	.kmb-quick-ref-table {
		font-size: 13px;
	}

	.kmb-quick-ref-table tbody td:first-child {
		white-space: normal;
	}

	.kmb-float-btn {
		padding: 10px 16px;
		font-size: 13px;
	}

	.kmb-float-btn.kmb-pos-bottom-right { bottom: 16px; right: 16px; }
	.kmb-float-btn.kmb-pos-bottom-left  { bottom: 16px; left: 16px; }

	.kmb-float-drawer {
		bottom: 72px;
		right: 16px;
		width: calc(100vw - 32px);
	}
}

/* ── Print ──────────────────────────────────────────────────────────────── */
@media print {
	.kmb-guide-sidebar,
	.kmb-guide-search-bar,
	.kmb-float-btn,
	.kmb-float-drawer {
		display: none !important;
	}

	.kmb-guide-layout {
		display: block;
	}

	.kmb-guide-section {
		box-shadow: none;
		border: 1px solid #ccc;
		break-inside: avoid;
		margin-bottom: 20px;
	}

	.kmb-guide-section.kmb-collapsed .kmb-guide-section-body {
		display: block !important;
	}

	.kmb-guide-section-header {
		background: #1D1B4C !important;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}
}
