:root {
	--bg: #f0f2f5;
	--panel: #ffffff;
	--accent: #2c3e50;
	--btn: #3498db;
	--log-bg: #1e1e1e;
}

body {
	font-family: 'Segoe UI', sans-serif;
	margin: 0;
	display: flex;
	flex-direction: column;
	height: 100vh;
	background: var(--bg);
	overflow: hidden;
}

header {
	background: var(--accent);
	color: white;
	padding: 10px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.main-container {
	display: flex;
	flex: 1;
	overflow: hidden;
}

.editor-side {
	width: 35vw;
	display: flex;
	flex-direction: column;
	border-right: 1px solid #ccc;
	background: var(--panel);
}

.resizer {
	width: 5px;
	height: 100%;
	background: #ccc;
	cursor: ew-resize;
	user-select: none;
}

.tabs {
	display: flex;
	background: #ddd;
}

.tab-btn {
	flex: 1;
	padding: 12px;
	border: none;
	cursor: pointer;
	background: #ddd;
	transition: 0.3s;
}

.tab-btn.active {
	background: var(--panel);
	font-weight: bold;
	border-top: 3px solid var(--btn);
}

textarea {
	flex: 1;
	padding: 15px;
	font-family: 'Consolas', monospace;
	border: none;
	outline: none;
	font-size: 13px;
	line-height: 1.5;
	resize: none;
}

/* Console de Logs */
#error-log-container {
	height: 120px;
	background: var(--log-bg);
	color: #ff5f56;
	display: flex;
	flex-direction: column;
	border-top: 1px solid #333;
	transition: height 0.3s ease;
}

#error-log-container.collapsed {
	height: 30px;
}

#error-log-header {
	background: #333;
	color: #aaa;
	padding: 4px 10px;
	font-size: 10px;
	font-weight: bold;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

#error-log-header .toggle-icon {
	transition: transform 0.3s ease;
}

#error-log-container.collapsed .toggle-icon {
	transform: rotate(180deg);
}

#error-log-content {
	padding: 10px;
	overflow-y: auto;
	flex: 1;
	font-family: monospace;
	font-size: 11px;
	white-space: pre-wrap;
	transition: opacity 0.3s ease;
}

#error-log-container.collapsed #error-log-content {
	opacity: 0;
	pointer-events: none;
}

.indicator {
	background: #ff5f56;
	color: white;
	border-radius: 50%;
	width: 16px;
	height: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	font-weight: bold;
}

.indicator.hidden {
	display: none;
}

.controls {
	padding: 10px;
	background: #f8f9fa;
	border-top: 1px solid #eee;
	display: flex;
	gap: 10px;
}

/* Zone de Preview et Zoom */
.preview-side {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: #e0e0e0;
	position: relative;
}

.scene {
	flex: 1;
	overflow: hidden;
	position: relative;
	background: #f5f5f5;
	border: 1px solid #ddd;
	margin: 10px;
	border-radius: 8px;
}

/* Panneau de zoom épuré et fixe */
.zoom-panel {
	position: absolute;
	bottom: 20px;
	right: 20px;
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(8px);
	border: 1px solid rgba(0, 0, 0, 0.1);
	padding: 8px 16px;
	border-radius: 25px;
	display: flex;
	align-items: center;
	gap: 10px;
	z-index: 1000;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	transition: opacity 0.3s;
}

.zoom-panel:hover {
	background: rgba(255, 255, 255, 1);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.zoom-panel button {
	background: none;
	border: none;
	color: #333;
	font-size: 18px;
	font-weight: bold;
	cursor: pointer;
	padding: 4px 8px;
	line-height: 1;
	border-radius: 4px;
	transition: background 0.2s;
}

.zoom-panel button:hover {
	background: #f0f0f0;
}

.zoom-panel span {
	font-size: 12px;
	font-family: monospace;
	color: #666;
	min-width: 35px;
	text-align: center;
}

.zoom-slider-container input {
	width: 70px;
	height: 4px;
	cursor: pointer;
	accent-color: var(--btn);
	vertical-align: middle;
}

#render-container {
	position: absolute;
	top: 50%;
	left: 50%;
	transform-origin: center;
	transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
	min-width: 100px;
	min-height: 100px;
	display: flex;
	justify-content: center;
	align-items: center;
}

[id^='dmermaid'],
.mermaidTooltip {
	display: none !important;
}

img#plantuml-img,
#mermaid-output svg {
	background: white;
	padding: 20px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
	background: linear-gradient(135deg, var(--btn), #2980b9);
	color: white;
	border: none;
	padding: 10px 20px;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
	box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
	transition: all 0.3s ease;
}

.btn-primary:hover {
	background: linear-gradient(135deg, #2980b9, var(--btn));
	box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
	transform: translateY(-2px);
}

.btn-download {
	background: linear-gradient(135deg, #27ae60, #2ecc71);
	color: white;
	border: none;
	padding: 10px 20px;
	border-radius: 8px;
	cursor: pointer;
	font-weight: 600;
	box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
	transition: all 0.3s ease;
}

.btn-download:hover {
	background: linear-gradient(135deg, #2ecc71, #27ae60);
	box-shadow: 0 6px 16px rgba(39, 174, 96, 0.4);
	transform: translateY(-2px);
}

.tool-btn {
	padding: 5px 10px;
	border: 1px solid #ccc;
	background: white;
	cursor: pointer;
}

.tool-btn.active {
	background: #ddd;
}

.color-btn {
	border: none;
	cursor: pointer;
	margin: 0 2px;
}

.color-btn.selected {
	border: 2px solid #000;
}
@media (max-width: 768px) {
	.main-container {
		flex-direction: column;
	}
	.editor-side {
		width: 100%;
		height: 30vh;
		border-right: none;
		border-bottom: 1px solid #ccc;
		min-height: 20vh;
		max-height: 45vh;
		overflow-y: auto;
	}
	.resizer {
		width: 100%;
		height: 5px;
		cursor: ns-resize;
	}
	.preview-side {
		height: calc(100vh - 30vh - 5px);
	}
	.scene {
		margin: 5px;
	}
	.zoom-panel {
		bottom: 10px;
		right: 10px;
		padding: 6px 12px;
		gap: 6px;
	}
	.zoom-panel button {
		font-size: 16px;
		padding: 2px 6px;
	}
	.zoom-slider-container input {
		width: 60px;
	}
	#error-log-container {
		height: 80px;
	}
	#error-log-container.collapsed {
		height: 25px;
	}
	.controls {
		padding: 8px;
		flex-wrap: wrap;
	}
	.controls button {
		flex: 1;
		min-width: 100px;
	}
}

@media (max-width: 480px) {
	header {
		padding: 8px 15px;
		font-size: 14px;
	}
	.tabs .tab-btn {
		padding: 8px;
		font-size: 12px;
	}
	textarea {
		font-size: 12px;
		padding: 10px;
	}
	#render-container {
		padding: 20px;
	}
}
