/* Bot editor styles */

html, body {
	height: 100%;
	margin: 0;
	background-color: #121417;
	color: #e2e8f0;
	font-family: system-ui, -apple-system, sans-serif;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

#view-editor {
	display: flex;
	flex: 1;
	min-height: 0;
	overflow: hidden;
}

.editor-sidebar {
	width: 220px;
	background: #1a1d23;
	border-right: 1px solid rgba(255, 255, 255, 0.08);
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
}

.sidebar-header {
	padding: 0.75rem 1rem;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.bot-list {
	flex: 1;
	overflow-y: auto;
}

.bot-list-item {
	padding: 0.6rem 1rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	font-size: 0.9rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.bot-list-item:hover {
	background: rgba(255, 255, 255, 0.04);
}

.bot-list-item.selected {
	background: rgba(255, 255, 255, 0.08);
	font-weight: 600;
}

.bot-name {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bot-badge {
	font-size: 0.65rem;
	margin-left: 0.5rem;
}

.bot-delete {
	opacity: 0.3;
	margin-left: 0.5rem;
	cursor: pointer;
}
.bot-delete:hover {
	opacity: 1;
	color: #ff5252;
}

.sidebar-footer {
	padding: 0.75rem;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.editor-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: #121417;
	min-width: 0;
}

.editor-toolbar {
	padding: 0.5rem 1rem;
	background: #1a1d23;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.editor-bot-name {
	font-weight: 700;
	font-size: 1rem;
}

.editor-bot-title-input {
	max-width: 200px;
	background: #121417;
	border: 1px solid rgba(255, 255, 255, 0.15);
	color: #fff;
}

.empty-state {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	opacity: 0.5;
}

.cm-wrapper {
	flex: 1;
	position: relative;
	min-height: 200px;
}

.CodeMirror {
	height: 100% !important;
	font-family: 'Fira Code', monospace;
	font-size: 0.9rem;
}

.resizer-horizontal {
	height: 6px;
	background: #1a1d23;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	cursor: row-resize;
	user-select: none;
	flex-shrink: 0;
	transition: background 150ms ease;
}

.resizer-horizontal:hover, .resizer-horizontal.resizing {
	background: #3b82f6;
}

.output-wrapper {
	height: 180px;
	min-height: 50px;
	max-height: 80%;
	display: flex;
	flex-direction: column;
	background: #16181d;
}

.output-header {
	padding: 0.4rem 1rem;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	background: #1a1d23;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.output-panel {
	flex: 1;
	padding: 0.75rem 1rem;
	overflow-y: auto;
	font-size: 0.85rem;
}

.output-empty { opacity: 0.4; }
.output-ok { color: #4caf50; }
.output-error { color: #f44336; }
.output-log { margin: 0; font-family: monospace; white-space: pre-wrap; }
.output-log-count { opacity: 0.5; font-size: 0.75rem; }

.docs-sidebar {
	width: 33.333vw;
	max-width: 33.333vw;
	min-width: 280px;
	background: #1a1d23;
	border-left: 1px solid rgba(255, 255, 255, 0.08);
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	position: relative;
}

.docs-header-bar {
	padding: 0.55rem 1rem;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #1a1d23;
	flex-shrink: 0;
}

.docs-toc-toggle-btn {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: #e2e8f0;
	border-radius: 4px;
	padding: 0.2rem 0.5rem;
	font-size: 0.75rem;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.docs-toc-toggle-btn:hover, .docs-toc-toggle-btn.active {
	background: #3b82f6;
	color: #fff;
	border-color: #3b82f6;
}

.docs-toc-drawer {
	position: absolute;
	top: 38px;
	right: 0;
	width: 230px;
	bottom: 0;
	background: #16181d;
	border-left: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: -4px 0 16px rgba(0, 0, 0, 0.4);
	z-index: 20;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	overflow: hidden;
}

.docs-toc-drawer.open {
	transform: translateX(0);
}

.docs-toc-list {
	padding: 0.75rem 0.5rem;
	overflow-y: auto;
	flex: 1;
}

.docs-toc-item {
	display: block;
	padding: 0.35rem 0.6rem;
	color: #94a3b8;
	text-decoration: none;
	font-size: 0.78rem;
	border-radius: 4px;
	transition: color 0.15s ease, background 0.15s ease;
}

.docs-toc-item:hover {
	color: #f8fafc;
	background: rgba(255, 255, 255, 0.05);
}

.docs-toc-item.active {
	color: #60a5fa;
	background: rgba(59, 130, 246, 0.15);
	font-weight: 600;
}

.docs-toc-subitem {
	padding-left: 1.25rem;
	font-size: 0.73rem;
}

.docs-content {
	flex: 1;
	padding: 1rem;
	overflow-y: auto;
	font-size: 0.82rem;
	line-height: 1.45;
	scroll-behavior: smooth;
}

.docs-content h6 {
	color: #90caf9;
	margin-top: 0.5rem;
	margin-bottom: 0.4rem;
}

.docs-content code, .docs-content pre {
	background: #121417;
	padding: 0.15rem 0.3rem;
	border-radius: 3px;
	color: #ffcc80;
	font-size: 0.8rem;
}

.docs-content pre {
	padding: 0.6rem 0.75rem;
	overflow-x: auto;
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 4px;
}

.docs-struct-card {
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 6px;
	padding: 0.75rem;
}

.deploy-status {
	padding: 0.4rem 1rem;
	font-size: 0.82rem;
}
.deploy-status-ok { background: rgba(76, 175, 80, 0.15); color: #81c784; }
.deploy-status-error { background: rgba(244, 67, 54, 0.15); color: #e57373; }
.deploy-status-pending { background: rgba(255, 193, 7, 0.15); color: #ffd54f; }

.text-muted {
	color: #938a82 !important;
}
