html, body {
	margin: 0;
	padding: 0;
	font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
	color: var(--text-color);
	background-color: var(--background-color);
	height: 100%;
	overflow: auto;
	transition: background-color 0.3s ease, color 0.3s ease;
}

textarea {
	font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
	font-size: 12px;
	resize: none;
}

header {
	padding: 16px 24px;
	display: flex;
	align-items: center;
	height: 68px;
	box-sizing: border-box;
	border-bottom: 1px solid var(--border-color);
	gap: 16px;
}

header .logo-link {
	display: flex;
	align-items: center;
}

header h1 {
	margin: 0;
	font-size: 24px;
	font-weight: 700;
	color: inherit;
}

.other-demos {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}


.other-demos a {
	color: var(--subtle-text-color);
	text-decoration: none;
	transition: color 0.2s ease;
}

.other-demos a:hover {
	color: #3B82F6;
}

.other-demos .separator {
	color: var(--subtle-text-color);
}


.theme-toggle {
	margin-left: 16px;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	border: none;
	border-radius: 8px;
	background-color: transparent;
	color: var(--subtle-text-color);
	cursor: pointer;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover {
	background-color: var(--code-bg-color);
	color: var(--text-color);
}

.theme-toggle .material-icons {
	font-size: 20px;
}

.containers {
	display: flex;
	height: calc(100vh - 68px);
	gap: 12px;
	padding: 12px;
	box-sizing: border-box;
}

.container {
	flex-basis: 50%;
	display: flex;
	flex-direction: column;
	height: 100%;
	box-sizing: border-box;
}


.label {
	padding: 8px 12px;
	background-color: var(--code-bg-color);
	border: 1px solid var(--border-color);
	border-radius: 8px 8px 0 0;
	font-size: 14px;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--text-color);
}


.label select,
.label button {
	padding: 4px 8px;
	border-radius: 4px;
	border: 1px solid var(--border-color);
	background-color: var(--background-color);
	color: var(--text-color);
	font-size: 13px;
	cursor: pointer;
	transition: border-color 0.2s ease;
}

.label select:hover,
.label button:hover {
	border-color: #3B82F6;
}

.label a {
	color: #3B82F6;
	text-decoration: none;
}

.label a:hover {
	text-decoration: underline;
}


.pane, .inputPane {
	padding: 12px;
	border: 1px solid var(--border-color);
	border-top: none;
	border-radius: 0 0 8px 8px;
	overflow: auto;
	flex-grow: 1;
	flex-shrink: 1;
	background-color: var(--background-color);
	color: var(--text-color);
	transition: background-color 0.3s ease, border-color 0.3s ease;
}

#preview {
	display: flex;
}

#preview iframe {
	flex-grow: 1;
	border-radius: 0 0 8px 8px;
}

#main {
	display: none;
}

#loading {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100vh;
	font-size: 18px;
	color: var(--subtle-text-color);
}

.error {
	border-color: #EF4444 !important;
	background-color: #FEF2F2 !important;
}

.loadingError {
	background-color: #FEF2F2;
	font-weight: 600;
	color: #DC2626;
	text-align: center;
	padding: 16px;
	border-radius: 8px;
	margin: 20px;
}

#responseTime {
	display: inline-block;
	font-weight: 600;
	color: #3B82F6;
}


/* Dark mode specific overrides */
html.dark .error {
	background-color: #2c1d1d !important;
	border-color: #F87171 !important;
	color: #FCA5A5;
}

html.dark .loadingError {
	background-color: #2c1d1d;
	color: #FCA5A5;
}

html.dark #loading {
	color: #9CA3AF;
}
