:root {
	--bg: #121212;
	--surface: #1e1e1e;
	--surface-border: #333;

	--primary: #22c55e;
	--secondary: #0ea5e9;
	/* Blue */
	--error: #ef4444;

	--text-main: #e3e3e3;
	--text-muted: #9ca3af;

	--font-sans: "Roboto", -apple-system, BlinkMacSystemFont, sans-serif;
	--font-mono: "Roboto Mono", monospace;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	height: 100vh;
	background-color: var(--bg);
	color: var(--text-main);
	font-family: var(--font-sans);
	overflow: hidden;
}

.app-wrapper {
	display: flex;
	justify-content: center;
	align-items: center;
	height: 100%;
	width: 100%;
	padding: 0;
}

@media (min-width: 768px) {
	.app-wrapper {
		padding: 24px;
	}
}

.container {
	background-color: var(--bg);
	width: 100%;
	height: 100%;
	max-width: 1100px;
	display: flex;
	flex-direction: column;
	position: relative;
}

@media (min-width: 768px) {
	.container {
		background-color: var(--surface);
		border-radius: 16px;
		height: 90vh;
		box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
		border: 1px solid var(--surface-border);
	}
}

/* Header */
header {
	padding: 16px 24px;
	border-bottom: 1px solid var(--surface-border);
	flex-shrink: 0;
}

.header-content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 6px;
}

h1 {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 500;
}

.subtitle {
	margin: 0;
	color: var(--text-muted);
	font-size: 0.85rem;
}

.highlight {
	color: var(--primary);
	font-weight: 500;
}

/* Blue Pill (Top Right) */
.pill-badge-outlined {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 4px 10px;
	border-radius: 999px;
	border: 1px solid #333;
	background: rgba(255, 255, 255, 0.03);
	font-size: 0.75rem;
	color: var(--text-muted);
	font-weight: 500;
}

.pill-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--secondary);
	box-shadow: 0 0 6px var(--secondary);
}

/* Toolbar */
.toolbar {
	padding: 10px 24px;
	background: var(--bg);
	border-bottom: 1px solid var(--surface-border);
	overflow-x: auto;
	flex-shrink: 0;
}

@media (min-width: 768px) {
	.toolbar {
		background: transparent;
	}
}

.toolbar-row {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.btn {
	appearance: none;
	border: 1px solid var(--surface-border);
	background: transparent;
	color: var(--text-muted);
	font-family: var(--font-sans);
	font-size: 0.85rem;
	padding: 6px 14px;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.1s ease;
}

.btn:hover {
	background: #2a2a2a;
	color: var(--text-main);
}

.btn:active {
	transform: translateY(1px);
}

.btn-filled {
	background: var(--secondary);
	color: #000;
	border: none;
}

.btn-filled:hover {
	background: #0284c7;
	color: #000;
}

.btn-text {
	border: none;
	padding: 6px 12px;
}

.text-danger {
	color: var(--error);
}

.icon-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.editor-expand-area {
	flex: 1;
	display: flex;
	flex-direction: column;
	position: relative;
	overflow: hidden;
}

textarea {
	width: 100%;
	height: 100%;
	/* Fills the expansion area */
	background: transparent;
	color: var(--text-main);
	border: none;
	resize: none;
	/* Size controlled by flexbox now */
	padding: 24px;
	font-family: var(--font-mono);
	font-size: 1rem;
	line-height: 1.6;
	outline: none;
}

textarea::placeholder {
	color: #444;
}

/* Footer (Stats & Actions) */
.app-footer {
	padding: 12px 24px;
	background: var(--bg);
	border-top: 1px solid var(--surface-border);
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	flex-shrink: 0;
}

@media (min-width: 768px) {
	.app-footer {
		background: transparent;
	}
}

.stats {
	display: flex;
	gap: 16px;
	font-size: 0.75rem;
	color: var(--text-muted);
}

.stats strong {
	color: var(--text-main);
	font-weight: 600;
}

.actions {
	display: flex;
	gap: 8px;
}

/* Status Toast */
.status-message {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	pointer-events: none;
}

.status-popup {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	border-radius: 999px;
	font-size: 0.85rem;
	font-weight: 500;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
	animation: popUp 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.status-popup.ok {
	background: #064e3b;
	border: 1px solid #059669;
	color: #a7f3d0;
}

.status-popup.ok .status-dot {
	width: 8px;
	height: 8px;
	background: #34d399;
	border-radius: 50%;
	box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.3);
}

.status-popup.err {
	background: #450a0a;
	border: 1px solid #b91c1c;
	color: #fecaca;
}

@keyframes popUp {
	from {
		opacity: 0;
		transform: translateY(10px) scale(0.9);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* Toolbar Sections */
.toolbar-section {
	margin-bottom: 16px;
}

.toolbar-section:last-child {
	margin-bottom: 0;
}

.section-label {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--secondary);
	margin-bottom: 8px;
	font-weight: 700;
	opacity: 0.8;
}

.toolbar {
	display: flex;
	flex-direction: column;
	padding-top: 16px;
	padding-bottom: 16px;
}
