/* notepadshare.com — shared styles (VS Code "Dark+" inspired) */

:root {
	--bg: #1e1e1e;
	--bg-raised: #252526;
	--bg-title: #2c2c2c;
	--bg-input: #3c3c3c;
	--bg-hover: #2a2d2e;
	--bg-active: #37373d;
	--border: #3c3c3c;
	--border-strong: #474747;
	--text: #cccccc;
	--text-strong: #e7e7e7;
	--text-muted: #9d9d9d;
	--text-faint: #6e6e6e;
	--accent: #0078d4;
	--accent-hover: #026ec1;
	--accent-text: #4daafc;
	--focus: #007fd4;
	--status: #007acc;
	--status-offline: #b5462f;
	--danger: #f14c4c;
	--success: #23d18b;
	--warning: #cca700;
	--radius: 4px;
	--shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
	--font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Ubuntu, "Droid Sans", sans-serif;
	--font-mono: "Cascadia Code", "Fira Code", Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace;
	color-scheme: dark;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	height: 100%;
	background: var(--bg);
	color: var(--text);
	font: 13px/1.4 var(--font-ui);
	-webkit-font-smoothing: antialiased;
}

[hidden] {
	display: none !important;
}

a {
	color: var(--accent-text);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

code,
.mono {
	font-family: var(--font-mono);
}

/* ---------- Buttons & inputs ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 28px;
	padding: 0 12px;
	border: 1px solid transparent;
	border-radius: 2px;
	background: var(--accent);
	color: #fff;
	font: inherit;
	cursor: pointer;
	white-space: nowrap;
	user-select: none;
}

.btn:hover {
	background: var(--accent-hover);
}

.btn:focus-visible,
.input:focus,
.icon-btn:focus-visible {
	outline: 1px solid var(--focus);
	outline-offset: -1px;
}

.btn.secondary {
	background: #313131;
	border-color: var(--border-strong);
	color: var(--text);
}

.btn.secondary:hover {
	background: #3a3a3a;
}

.btn.lg {
	height: 36px;
	padding: 0 18px;
	font-size: 14px;
}

.btn[disabled],
.btn.busy {
	opacity: 0.75;
	cursor: default;
	pointer-events: none;
}

.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	border-radius: 5px;
	background: transparent;
	color: var(--text);
	cursor: pointer;
}

.icon-btn:hover {
	background: rgba(90, 93, 94, 0.31);
}

.input {
	height: 28px;
	padding: 0 8px;
	border: 1px solid var(--border);
	border-radius: 2px;
	background: var(--bg-input);
	color: var(--text-strong);
	font: inherit;
	min-width: 0;
}

.input::placeholder {
	color: var(--text-faint);
}

.input.invalid {
	border-color: var(--danger);
}

svg.ico {
	width: 16px;
	height: 16px;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ---------- Spinners ---------- */

.spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.25);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
	flex: none;
}

.spinner.lg {
	width: 34px;
	height: 34px;
	border-width: 3px;
	color: var(--accent-text);
}

.spinner.sm {
	width: 11px;
	height: 11px;
	border-width: 1.5px;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.skeleton {
	display: inline-block;
	height: 0.9em;
	min-width: 60px;
	border-radius: 3px;
	background: linear-gradient(90deg, #2a2a2a 25%, #353535 50%, #2a2a2a 75%);
	background-size: 200% 100%;
	animation: shimmer 1.2s ease-in-out infinite;
	vertical-align: middle;
}

@keyframes shimmer {
	to {
		background-position: -200% 0;
	}
}

/* ---------- Overlay / modal ---------- */

.overlay {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	background: var(--bg);
	color: var(--text-muted);
	font-size: 14px;
	transition: opacity 0.2s;
}

.overlay.fade {
	opacity: 0;
	pointer-events: none;
}

.modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 60;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 12vh 16px 16px;
	background: rgba(0, 0, 0, 0.45);
}

.modal {
	width: 100%;
	max-width: 420px;
	padding: 20px 22px;
	border: 1px solid var(--border-strong);
	border-radius: 6px;
	background: var(--bg-raised);
	box-shadow: var(--shadow);
}

.modal h2 {
	margin: 0 0 6px;
	color: var(--text-strong);
	font-size: 16px;
	font-weight: 600;
}

.modal p {
	margin: 0 0 14px;
	color: var(--text-muted);
}

.modal .row {
	display: flex;
	gap: 8px;
	align-items: center;
}

.modal .row .input {
	flex: 1;
}

.modal .error {
	min-height: 18px;
	margin-top: 8px;
	color: var(--danger);
	font-size: 12px;
}

/* ---------- Toasts ---------- */

.toasts {
	position: fixed;
	right: 16px;
	bottom: 34px;
	z-index: 70;
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: min(380px, calc(100vw - 32px));
}

.toast {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid var(--border-strong);
	border-left: 3px solid var(--accent);
	border-radius: 4px;
	background: var(--bg-raised);
	box-shadow: var(--shadow);
	color: var(--text);
	animation: toast-in 0.15s ease-out;
}

.toast.error {
	border-left-color: var(--danger);
}

.toast.success {
	border-left-color: var(--success);
}

.toast .msg {
	flex: 1;
	min-width: 0;
	overflow-wrap: anywhere;
}

.toast .progress {
	height: 2px;
	margin-top: 6px;
	background: #3a3a3a;
	border-radius: 2px;
	overflow: hidden;
}

.toast .progress > i {
	display: block;
	height: 100%;
	width: 0;
	background: var(--accent-text);
	transition: width 0.2s;
}

@keyframes toast-in {
	from {
		transform: translateY(6px);
		opacity: 0;
	}
}

/* ---------- Popup menus (VS Code quick pick style) ---------- */

.popup {
	position: fixed;
	z-index: 65;
	min-width: 220px;
	max-width: min(340px, calc(100vw - 16px));
	padding: 4px;
	border: 1px solid #454545;
	border-radius: 6px;
	background: #252526;
	box-shadow: var(--shadow);
	color: var(--text);
}

.popup .popup-title {
	padding: 6px 8px 4px;
	color: var(--text-muted);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.popup .input {
	width: 100%;
	margin-bottom: 4px;
}

.popup .list {
	max-height: min(340px, 50vh);
	overflow-y: auto;
}

.popup .item {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 5px 8px;
	border: 0;
	border-radius: 3px;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.popup .item:hover,
.popup .item.active {
	background: #04395e;
}

.popup .item .hint {
	margin-left: auto;
	color: var(--text-muted);
	font-size: 12px;
}

.popup .item .check {
	width: 14px;
	color: var(--accent-text);
}

.popup .empty {
	padding: 8px;
	color: var(--text-muted);
}

.swatches {
	display: grid;
	grid-template-columns: repeat(8, 22px);
	gap: 6px;
	padding: 6px 8px 8px;
}

.swatch {
	width: 22px;
	height: 22px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 50%;
	cursor: pointer;
}

.swatch.selected,
.swatch:hover {
	border-color: #fff;
}

.dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex: none;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
