/* ApiDoc Widget Styles */

.bricks-apidoc {
	display: flex;
	flex-direction: column;
	height: 100%;
	width: 100%;
	overflow: hidden;
	background: var(--bg-card, #1a1a2e);
	color: var(--text-primary, #e0e0e0);
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bricks-apidoc-header {
	padding: 16px 20px;
	border-bottom: 1px solid var(--border-color, #2a2a4a);
	flex-shrink: 0;
}

.bricks-apidoc-title {
	font-size: 1.4em;
	font-weight: 700;
	color: var(--text-primary, #fff);
}

.bricks-apidoc-baseurl {
	font-size: 0.85em;
	color: var(--text-dim, #888);
	margin-top: 4px;
	font-family: 'SFMono-Regular', Consolas, monospace;
}

/* Body: sidebar + content */
.bricks-apidoc-body {
	display: flex;
	flex: 1;
	overflow: hidden;
}

/* Sidebar */
.bricks-apidoc-sidebar {
	width: 240px;
	min-width: 200px;
	border-right: 1px solid var(--border-color, #2a2a4a);
	overflow-y: auto;
	padding: 8px 0;
	flex-shrink: 0;
}

.bricks-apidoc-nav-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	cursor: pointer;
	transition: background 0.15s;
	font-size: 0.88em;
	border-left: 3px solid transparent;
}

.bricks-apidoc-nav-item:hover {
	background: var(--bg-hover, rgba(255,255,255,0.05));
}

.bricks-apidoc-nav-item.active {
	background: var(--bg-active, rgba(100,140,255,0.1));
	border-left-color: var(--accent-blue, #648cff);
}

.bricks-apidoc-nav-path {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--text-secondary, #bbb);
}

.bricks-apidoc-nav-item.active .bricks-apidoc-nav-path {
	color: var(--text-primary, #fff);
}

/* Method badges */
.bricks-apidoc-method-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 0.75em;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	flex-shrink: 0;
}

.bricks-apidoc-method-get {
	background: rgba(34,197,94,0.15);
	color: #22c55e;
}

.bricks-apidoc-method-post {
	background: rgba(59,130,246,0.15);
	color: #3b82f6;
}

.bricks-apidoc-method-put {
	background: rgba(249,115,22,0.15);
	color: #f97316;
}

.bricks-apidoc-method-delete {
	background: rgba(239,68,68,0.15);
	color: #ef4444;
}

.bricks-apidoc-method-patch {
	background: rgba(168,85,247,0.15);
	color: #a855f7;
}

/* Content area */
.bricks-apidoc-content {
	flex: 1;
	overflow-y: auto;
	padding: 20px 28px;
	scroll-behavior: smooth;
}

/* Section */
.bricks-apidoc-section {
	margin-bottom: 40px;
	padding-bottom: 32px;
	border-bottom: 1px solid var(--border-color, #2a2a4a);
}

.bricks-apidoc-section:last-child {
	border-bottom: none;
}

.bricks-apidoc-section-title {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
}

.bricks-apidoc-section-title .bricks-apidoc-method-badge {
	font-size: 0.8em;
	padding: 4px 10px;
}

.bricks-apidoc-path {
	font-family: 'SFMono-Regular', Consolas, monospace;
	font-size: 0.95em;
	color: var(--text-primary, #fff);
	word-break: break-all;
}

/* Subsection headings (h3) */
.bricks-apidoc-subsection,
.bricks-apidoc-section h3 {
	font-size: 1em;
	font-weight: 600;
	color: var(--text-secondary, #ccc);
	margin: 20px 0 10px 0;
	padding-bottom: 6px;
	border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.06));
}

/* Tables */
.bricks-apidoc-table,
.bricks-apidoc-section table {
	width: 100%;
	border-collapse: collapse;
	margin: 10px 0;
	font-size: 0.88em;
}

.bricks-apidoc-table th,
.bricks-apidoc-section table th {
	background: var(--bg-elevated, rgba(255,255,255,0.04));
	text-align: left;
	padding: 8px 12px;
	border: 1px solid var(--border-color, #2a2a4a);
	color: var(--text-secondary, #aaa);
	font-weight: 600;
}

.bricks-apidoc-table td,
.bricks-apidoc-section table td {
	padding: 8px 12px;
	border: 1px solid var(--border-color, #2a2a4a);
	color: var(--text-primary, #ddd);
}

.bricks-apidoc-table tr:hover td,
.bricks-apidoc-section table tr:hover td {
	background: var(--bg-hover, rgba(255,255,255,0.03));
}

/* Inline code */
.bricks-apidoc-section code {
	background: var(--bg-elevated, rgba(255,255,255,0.08));
	padding: 1px 6px;
	border-radius: 3px;
	font-size: 0.9em;
	font-family: 'SFMono-Regular', Consolas, monospace;
	color: #e0a8ff;
}

/* Code blocks */
.bricks-apidoc-code-wrapper {
	position: relative;
	margin: 12px 0;
}

.bricks-apidoc-code-wrapper pre {
	background: var(--bg-code, #0d1117) !important;
	border: 1px solid var(--border-color, #2a2a4a);
	border-radius: 6px;
	padding: 14px 16px;
	overflow-x: auto;
	font-size: 0.85em;
	line-height: 1.5;
	margin: 0;
}

.bricks-apidoc-code-wrapper pre code {
	background: none;
	padding: 0;
	color: #c9d1d9;
	font-family: 'SFMono-Regular', Consolas, monospace;
}

/* Copy button */
.bricks-apidoc-copy-btn {
	position: absolute;
	top: 8px;
	right: 8px;
	background: var(--bg-elevated, rgba(255,255,255,0.1));
	border: 1px solid var(--border-color, #2a2a4a);
	color: var(--text-secondary, #aaa);
	padding: 3px 10px;
	border-radius: 4px;
	font-size: 0.75em;
	cursor: pointer;
	transition: all 0.15s;
	opacity: 0;
}

.bricks-apidoc-code-wrapper:hover .bricks-apidoc-copy-btn {
	opacity: 1;
}

.bricks-apidoc-copy-btn:hover {
	background: var(--bg-hover, rgba(255,255,255,0.15));
	color: var(--text-primary, #fff);
}

/* Description paragraphs */
.bricks-apidoc-section p {
	margin: 8px 0;
	line-height: 1.6;
	color: var(--text-secondary, #ccc);
}

/* Horizontal rules */
.bricks-apidoc-section hr {
	border: none;
	border-top: 1px solid var(--border-color, #2a2a4a);
	margin: 16px 0;
}

/* Error state */
.bricks-apidoc-error {
	padding: 20px;
	color: #ef4444;
	text-align: center;
}

/* Responsive: hide sidebar on narrow widths */
@media (max-width: 700px) {
	.bricks-apidoc-sidebar {
		display: none;
	}
}

/* Category group label in sidebar (H1) */
.bricks-apidoc-nav-category {
	padding: 12px 16px 4px 16px;
	font-size: 0.75em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: var(--text-dim, #777);
	margin-top: 8px;
	border-top: 1px solid var(--border-color, rgba(255,255,255,0.06));
}

.bricks-apidoc-nav-category:first-child {
	margin-top: 0;
	border-top: none;
}

/* Indent nav items under a category */
.bricks-apidoc-nav-category ~ .bricks-apidoc-nav-item {
	padding-left: 24px;
}
