/* Font Tester Styles */

:root {
	/* Colors */
	--color-white-little: rgba(255, 255, 255, .22);
	--color-white-medium: rgba(255, 255, 255, .45);
	--color-white-lot: rgba(255, 255, 255, .8);
	--color-white: rgba(255, 255, 255, .95);
	--color-light-gray: rgba(0, 0, 0, .2);
	--color-medium-gray: rgba(0, 0, 0, .4);
	--color-dark-gray: rgba(0, 0, 0, .6);
	--color-black: rgba(0, 0, 0, .9);
	--color-highlight: #36e03d;
	--color-highlight-dark: #6abf6e;
	--color-error: #ff6b6b;

	/* Light mode colors */
	--bg-color: rgb(240, 240, 240);
	--text-color: var(--color-black);
	--custom-bg-color: var(--bg-color);
	--custom-text-color: var(--text-color);
	--sidebar-bg: rgba(0, 0, 0, 0.08);
	--button-bg: var(--color-white-little);
	--button-hover-bg: var(--color-white-medium);
	--border-color: var(--color-medium-gray);
	--drop-overlay-bg: rgba(33, 161, 25, 0.8);
	--sidebar-content-bg: rgba(255, 255, 255, 0.3);

	--active-button-outline-color: var(--custom-text-color, var(--text-color));

	/* Dark mode colors */
	--dark-bg-color: rgb(40, 40, 40);
	--dark-text-color: rgba(250, 250, 250, 0.9);
	--dark-sidebar-bg: var(--color-light-gray);
	--dark-button-bg: var(--color-medium-gray);
	--dark-button-hover-bg: var(--color-dark-gray);
	--dark-border-color: var(--color-white-little);
	--dark-drop-overlay-bg: rgba(33, 161, 25, 0.6);
	--dark-sidebar-content-bg: rgba(0, 0, 0, 0.3);

	/* Link cursor styling */
.external-link {
	cursor: pointer;
	display: inline-block;
	text-decoration: none;
	font-size: 20px;
	vertical-align: baseline;
	margin-left: 5px;
}

.external-link:hover {
	cursor: pointer;
}

/* Font sizes */
	--base-font-size: 10px;
	--h2-font-size: 1.6em;
	--h3-font-size: 1.3em;
}

@font-face {
	font-family: 'Show Me the Mono';
	src: url('fonts/ShowMetheMono-VF.ttf') format('truetype-variations');
	font-weight: 200 800;
	font-style: normal;
}

@font-face {
	font-family: 'Show Me the Mono';
	src: url('fonts/ShowMetheMono-VF-Italic.ttf') format('truetype-variations');
	font-weight: 200 800;
	font-style: italic;
}

html {
	background: transparent !important;
}

body, html {
	margin: 0;
	padding: 0;
	font-family: 'Show Me the Mono', Arial, sans-serif;
	font-weight: 450;
	font-size: var(--base-font-size);
	background: transparent;
	color: var(--text-color);
	/*transition: background-color 0.3s, color 0.3s;*/
}

/* Allow background images to show when present */
body.has-background-image {
	background: transparent;
}

/* Ensure viewport background is controlled only by our pseudo-element */
html, body, #app {
	background-color: transparent !important;
}

body::before {
	content: '';
	position: fixed;
	top: -100vh;
	left: 0;
	right: 0;
	bottom: -100vh;
	width: 100vw;
	height: 300vh;
	background-color: var(--custom-bg-color, var(--bg-color));
	z-index: -2;
	transition: background-color 0.1s ease;
}

/* Dark mode base background */
body.dark-mode::before {
	background-color: var(--dark-bg-color);
}

body::after {
	content: '';
	position: fixed;
	top: -100vh;
	left: 0;
	right: 0;
	bottom: -100vh;
	width: 100vw;
	height: 300vh;
	background-color: var(--custom-bg-color, var(--bg-color));
	transition: background-color 0.3s ease, opacity 0.3s ease;
	z-index: -1;
}

/* Ensure dark mode uses the correct fallback */
body.dark-mode::after {
	background-color: var(--custom-bg-color, var(--dark-bg-color));
}

#app {
	display: flex;
	padding-left: 0; /* Remove all left padding so sidebar touches page edge */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
	font-family: 'Show Me the Mono', Arial, sans-serif;
	font-weight: 800;
}

h4 {
	margin-bottom: 0em;
}

p {
	margin-bottom: 0;
	font-weight: 450;  
}

strong, b {
	font-weight: 800;
}

a {
	text-decoration: none;
	color: inherit;
}

.grey-text {
	color: var(--color-dark-gray);
}

hr {
	color: var(--custom-bg-color, var(--bg-color));
	opacity: .25;
}

/*Right side scrollbars*/
#main-content::-webkit-scrollbar {
	width: 5px;
}

#main-content::-webkit-scrollbar-track {
	background: transparent;
}

#main-content::-webkit-scrollbar-thumb {
	background-color: rgba(255, 255, 255, 0.6);
	border-radius: 2.5px;
}

#main-content {
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.6) transparent;
}

/* Adjust the scrollbar color for dark mode */
body.dark-mode #main-content::-webkit-scrollbar-thumb {
	background-color: rgba(0, 0, 0, 0.6);
}

body.dark-mode #main-content {
	scrollbar-color: rgba(0, 0, 0, 0.6) transparent;
}

/* Sidebar Styles */

#no-fonts-message {
	margin-top: 0;
	margin-bottom: 0;
	text-align: left; /* Changed from center to left */
	opacity: 0.4; /* Added light grey styling like feature codes */
}

#sidebar {
	position: relative;
	width: 288px;
	min-width: 288px;
	max-width: 288px;
	height: auto;
	min-height: 100vh;
	background-color: transparent;
	padding: 58px 0 1.25em 6px; /* Reduced from 80px to 60px to account for h2 margin-bottom */
	overflow-y: visible;
	overflow-x: hidden;
	flex-shrink: 0;
	box-sizing: border-box;
	direction: rtl; /* Maintain RTL direction which helps with scrollbar positioning */
	margin-left: 0; /* Remove margin to keep system scrollbar at edge */
	transition: background-color 0.3s ease;
}

#sidebar > * {
	direction: ltr;
}

.sidebar-content {
	padding-right: 10px;
}

#sidebar > div:not(#style-switcher) {
	border-radius: 5px;
	margin-bottom: 20px;
}

#sidebar > div:first-child {
	background-color: transparent;
	box-shadow: none;
	margin-bottom: 0;
}

.sidebar-header {
	position: absolute;
	top: 1.8em; /* Moved down to center with compare fonts button */
	left: 6px;
	width: 280px;
	background-color: transparent;
	z-index: 1000;
	padding: 0; /* Remove extra padding since we're positioning it directly */
}

.sidebar-header h2 {
	margin: 0 0 20px 16px;
	font-size: var(--h2-font-size);
	background-color: transparent;
	padding: 0;
	color: var(--custom-text-color, var(--text-color)) !important;
}

/* Ensure dark mode uses custom text color properly */
body.dark-mode .sidebar-header h2 {
	color: var(--custom-text-color, var(--text-color)) !important;
}

/* Independent Compare Fonts button positioning */
#compare-fonts-header {
	position: absolute;
	top: 1.6em;
	left: 297px;
	right: 0;
	z-index: 1000;
	background-color: transparent;
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 10px;
}

#font-selection {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 10px;
	flex: 1;
	position: relative;
}

#font-selection button {
	margin: 0;
}

/* Fading behavior for top-right controls when sidebar is collapsed */
body.sidebar-collapsed #compare-fonts-header {
	opacity: 1;
	transition: opacity 0.4s ease-in-out;
}

body.sidebar-collapsed #compare-fonts-header.fade-out-controls {
	opacity: 0;
}

/* Let the + button fade a bit after the header */
body.sidebar-collapsed .add-column-button {
	opacity: 1;
	transition: opacity 0.4s ease-in-out 0.2s; /* 200ms delay */
}

body.sidebar-collapsed #compare-fonts-header.fade-out-controls ~ .add-column-button {
	opacity: 0;
}

.add-column-button {
	position: fixed;
	right: 3px;
	top: 50%;
	transform: translateY(-50%);
	width: 30px;
	height: 30px;
	border-radius: 50%;
	/* Base colors: background = button bg, text = base text color, border = custom text */
	background-color: var(--button-bg) !important;
	color: var(--text-color) !important;
	border: 2px solid var(--custom-text-color, var(--text-color)) !important;
	font-size: 2em;
	font-weight: 600;
	font-feature-settings: 'ss10' 1;
	box-shadow: 0 2px 8px rgba(0,0,0,0.12);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	z-index: 1001;
	display: none; /* Hidden until at least one font is loaded */
}

/* Shake animation for feedback if button is disabled */
.add-column-button.shake {
	animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
	10%, 90% { transform: translate3d(-2px, -50%, 0); }
	20%, 80% { transform: translate3d(4px, -50%, 0); }
	30%, 50%, 70% { transform: translate3d(-8px, -50%, 0); }
	40%, 60% { transform: translate3d(8px, -50%, 0); }
}

.add-column-button:hover {
	/* Exactly match About This Tester hover colors */
	background-color: var(--custom-text-color, var(--text-color)) !important;
	color: var(--custom-bg-color, var(--bg-color)) !important;
	border-color: var(--custom-text-color, var(--text-color)) !important;
	box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

body.dark-mode .add-column-button {
	/* Match About button dark-mode base */
	background-color: var(--dark-button-bg) !important;
	color: var(--dark-text-color) !important;
	border-color: var(--custom-text-color, var(--dark-text-color)) !important;
}

body.dark-mode .add-column-button:hover {
	/* Match About button dark-mode hover */
	background-color: var(--custom-text-color, var(--dark-text-color)) !important;
	color: var(--custom-bg-color, var(--dark-bg-color)) !important;
	border-color: var(--custom-bg-color, var(--dark-bg-color)) !important;
}


#compare-fonts {
	padding: 5px 10px;
	font-size: 1.1em;
	font-weight: 600;
	background-color: var(--button-bg);
	color: var(--text-color);
	border: 1px solid var(--border-color);
	border-radius: 3px;
	cursor: pointer;
	transition: all 0.3s ease;
	display: none; /* Temporarily hidden */
}

#compare-fonts:hover {
	background-color: var(--button-hover-bg);
	border-color: var(--custom-text-color, var(--text-color));
}

/* Dark mode styling for compare fonts button */
body.dark-mode #compare-fonts {
	background-color: var(--dark-button-bg);
	color: var(--dark-text-color);
	border-color: var(--dark-border-color);
}

body.dark-mode #compare-fonts:hover {
	background-color: var(--dark-button-hover-bg);
	border-color: var(--custom-text-color, var(--dark-text-color));
}

/* Disabled state for compare fonts button */
#compare-fonts:disabled {
	background-color: rgba(0, 0, 0, 0.1);
	color: rgba(0, 0, 0, 0.4);
	border-color: rgba(0, 0, 0, 0.2);
	cursor: not-allowed;
}

/* Column Text Link button - same styling as other buttons */
#column-text-link {
	padding: 4px 10px;
	font-size: 1.1em;
	font-weight: 600;
	background-color: var(--button-bg);
	color: var(--text-color);
	border: 1px solid var(--border-color);
	border-radius: 3px;
	cursor: pointer;
	transition: all 0.3s ease;
}

#column-text-link:hover {
	background-color: var(--button-hover-bg);
	border-color: var(--custom-text-color, var(--text-color));
}

body.dark-mode #column-text-link {
	background-color: var(--dark-button-bg);
	color: var(--dark-text-color);
	border-color: var(--dark-border-color);
}

body.dark-mode #column-text-link:hover {
	background-color: var(--dark-button-hover-bg);
	border-color: var(--custom-text-color, var(--dark-text-color));
}

/* One Word per Line button - same styling as compare fonts */
#one-word-per-line {
	padding: 5px 10px;
	font-size: 1.1em;
	font-weight: 600;
	background-color: var(--button-bg);
	color: var(--text-color);
	border: 1px solid var(--border-color);
	border-radius: 3px;
	cursor: pointer;
	transition: all 0.3s ease;
}

#one-word-per-line:hover {
	background-color: var(--button-hover-bg);
	border-color: var(--custom-text-color, var(--text-color));
}

body.dark-mode #one-word-per-line {
	background-color: var(--dark-button-bg);
	color: var(--dark-text-color);
	border-color: var(--dark-border-color);
}

body.dark-mode #one-word-per-line:hover {
	background-color: var(--dark-button-hover-bg);
	border-color: var(--custom-text-color, var(--dark-text-color));
}

/* Word Length button - same styling as other buttons */
#word-length {
	padding: 5px 10px;
	font-size: 1.1em;
	font-weight: 600;
	background-color: var(--button-bg);
	color: var(--text-color);
	border: 1px solid var(--border-color);
	border-radius: 3px;
	cursor: pointer;
	transition: all 0.3s ease;
}

#word-length:hover {
	background-color: var(--button-hover-bg);
	border-color: var(--custom-text-color, var(--text-color));
}

body.dark-mode #word-length {
	background-color: var(--dark-button-bg);
	color: var(--dark-text-color);
	border-color: var(--dark-border-color);
}

body.dark-mode #word-length:hover {
	background-color: var(--dark-button-hover-bg);
	border-color: var(--custom-text-color, var(--dark-text-color));
}

/* Toggle Metrics button - same styling as other buttons */
#toggle-metrics {
	padding: 5px 10px;
	font-size: 1.1em;
	font-weight: 600;
	background-color: var(--button-bg);
	color: var(--text-color);
	border: 1px solid var(--border-color);
	border-radius: 3px;
	cursor: pointer;
	transition: all 0.3s ease;
}

#toggle-metrics:hover {
	background-color: var(--button-hover-bg);
	border-color: var(--custom-text-color, var(--text-color));
}

body.dark-mode #toggle-metrics {
	background-color: var(--dark-button-bg);
	color: var(--dark-text-color);
	border-color: var(--dark-border-color);
}

body.dark-mode #toggle-metrics:hover {
	background-color: var(--dark-button-hover-bg);
	border-color: var(--custom-text-color, var(--dark-text-color));
}

/* Word Length popup */
#word-length-popup {
	position: fixed;
	background: var(--color-white);
	border: 1px solid var(--border-color);
	border-radius: 4px;
	padding: 8px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	z-index: 10000;
	width: 140px;
}

#word-length-popup .speed-slider-container {
	display: flex;
	align-items: center;
	gap: 8px;
}

#word-length-popup .speed-slider-container span {
	font-size: 16px;
	font-weight: bold;
	color: #000000;
}

body.dark-mode #word-length-popup {
	background: var(--dark-bg-color);
	border-color: var(--dark-border-color);
	color: #ffffff;
	box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-mode #word-length-popup .speed-slider-container span {
	color: #ffffff;
}

body.dark-mode #compare-fonts:disabled {
	background-color: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.4);
	border-color: rgba(255, 255, 255, 0.2);
}

/* Letter input section positioning and styling */
#letter-input-section {
	background-color: rgba(255, 255, 255, 0.8);
	border: 1px solid var(--border-color);
	border-radius: 2px;
	padding: 0.5em 0.833em;
	padding-top: calc(0.5em - 1px);
	padding-bottom: calc(0.5em - 1px);
	margin: 0 !important;
	align-items: center;
	height: auto;
	/* margin-left: 10px !important; */
}

/* When visible, use flex display */
#letter-input-section[style*="flex"] {
	display: flex !important;
}

#letter-input {
	background-color: transparent;
	border: none;
	outline: none;
	color: #000000;
	font-family: 'Show Me the Mono', Arial, sans-serif;
	font-size: var(--h3-font-size);
	font-weight: bold;
	width: 260px;
	padding: 0;
	margin: 0;
	line-height: 1;
}

#letter-input::placeholder {
	color: #000000;
	opacity: 0.6;
	font-weight: bold;
}

/* Dark mode support for letter input */
body.dark-mode #letter-input-section {
	background-color: rgba(0, 0, 0, 0.8);
	border-color: var(--dark-border-color);
}

body.dark-mode #letter-input {
	color: #ffffff;
}

body.dark-mode #letter-input::placeholder {
	color: #ffffff;
	opacity: 0.6;
	font-weight: bold;
}

#sidebar button:not(.active-button):not(#color-swap-button),
#sidebar select,
#sidebar .content,
#sidebar h3,
#sidebar p:not(.sidebar-header h2),
#style-menu,
#style-menu-header,
#script-select,
#language-select {
	color: rgba(0, 0, 0, 0.95);
}

#sidebar h3 {
	margin: 0;
	padding: 0.5em 0.833em;
	font-size: var(--h3-font-size);
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.5em;
}

#sidebar h3::before {
	content: '☰';
	position: relative;
	cursor: grab;
	flex-shrink: 0;
	font-size: 1.3em;
	line-height: 1;
	color: var(--sidebar-text-color);
	opacity: 0.6;
	transition: opacity 0.2s ease;
	top: -2px;
}

#sidebar h3:hover::before {
	opacity: 1;
}

#sidebar h3::after {
	content: '▼';
	position: absolute;
	right: 0.833em;
	top: 50%;
	transform: translateY(-50%);
	transition: transform 0.3s ease;
}

#sidebar .collapsed h3::after {
	transform: translateY(-50%) rotate(-90deg);
}

body.dark-mode #sidebar,
body.dark-mode #sidebar h3,
body.dark-mode #sidebar .content,
body.dark-mode #sidebar .content-fonts {
	color: var(--dark-text-color);
}

/* Sidebar Scrollbar Styles - Hidden */

#sidebar::-webkit-scrollbar {
	width: 0;
	display: none;
}

#sidebar {
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE and Edge */
}

/* Dark mode sidebar scrollbar - Hidden */
body.dark-mode #sidebar::-webkit-scrollbar {
	width: 0;
	display: none;
}

body.dark-mode #sidebar {
	scrollbar-width: none;
	-ms-overflow-style: none;
}

body.dark-mode #script-select,
body.dark-mode #language-select,
body.dark-mode #style-menu,
body.dark-mode #style-menu-header,
body.dark-mode #sidebar button:not(#color-swap-button),
body.dark-mode #sidebar select,
body.dark-mode #sidebar .content,
body.dark-mode #variable-font-controls .content,
body.dark-mode #opentype-features .content {
	color: var(--dark-text-color) !important;
}

/* Ensure Variable Fonts panel text is appropriately styled in dark mode */
body.dark-mode #variable-font-controls .content p,
body.dark-mode #opentype-features .content p,
body.dark-mode #no-fonts-message {
	color: var(--dark-text-color) !important;
	opacity: 0.6; /* Slightly higher opacity for better visibility in dark mode */
}

/* Collapsible Content */
#sidebar .collapsible {
	background-color: var(--sidebar-content-bg);
	border-radius: 2px;
	margin-bottom: 10px;
	overflow: hidden;
	margin-left: 10px;
}

#sidebar .collapsible h3,
#opentype-features .collapsible h3,
#opentype-features h3 {
	margin: 0;
	padding: 5px 0 5px 10px ;
	cursor: pointer;
	user-select: none;
	position: relative;
	border-bottom: 1px solid var(--custom-bg-color, var(--bg-color));
}

#sidebar .collapsible .content {
	padding: 10px;
	max-height: 1000px;
	overflow: hidden;
	transition: max-height 0.3s ease, padding 0.3s ease;
	border-radius: 5px;
	display: block;
}

/* Specific styling for loaded fonts content area */
#loaded-fonts .content-fonts {
	padding: 10px 4px 5px 8px;
	max-height: none;
	overflow: visible;
	transition: padding 0.3s ease;
	border-radius: 5px;
}

#loaded-fonts.collapsed .content-fonts {
	display: none !important;
	max-height: 0 !important;
}

/* Initial sidebar collapsible background to prevent flash */
#sidebar .collapsible {
	background-color: var(--sidebar-content-bg);
}

body.dark-mode #sidebar .collapsible {
	background-color: var(--dark-sidebar-content-bg);
}

/* Allow overflow for variable font controls when speed popup is visible */
#variable-font-controls .content {
	overflow: visible;
	display: block;
}

#variable-font-controls.collapsed .content {
	display: none !important;
	max-height: 0 !important;
	overflow: hidden;
}

/* Ensure parent containers also allow overflow for the speed popup */
#variable-font-controls {
	overflow: visible;
}

/* Allow sidebar itself to show overflow for speed popup */
#sidebar {
	overflow: visible;
}

/* Allow sidebar content to show overflow */
.sidebar-content {
	overflow: visible;
}

#sidebar .collapsible.collapsed .content {
	max-height: 0;
	padding-top: 0;
	padding-bottom: 0;
	display: none !important;
}

#sidebar .collapsible.collapsed .content-fonts {
	max-height: 0 !important;
	padding-top: 0;
	padding-bottom: 0;
	overflow: hidden;
	display: none;
}

/* Collapsible section styling */
#sidebar .collapsible h3 {
	cursor: pointer;
	user-select: none;
}

/* Sample text section styling */
.inline-selects {
	display: flex;
	flex-wrap: nowrap;
	gap: 3px;
	width: 100%;
}

#script-select, #language-select {
	min-width: 110px;
	padding: 4px;
	border-radius: 4px;
	border: 1px solid var(--border-color);
	background-color: var(--dropdown-bg);
	color: var(--text-color);
	cursor: pointer;
}

#script-select {
	flex: 0.8;
}

#language-select {
	flex: 1.2;
}

/* Basic styles for script and language dropdowns */
/* Removed duplicate .inline-selects definition */

.inline-selects select {
	flex: 1;
}

/* Section toggle button */
.section-toggle {
	display: inline-block;
	user-select: none;
	transition: transform 0.2s ease;
}

.collapsible.collapsed .section-toggle {
	transform: rotate(-90deg);
}

/* Style for clickable collapsible headers */
#sidebar .collapsible h3 {
	cursor: pointer;
	display: flex;
	align-items: center;
	user-select: none !important;
	-webkit-user-select: none !important;
	-moz-user-select: none !important;
	-ms-user-select: none !important;
}

/* Dragging state for palettes */
#sidebar .collapsible.dragging {
	opacity: 0.5;
}

#sidebar .collapsible.drag-over-top {
	border-top: 3px solid var(--accent-color);
}

#sidebar .collapsible.drag-over-bottom {
	border-bottom: 3px solid var(--accent-color);
}

#sidebar .collapsible .collapse-indicator {
	transition: transform 0.2s ease;
}

#sidebar .collapsible.collapsed .collapse-indicator {
	transform: rotate(-90deg);
}

/* Button Styles */
button {
	font-family: 'Show Me the Mono', Arial, sans-serif;
	padding: 0.333em 0.5em;
	background-color: var(--button-bg);
	color: var(--text-color);
	border: 1px solid var(--border-color);
	border-radius: 2px;
	cursor: pointer;
	font-size: 1em;
	transition: background-color 0.2s ease, outline 0.2s ease;
	margin: 0.45em 0;
}

button:hover:not(#color-swap-button) {
	background-color: var(--button-hover-bg);
}

.save-settings-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.autosave-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.autosave-indicator {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background-color: var(--color-error);
	border: 1px solid var(--border-color);
	display: inline-block;
}

.autosave-toggle.autosave-on .autosave-indicator {
	background-color: var(--color-highlight);
	box-shadow: 0 0 6px rgba(50, 255, 50, 1), 0 0 16px rgba(0, 255, 0, 0.9);
	border: 1px solid rgba(150, 255, 150, .9);
}

/* No specific styling needed for color swap button as it's now a span element */

button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.header-buttons {
	position: absolute;
	top: -1.25em;
	right: 10px;
	display: flex;
	align-items: center;
}

.character-filter-buttons button.active-button,
#sample-texts button.active-button,
#sample-texts .character-filter-buttons button.active-button,
#text-align button.active-button,
#text-case button.active-button {
	border-color: var(--custom-text-color, var(--text-color));
	outline: 1px solid var(--custom-text-color, var(--text-color));
}

/* Ensure dark mode compatibility */
body.dark-mode .active-button {
	border-color: var(--custom-text-color, var(--dark-text-color));
	outline: 1px solid var(--custom-text-color, var(--dark-text-color));
}

.confirmation-alert {
	position: fixed;
	top: 20px;
	left: calc(288px + (100% - 288px) / 2);
	transform: translateX(-50%);
	background-color: var(--button-bg);
	color: rgba(0, 0, 0, 0.9) !important; /* Force black text in light mode */
	padding: 10px 20px;
	border-radius: 5px;
	border: 1px solid var(--custom-text-color);
	z-index: 1000;
	font-family: 'Show Me the Mono', Arial, sans-serif;
	font-size: 14px;
	box-shadow: 0 2px 50px var(--custom-text-color, rgba(0,0,0,0.05));
	opacity: 1;
	transition: opacity 0.5s ease-out;
}

body.dark-mode .confirmation-alert {
	background-color: var(--dark-button-bg);
	color: var(--dark-text-color) !important;
	border-color: var(--dark-border-color);
}

/* Center over full page when sidebar is collapsed */
body.sidebar-collapsed .confirmation-alert {
	left: 50%;
}

/* Remove Background Image Button */
#remove-background-button {
	/* Base styles handled via JavaScript inline styles for dynamic positioning */
	font-weight: normal;
}

body.dark-mode #remove-background-button {
	background-color: var(--dark-button-bg) !important;
	color: var(--dark-text-color) !important;
	border-color: var(--dark-border-color) !important;
}

body.dark-mode #remove-background-button:hover {
	background-color: var(--dark-button-hover-bg) !important;
}

/*Theme - Default Colors*/

#color-init-options {
	margin-top: 15px;
	text-align: center;
}

#color-init-options p {
	margin-bottom: 8px;
	font-weight: bold;
	color: rgba(0, 0, 0, 0.9); /* Force black text in light mode, not custom color */
}

#color-init-options label {
	display: block;
	margin: 5px 0;
	cursor: pointer;
	padding: 5px;
	border-radius: 2px;
	transition: background-color 0.2s;
}

#color-init-options label:hover {
	background-color: var(--button-hover-bg);
}

#color-init-options input[type="radio"] {
	vertical-align: middle;
	margin-right: 5px;
}

/* Select Styles */
select {
	font-family: 'Show Me the Mono', Arial, sans-serif;
	padding: 0.333em;
	border: 1px solid var(--border-color);
	border-radius: 2px;
	font-size: 1em;
	margin: 0.333em 0.333em 0.333em 0;
	appearance: none;
	background-color: var(--color-white-little);
	color: var(--text-color);
	background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
	background-repeat: no-repeat;
	background-position-x: 100%;
	background-position-y: 50%;
	padding-right: 2.083em;
}

/* Style variable-font named instances shown under the arrow prefix */
select.font-select option[data-instance-index],
select.font-select option.font-instance-option {
	font-style: italic !important;
}

/* Text Selection Styles */
::selection {
	background: var(--text-selection-color, rgba(0, 0, 255, 0.2));
}

::-moz-selection {
	background: var(--text-selection-color, rgba(0, 0, 255, 0.2));
}

/* Select dropdown selection styles */
select::selection {
	background: var(--text-selection-color, rgba(0, 0, 255, 0.2));
}

select option::selection {
	background: var(--text-selection-color, rgba(0, 0, 255, 0.2));
}

/* For Firefox dropdown options */
select option:focus {
	background: var(--text-selection-color, rgba(0, 0, 255, 0.2));
}

/* Range Input Styles */
input[type="range"] {
	--slider-bg: var(--custom-bg-color, var(--bg-color));
	-webkit-appearance: none;
	appearance: none;
	height: 0.333em;
	width: 100%;
	background: transparent;
	outline: none;
	margin: 1em 0;
	z-index: 1;
}

/* Editable value display for font size */
.editable-value {
	cursor: text;
	padding: 2px 1px 2px 4px;
	border-radius: 2px;
	transition: background-color 0.2s ease;
	display: inline-block;
	min-width: 25px;
	text-align: right;
	margin-left: -4px;
	margin-right: 0;
}

.editable-value:hover {
	background-color: var(--button-hover-bg);
}

.editable-value:focus {
	outline: 1px solid var(--custom-text-color, var(--text-color));
	background-color: var(--button-bg);
}

body.dark-mode .editable-value:hover {
	background-color: var(--dark-button-hover-bg);
}

body.dark-mode .editable-value:focus {
	outline: 1px solid var(--custom-text-color, var(--dark-text-color));
	background-color: var(--dark-button-bg);
}

/* Track styles */
input[type="range"]::-webkit-slider-runnable-track {
	width: 100%;
	height: 0.333em;
	background: var(--custom-bg-color, var(--bg-color));
	opacity: 0.7;
	z-index: 1;
	transition: background-color 0.1s ease;
}

input[type="range"]::-moz-range-track {
	width: 100%;
	height: 0.333em;
	background: var(--custom-bg-color, var(--bg-color));
	opacity: 0.7;
	z-index: 1;
	transition: background-color 0.1s ease;
}

/*input[type="range"]:hover::-webkit-slider-runnable-track {
opacity: 0.9;
}

input[type="range"]:hover::-moz-range-track {
opacity: 0.9;
}*/

/* Thumb styles */
input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 15px;
	background: var(--custom-bg-color, var(--bg-color));
	cursor: pointer;
	border: 2px solid var(--active-button-outline-color, var(--custom-text-color, var(--text-color)));
	border-radius: 2px;
	transition: background-color 0.3s, opacity 0.3s;
	margin-top: -5.5px; /* Centers the thumb on the track */
	z-index: 10;
	position: relative;
}

input[type="range"]::-moz-range-thumb {
	width: 18px;
	height: 15px;
	background: var(--custom-bg-color, var(--bg-color));
	cursor: pointer;
	/*border: 2px solid var(--custom-text-color, var(--text-color));*/
	border: 2px solid var(--active-button-outline-color, var(--custom-text-color, var(--text-color)));
	border-radius: 2px;
	transition: background-color 0.3s, opacity 0.3s;
	z-index: 10;
	position: relative;
}

@-moz-document url-prefix() {
  input[type="range"] {
	overflow: visible;
  }

  /* Create a stacking context to ensure z-index works properly */
	input[type="range"]::-moz-range-track {
	  position: relative;
	  z-index: 1;
	}
  
	input[type="range"]::-moz-range-thumb {
	  position: relative;
	  z-index: 10;
	  transform: scale(1.01); /* Slightly scale up to ensure it's above track */
	}
  
	/* Force a repaint which can fix rendering issues */
	input[type="range"]:hover::-moz-range-thumb {
	  transform: scale(1.01);
	}
  
	/* Additional fix for variable font controls */
	#variable-font-controls input[type="range"]::-moz-range-thumb {
	  z-index: 10;
	}
  
	/* Override any competing styles */
	input[type="range"]::-moz-range-progress {
	  z-index: 5;
	}
  }

  /* Ensure variable font controls get the same styles */
  #variable-font-controls input[type="range"]::-webkit-slider-thumb {
	z-index: 10;
  }

  #variable-font-controls input[type="range"]::-webkit-slider-runnable-track {
	z-index: 1;
  }

  #variable-font-controls input[type="range"]::-moz-range-thumb {
	z-index: 10;
  }

  #variable-font-controls input[type="range"]::-moz-range-track {
	z-index: 1;
  }

  /* Force hardware acceleration which can help with layering issues */
  input[type="range"] {
	transform: translateZ(0);
	will-change: transform;
  }

/*Character Select Section*/
.character-filter-buttons button.active-button,
#sample-texts button.active-button,
#sample-texts .character-filter-buttons button.active-button {
	border-color: var(--custom-text-color, var(--text-color));
	outline: 1px solid var(--custom-text-color, var(--text-color));
}

#character-filter-popup p {
	margin-top: 0;
}

#character-filter-popup input {
	width: 230px;
	font-family: inherit;
	margin: 1em 0;
}

/* Hover and active states */
input[type="range"]:hover::-webkit-slider-thumb {
	background-color: var(--custom-text-color, var(--text-color));
	opacity: 0.8;
}
input[type="range"]:active::-webkit-slider-thumb {
	background-color: var(--custom-text-color, var(--text-color));
	opacity: 1;
}

input[type="range"]:hover::-moz-range-thumb {
	background-color: var(--custom-text-color, var(--text-color));
	opacity: 0.8;
}
input[type="range"]:active::-moz-range-thumb {
	background-color: var(--custom-text-color, var(--text-color));
	opacity: 1;
}

/* Dark mode adjustments */
body.dark-mode input[type="range"]::-webkit-slider-runnable-track {
	background: var(--custom-bg-color, var(--bg-color));
}

body.dark-mode input[type="range"]::-moz-range-track {
	background: var(--custom-bg-color, var(--bg-color));
}

#variable-font-controls input[type="range"]::-webkit-slider-thumb {
  z-index: 3;
  position: relative;
}

#variable-font-controls input[type="range"]::-moz-range-thumb {
  z-index: 3;
  position: relative;
}

#variable-font-controls input[type="range"] {
	--slider-bg: var(--custom-bg-color, var(--bg-color));
	height: 0.333em;
}

#variable-font-controls input[type="range"]::-webkit-slider-runnable-track {
	opacity: 0.6;
	z-index: 1;
}
#variable-font-controls input[type="range"]::-moz-range-track {
	opacity: 0.6;
	z-index: 1;
}

#variable-font-controls input[type="range"]:hover::-webkit-slider-runnable-track {
	opacity: 0.9;
}

#variable-font-controls input[type="range"]:hover::-moz-range-track {
	opacity: 0.9;
}

body.dark-mode #variable-font-controls input[type="range"]::-webkit-slider-runnable-track {
	background: var(--custom-bg-color, var(--bg-color));
}
body.dark-mode #variable-font-controls input[type="range"]::-moz-range-track {
	background: var(--custom-bg-color, var(--bg-color));
}

.axis-controls {
	display: flex;
	align-items: center;
	gap: 4px;
	position: relative;
}

.axis-controls input[type="range"] {
	flex: 1;
	width: calc(100% - 60px); /* Make room for the two circles */
}

.animation-control, .speed-control {
	width: 20px;
	height: 20px;
	border-radius: 2px;
	background-color: var(--button-bg);
	color: #000000 !important;
	border: 1px solid var(--border-color);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 10px;
	padding: 0;
	margin-left: 4px;
	flex-shrink: 0;
	transition: background-color 0.2s ease;
}

.animation-control:hover, .speed-control:hover {
	background-color: var(--button-hover-bg);
}

/* Dark mode support for animation and speed controls */
body.dark-mode .animation-control, 
body.dark-mode .speed-control {
	background-color: var(--dark-button-bg);
	color: #ffffff !important;
	border-color: var(--dark-border-color);
}

body.dark-mode .animation-control:hover, 
body.dark-mode .speed-control:hover {
	background-color: var(--dark-button-hover-bg);
}

.speed-popup {
	position: fixed;
	background: var(--color-white);
	border: 1px solid var(--border-color);
	border-radius: 4px;
	padding: 8px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	z-index: 10000;
	width: 140px;
	right: 10px;
}

/* Dark mode support for speed popup */
body.dark-mode .speed-popup {
	background: var(--dark-bg-color);
	border-color: var(--dark-border-color);
	color: #ffffff;
	box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.speed-slider-container {
	display: flex;
	align-items: center;
	gap: 8px;
}

.speed-slider-container span {
	font-size: 16px;	/* Size for emojis */
}

/* Main Content Styles */
#main-content {
	display: block;
	padding: 1.667em 1.667em 1.667em 0em;
	max-width: 100vw;
	overflow-x: hidden;
	background-color: transparent;
	transition: background-color 0.3s ease;
	width: 100%;
	/* Remove display: flex and any overflow-y settings */
}

/* Expandable content area */
#main-expandable-content {
	width: 100%;
	margin-top: 3.5em;
	/* Remove display: flex and any height/overflow restrictions */
}

/* Text Columns */
#text-columns {
	display: flex;
	width: 100%;
	max-width: 100%;
	gap: 0;
	transition: background-color 0.3s ease;
	/* Remove any overflow or height restrictions */
}

.text-column {
	flex: 1;
	min-width: 0;
	box-sizing: border-box;
	padding: 0.416em 0.833em 0.833em 0.833em;
	transition: border-color 0.3s ease, background-color 0.3s ease;
}
	#text-columns > .text-column:only-child {
		margin-top: 1.5px;
	}


.text-column.selected {
	outline: 1px solid var(--custom-text-color);
	outline-offset: -2px;
	border-color: var(--custom-text-color) !important;
	z-index: 1;
	border-radius: 4px;
}


.text-column.selected.single-column {
	outline: none !important;
	border-color: transparent !important;
}

body.dark-mode .text-column.selected.single-column {
	border-color: transparent !important;
	outline: none !important;
}


body.dark-mode .text-column.selected {
	outline: 1px solid var(--custom-text-color) !important;
	outline-offset: -2px;
	border-color: var(--custom-text-color) !important;
	border-radius: 4px;

}

.text-column.selected.single-column {
	border-color: transparent !important;
}

body.dark-mode .text-column.selected.single-column {
	border-color: transparent !important;
}

.remove-column {
	background: none;
	border: none !important;
	font-size: 25px;
	cursor: pointer;
	padding: 0;
	margin: -7px 0 0 0;
					color: var(--border-color) !important;
	font-weight: 400;
	transition: color 0.3s ease, font-weight 0.2s ease;
}

.remove-column:hover {
	background: none !important;
	color: var(--custom-text-color) !important;
	font-weight: 800 !important;
}

/* Font Selection */
.font-select-container {
	display: flex;
	align-items: center;
	width: 100%;
	gap: 0.667em;
	flex-shrink: 0;
}

.font-select {
	flex-grow: 1;
	width: auto;
	min-width: 0;
	max-width: calc(100% - 3.167em);
	color: rgba(0, 0, 0, 0.95);
}

/* Text Display */
.text-display {
	width: 100%;
	font-size: 80px;
	line-height: 1.5;
	overflow-wrap: break-word;
	outline: none;
	border: none;
	resize: none;
	white-space: pre-wrap;
	margin-top: 20px;
	min-height: unset;
	flex-grow: unset;
	height: auto;
	max-height: none;
	color: var(--custom-text-color, var(--text-color));
}

/* Fix for heavy weight fonts that cause tripling effects */
.text-display {
	-webkit-font-feature-settings: "kern" 1;
	font-feature-settings: "kern" 1;
	text-rendering: geometricPrecision;
}

/* Dialog backdrop styles */
.app-dialog-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 1000;
}

.app-dialog-backdrop.visible {
	display: flex;
}

/* Center the About info panel */
#about-info-backdrop.app-dialog-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
}

#about-info-panel {
	background-color: rgb(240, 240, 240); /* Default light background */
	color: rgba(0, 0, 0, 0.9); /* Default dark text */
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.3);
	width: 70%;
	max-width: 600px;
	max-height: 80%;
	overflow-y: auto;
	padding: 30px;
	position: relative;
	word-break: break-word;
	white-space: normal;
	overflow-wrap: break-word;
	font-size: 14px;
}

#about-info-panel h1,
#about-info-panel h2,
#about-info-panel h3 {
	font-size: 1.4em;
	margin-top: 1.5em;
	margin-bottom: 0.5em;
}

#about-info-panel h1:first-child,
#about-info-panel h2:first-child,
#about-info-panel h3:first-child {
	margin-top: 0;
	text-align: center;
	font-size: 24px;
}

#about-info-panel p {
	margin-bottom: 1em;
	line-height: 1.5;
}

#about-info-panel ul,
#about-info-panel ol {
	margin-bottom: 1em;
	padding-left: 1.5em;
}

#about-info-panel li {
	margin-bottom: 0.5em;
	line-height: 1.4;
}

#about-content {
	word-wrap: break-word;
	overflow-wrap: break-word;
	word-break: break-word;
	white-space: normal;
	max-width: 100%;
}

#about-content p,
#about-content li {
	word-wrap: break-word;
	overflow-wrap: break-word;
	hyphens: auto;
}

#close-about {
	margin-top: 20px;
	float: right;
}

body.dark-mode #about-info-panel {
	background-color: var(--dark-bg-color);
	color: var(--dark-text-color);
}

/* Drop Overlay */
#drop-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: var(--custom-text-color, var(--text-color));
	opacity: 0.8;
	z-index: 1000;
}

#drop-message {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 4em;
	font-weight: 800;
	color: var(--custom-bg-color, var(--bg-color));

}

/* Font List */
#font-list {
	min-height: 0;
	max-height: none;
	overflow-y: visible;
	user-select: none;
	padding: 0.417em 0 0.417em 0;
	width: 100%;
	margin: 0 -10px 0 0;
}

.font-item-container {
	display: flex;
	align-items: center;
	margin-bottom: 5px;
	width: 100%;
}

.font-item {
	flex-grow: 1;
	flex-shrink: 1;
	display: flex;
	align-items: center;
	padding: 4px;
	border: 1px solid transparent;
	border-radius: 2px;
	background-color: var(--button-bg);
	color: rgba(0, 0, 0, 0.95); /* Same as sidebar text */
	width: calc(100% - 28px); /* Adjusted for smaller gap + icon width */
	overflow: hidden;
	position: relative;
	transition: background-color 0.2s ease, outline 0.2s ease;
	cursor: pointer;
}

.font-item:hover,
.font-item-container:hover .font-item {
	background-color: var(--button-hover-bg);
}

.font-item.active {
	background-color: var(--button-bg); /* Keep same background as default */
	border-color: var(--custom-text-color, var(--text-color));
}

.drag-handle {
	cursor: move;
	padding-right: 0.25em;
	font-size: 1.4em;
	display: flex;
	align-items: center;
	margin-bottom: 4px;
}

.font-name {
	text-align: left;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	max-height: 2.5em;
	line-height: 1.3;
	padding-right: 20px;
}

.font-info-icon {
	flex-shrink: 0;
	cursor: pointer;
	color: var(--color-dark-gray);
	transition: color 0.2s ease;
	width: 20px; /* Slightly smaller for better centering */
	text-align: center;
	margin-right: 2px; /* Small margin from scrollbar */
}

.file-format {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	right: 5px;
	font-size: 8px;
	color: var(--text-color);
	opacity: 0.8;
}

.font-info-icon:hover {
	color: var(--highlight-color);
}

/* Loaded Fonts scrollbar */
/* Scrollbar styles removed to eliminate scrollbar */
#font-list {
	scrollbar-width: none; /* Hide Firefox scrollbar */
}

#font-list::-webkit-scrollbar {
	width: 0;
	background: transparent; /* Hide Chrome/Safari/Edge scrollbar */
}

/* Dark mode font list - scrollbar styling removed */
body.dark-mode #font-list {
	scrollbar-width: none; /* Hide Firefox scrollbar */
}

body.dark-mode #font-list::-webkit-scrollbar {
	width: 0;
	background: transparent; /* Hide Chrome/Safari/Edge scrollbar */
}

/* Glyph Inspector Styles */

.text-display.glyph-grid,
.glyph-grid {
	/* background: var(--custom-bg-color, var(--bg-color)); */
	padding: 0;
	width: 100%;
	overflow: hidden;
	/* transition: background-color 0.1s ease; */
}

/* Canvas-based glyph grid */
.text-display.glyph-grid.canvas-grid {
	display: block;
}

.text-display.glyph-grid.canvas-grid canvas {
	display: block;
	width: 100%;
	height: auto;
	background: transparent;
}

/* Grid layout for WOFF2 glyph boxes */
.text-display.glyph-grid.box-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
	gap: 0;
}

.glyph-grid .glyph-box, .glyph-box.non-unicode {
	width: 100%;
	height: 60px;
	display: flex;
	justify-content: center;
	align-items: center;
	background: transparent;
	color: var(--custom-text-color, var(--text-color));
	font-size: 24px;
	line-height: 1;
	border: 1px solid var(--color-white-medium);
	box-sizing: border-box;
}

.error-message {
	color: red;
	text-align: center;
}

.glyph-box svg, .glyph-box.non-unicode svg {
	color: inherit;
}

.glyph-detail-box {
	position: fixed;
	width: clamp(420px, 85vw, 600px);
	height: clamp(350px, 70vh, 700px);
	background: rgba(245, 245, 245, 0.96);
	color: #000000;
	font-family: 'Show Me the Mono', Arial, sans-serif;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	box-shadow: 0 0 45px color-mix(in srgb, var(--custom-text-color) 20%, transparent);
	z-index: 10000;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	padding: 0;
	box-sizing: border-box;
	overflow: hidden;
	pointer-events: none;
	backface-visibility: hidden;
	will-change: transform;
}

.glyph-detail-box svg {
	width: 450px;
	height: 450px;
	margin-bottom: 10px;
	background-color: transparent;
}

.glyph-detail-box canvas {
	display: block;
	width: 100%;
	height: auto;
	min-height: 300px;
	margin-bottom: 0px;
	background-color: transparent;
	flex-shrink: 0;
}

.glyph-detail-box svg rect:first-of-type {
	fill: transparent;
}

.glyph-detail-box svg rect:nth-of-type(2) {
	fill: #ffffff;
}

.glyph-detail-box text {
	font-family: 'Show Me the Mono', Arial, sans-serif;
	fill: #000000;
}

.glyph-detail-box path {
	fill: #000000;
}

body.dark-mode .glyph-detail-box path {
	fill: #ffffff;
}

body.dark-mode .glyph-detail-box {
	background: rgba(40, 40, 40, 0.95);
	color: #ffffff;
	border: 1px solid var(--dark-border-color);
	box-shadow: 0 0 45px color-mix(in srgb, var(--custom-text-color) 20%, transparent);
}

body.dark-mode .glyph-detail-box svg rect:nth-of-type(2) {
	fill: rgba(30, 30, 30, 0.01);
}

body.dark-mode .glyph-detail-box text {
	fill: #ffffff;
}

body.dark-mode .glyph-info {
	background: #000000;
}

.glyph-grid .glyph-box {
	color: var(--custom-text-color, var(--text-color));
}

.glyph-box.non-unicode {
	color: var(--color-dark-gray);
}

.glyph-box:empty {
	background: transparent;
}

.glyph-info {
	font-size: 12px;
	font-family: 'Show Me the Mono', Arial, sans-serif;
	text-align: center;
	padding: 0 10px;
	width: 100%;
	height: 45px;
	background: white;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 2px;
}

.glyph-info.show-metrics {
	background: transparent;
}

body.dark-mode .glyph-info.show-metrics {
	background: transparent;
}

.glyph-letter-display {
	font-size: 120px;
	line-height: 1;
	text-align: center;
	flex-grow: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.glyph-detail-box h3 {
	margin: 0;
	padding: 0;
	border-bottom: none;
	font-size: inherit;
	font-weight: bold;
}

.glyph-detail-box h3::after {
	content: none;
}

.glyph-info h3 {
	margin: 0;
	padding: 0;
}

/* Font Info Popup Styles */
.font-info-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 1000;
}

.font-info-popup {
	background-color: rgb(240, 240, 240) !important; /* Hardcoded light background */
	color: rgba(0, 0, 0, 0.9) !important; /* Hardcoded dark text */
	border-radius: 8px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.1);
	width: 70%;  /* Reduced from 80% */
	max-width: 700px;  /* Reduced from 800px */
	max-height: 80%;
	overflow-y: auto;
	padding: 20px 40px;
	position: relative;
	/* Match sidebar scrollbar */
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Webkit scrollbar styles to match sidebar */
.font-info-popup::-webkit-scrollbar {
	width: 6px;
}

.font-info-popup::-webkit-scrollbar-track {
	background: transparent;
}

.font-info-popup::-webkit-scrollbar-thumb {
	background-color: rgba(0, 0, 0, 0.2);
	border-radius: 3px;
}

.font-info-popup .close-button {
	position: absolute;
	top: 15px;
	right: 15px;
	background: none;
	border: none;
	font-size: 20px;
	cursor: pointer;
	color: inherit;
	padding: 5px;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.5;
}

.font-info-popup .close-button:hover {
	opacity: 1;
}

.character-preview {
	margin-top: 30px;
}

.character-preview h2 {
	/* Match other headlines */
	margin: 30px 0 15px;
	font-size: 15px;
	font-weight: 800;
	border-bottom: 1px solid #ccc;
	padding-bottom: 5px;
}



.character-preview-content .glyph-box {
	background: rgb(240, 240, 240) !important; /* Hardcoded light background */
	color: rgba(0, 0, 0, 0.9) !important; /* Hardcoded dark text */
}

.character-preview-content .glyph-box.non-unicode {
	opacity: 0.6;
}

.character-preview-content .glyph-box svg {
	max-width: 100%;
	max-height: 100%;
}

body.dark-mode .character-preview-content .glyph-box {
	background: rgb(40, 40, 40) !important; /* Hardcoded dark background */
	color: rgba(250, 250, 250, 0.9) !important; /* Hardcoded light text */
	border: 1px solid rgba(255, 255, 255, 0.1);
}
.font-info-content h2 {
	margin: 30px 0 15px;
	font-size: 16px;
	font-weight: 600;
	border-bottom: 1px solid #ccc !important; /* Hardcoded border color */
	padding-bottom: 5px;
	color: rgba(0, 0, 0, 0.9) !important; /* Hardcoded dark text */
}

.info-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid #eee !important; /* Hardcoded border color */
	color: rgba(0, 0, 0, 0.9) !important; /* Hardcoded dark text */
}

.info-row:not(:last-child) {
	margin-bottom: 4px;
}

.info-row.multiline {
	align-items: flex-start;
	gap: 12px;
}

.info-label {
	font-size: 14px;
	color: rgba(0, 0, 0, 0.9) !important; /* Hardcoded dark text */
	max-width: 48%;
	line-height: 1.3;
}

.info-value {
	font-size: 14px;
	color: rgba(0, 0, 0, 0.9) !important; /* Hardcoded dark text */
	text-align: right;
	flex: 1;
	line-height: 1.3;
}

.info-row.multiline .info-value {
	text-align: left;
	white-space: pre-wrap;
	max-width: 60%;
}

/* Style for the ID numbers */
.info-label .id {
	font-style: italic;
	color: #666 !important; /* Hardcoded gray text */
}

/* OpenType Features Styles */
#opentype-features h3 {
	border-bottom: 1px solid var(--border-color);
}

#opentype-features .content {
	width: 100%;
	box-sizing: border-box;
	display: block;
	width: 100%;
	/* Match variable font controls spacing */
	padding: 10px;
}

#opentype-features.collapsed .content {
	display: none !important;
	max-height: 0 !important;
	overflow: hidden;
}

/* Standardize spacing and styling for all "Select a font" and "No fonts loaded" messages */
#opentype-features .content p:first-child:only-child,
#variable-font-controls .content p:first-child:only-child,
#loaded-fonts .content-fonts p:first-child:only-child {
	margin-top: 0;
	margin-bottom: 0;
	text-align: left;
	opacity: 0.4; /* Light grey styling like feature codes */
}

.feature-container {
	display: block;  /* Changed from flex to block */
	width: 100%;
	margin-bottom: 5px;
}

.feature-checkbox {
	margin-right: 10px;
}

.feature-name {
	display: inline;
}

.feature-separator {
	/*	color: var(--text-color);*/
	opacity: 0.2;
	margin: 0 5px 0 0;
	display: inline;
}

.feature-code {
	opacity: 0.4;
	font-size: 1em;
	font-style: italic;
	display: inline;
}

/* Custom Checkbox Styles */
.custom-checkbox {
	display: block;
	position: relative;
	padding-left: 24px;
	cursor: pointer;
	font-size: 1em;
	user-select: none;
	margin: 0.3em 0;
	width: 100%;
	line-height: 1.4;
}

.custom-checkbox input {
	position: absolute;
	opacity: 0;
	cursor: pointer;
	height: 0;
	width: 0;
}

.checkmark {
	position: absolute;
	top: 1px;
	left: 0;
	height: 13px;
	width: 16px;
	background-color: var(--button-bg);
	border: 1px solid var(--border-color);
	border-radius: 2px;
	transition: all 0.3s;
}

.custom-checkbox:hover input ~ .checkmark {
	background-color: var(--button-hover-bg);
}

.custom-checkbox input:checked ~ .checkmark {
	background-color: var(--custom-bg-color, var(--bg-color));
	border-color: var(--custom-bg-color, var(--bg-color));
}

.checkmark:after {
	content: "";
	position: absolute;
	display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
	display: block;
}

.custom-checkbox .checkmark:after {
	left: 5px;
	top: 0;
	width: 4px;
	height: 8px;
	border: solid var(--custom-text-color, var(--dark-text-color));
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}


/* Sidebar toggle styles */

.header-emoji-button {
	position: relative;
	font-size: 24px !important;
	cursor: pointer;
	background: none !important;
	border: none !important;
	padding: 0;
	margin: 0 5px;
	box-shadow: none !important;
	outline: none !important;
}

/* #sidebar-toggle.header-emoji-button {
	position: relative; */
	/* top: 1px;
	font-size: 25px !important; }*/

/* Remove any default button styles */
#sidebar-toggle, #style-switcher {
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	outline: none !important;
}

/* Position the sidebar toggle button */
#sidebar-toggle {
	position: absolute !important;
	top: 6px !important;
	right: 40px !important; /* Position to the left of the clown face */
	font-size: 22px !important;
	cursor: pointer !important;
	background: none !important;
	border: none !important;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	z-index: 1001 !important; /* Ensure it's above other elements */
}

/* Maintain the position of the style switcher button */
#style-switcher {
	position: absolute !important;
	top: 8px !important;
	right: 7px !important;
	font-size: 22px !important;
	cursor: pointer !important;
	background: none !important;
	border: none !important;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	z-index: 1001 !important;
}

/* Transitions for smooth animation */
#sidebar,
#main-content {
	transition: all 0.3s ease;
}

/* Hidden sidebar state */
.sidebar-hidden {
	margin-left: -280px !important; /* Move sidebar off-screen */
	opacity: 0;
}

#main-expandable-content {
	display: flex;
	flex-direction: column;
	transition: margin-left 0.3s ease, width 0.3s ease, padding-left 0.3s ease;
}

/* When sidebar is collapsed, slide content panels off to the left */
body.sidebar-collapsed #sidebar .collapsible,
body.sidebar-collapsed #sidebar #opentype-features,
body.sidebar-collapsed #sidebar #variable-fonts,
body.sidebar-collapsed #sidebar #glyph-inspector,
body.sidebar-collapsed #sidebar #about-section {
	transform: translateX(-100%) !important;
	opacity: 0 !important;
	transition: transform 0.3s ease 0s, opacity 0.3s ease 0s !important;
	transition-delay: 0s !important;
	pointer-events: none;
}

/* Ensure normal state has smooth transitions */
#sidebar .collapsible,
#sidebar #opentype-features,
#sidebar #variable-fonts,
#sidebar #glyph-inspector,
#sidebar #about-section {
	transform: translateX(0) !important;
	opacity: 1 !important;
	transition: transform 0.3s ease 0s, opacity 0.3s ease 0s !important;
	transition-delay: 0s !important;
}

/* Shrink the sidebar to minimal width when collapsed */
body.sidebar-collapsed #sidebar {
	width: 0;
	min-width: 0;
	max-width: 0;
	overflow: visible; /* Keep header visible since it's positioned absolutely */
}

/* Adjust style menu position when sidebar is collapsed */
body.sidebar-collapsed #style-menu {
	left: 0;
}

/* Expand main content when sidebar is collapsed */
body.sidebar-collapsed #main-content {
	margin-left: 0;
	width: 100vw; /* Use full viewport width when sidebar content is hidden */
}

/* Adjust text column itself */
body.sidebar-hidden .text-column {
	flex: 1 !important;
}

/* Hide sidebar content except header when collapsed */
.sidebar-collapsed #sidebar .sidebar-content > div:not(.sidebar-header) {
	display: none;
}

.sidebar-collapsed #sidebar {
	width: auto;
	min-width: auto;
	max-width: none;
	height: auto;
	overflow: visible;
}

#style-menu {
	position: fixed;
	top: 12px;
	left: 280px; /* Align with right edge of sidebar which is 280px wide */
	background-color: var(--color-white);
	border-radius: 3px;
	padding: 20px;
	z-index: 11000;
	font-size: 16px;
	width: 270px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.1);
	display: none;
	text-align: center;
	color: var(--text-color);
}

#style-menu.visible {
	display: block;
}

#style-menu-header {
	font-size: 18px;
	font-weight: bold;
	margin-bottom: 15px;
	color: rgba(0, 0, 0, 0.95); /* Use default black in light mode, not custom text color */
}

/* Dark mode style menu header */
body.dark-mode #style-menu-header {
	color: var(--dark-text-color);
}

/* Dark mode style menu */
body.dark-mode #style-menu {
	background-color: var(--dark-bg-color);
	color: var(--dark-text-color);
	box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

body.dark-mode #color-init-options p {
	color: var(--dark-text-color);
}

#light-mode-toggle,
#dark-mode-toggle,
#default-mode-toggle,
#random-mode-toggle {
	display: block;
	width: 100%;
	padding: 10px;
	margin: 10px 0;
	cursor: pointer;
	background-color: var(--button-bg);
	color: var(--text-color);
	border: 1px solid var(--border-color);
	border-radius: 2px;
	transition: background-color 0.3s;
}

#light-mode-toggle:hover,
#dark-mode-toggle:hover,
#default-mode-toggle:hover,
#random-mode-toggle:hover {
	background-color: var(--button-hover-bg);
}

/* Light mode styling */
#light-mode-toggle:not(.active-button),
#dark-mode-toggle:not(.active-button),
#default-mode-toggle:not(.active-button),
#random-mode-toggle:not(.active-button) {
	border-color: var(--border-color) !important;
	outline: none !important;
	border-style: solid !important;
	border-width: 1px !important;
}

#light-mode-toggle:not(.active-button):focus,
#dark-mode-toggle:not(.active-button):focus,
#default-mode-toggle:not(.active-button):focus,
#random-mode-toggle:not(.active-button):focus,
#light-mode-toggle:not(.active-button):focus-visible,
#dark-mode-toggle:not(.active-button):focus-visible,
#default-mode-toggle:not(.active-button):focus-visible,
#random-mode-toggle:not(.active-button):focus-visible {
	outline: none !important;
}

#light-mode-toggle.active-button,
#dark-mode-toggle.active-button,
#default-mode-toggle.active-button,
#random-mode-toggle.active-button {
	border-color: var(--custom-text-color, var(--text-color)) !important;
	outline: 1px solid var(--custom-text-color, var(--text-color)) !important;
	background-color: var(--button-hover-bg) !important;
}

/* Dark mode styling */
body.dark-mode #light-mode-toggle:not(.active-button),
body.dark-mode #dark-mode-toggle:not(.active-button),
body.dark-mode #default-mode-toggle:not(.active-button),
body.dark-mode #random-mode-toggle:not(.active-button) {
	border-color: var(--dark-border-color) !important;
	outline: none !important;
	border-style: solid !important;
	border-width: 1px !important;
}

body.dark-mode #light-mode-toggle:not(.active-button):focus,
body.dark-mode #dark-mode-toggle:not(.active-button):focus,
body.dark-mode #default-mode-toggle:not(.active-button):focus,
body.dark-mode #random-mode-toggle:not(.active-button):focus,
body.dark-mode #light-mode-toggle:not(.active-button):focus-visible,
body.dark-mode #dark-mode-toggle:not(.active-button):focus-visible,
body.dark-mode #default-mode-toggle:not(.active-button):focus-visible,
body.dark-mode #random-mode-toggle:not(.active-button):focus-visible {
	outline: none !important;
}

body.dark-mode #light-mode-toggle.active-button,
body.dark-mode #dark-mode-toggle.active-button,
body.dark-mode #default-mode-toggle.active-button,
body.dark-mode #random-mode-toggle.active-button {
	border-color: var(--custom-text-color, var(--dark-text-color)) !important;
	outline: 1px solid var(--custom-text-color, var(--dark-text-color)) !important;
	background-color: var(--dark-button-hover-bg) !important;
}

#style-menu-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 10001;
	display: none;
}

/* Color Picker */
.color-palette {
	margin-bottom: 1.25em;
}

.color-pickers {
	display: flex;
	justify-content: space-between;
	position: relative;
	height: 70px;

}
.color-picker {
	position: absolute;
	height: 40px;
	cursor: pointer;
	padding: 0 10px;
}

#bg-color-picker {
	width: 66%;
	left: 0;
	top: 0;
}

#text-color-picker {
	width: 30%;
	right: 0;
	bottom: 0px;
}

.color-picker-bg {
	width: 100%;
	height: 100%;
	border: 1px solid var(--border-color);
}

.color-picker-text {
	font-size: 56px;
	font-weight: bold;
	display: flex;
	justify-content: flex-end;
	align-items: flex-end;
	height: 100%;
	width: 100%;
	background-color: transparent;
	color: var(--custom-text-color);
	letter-spacing: 1px;
}

.color-picker input {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.rando-buttons {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-top: 10px;
}

.rando-buttons span {
	margin-right: 10px;
}

.rando-buttons button {
	flex: 1;
}

/* Coloris Plugin Styles */
.clr-picker {
	border-radius: 2px !important;
}

.clr-swatches {
	background: transparent;
}

.clr-preview {
	display: none !important;
}

input.clr-color {
	width: 100% !important;
	margin: 18px !important;
	padding: 0 5px !important;
}

/*body.dark-mode .clr-swatches::before {
color: #fff;
}*/

/* Swatch buttons: Coloris sets button.style.color = swatchColor.
   We display the swatch via background-color directly on the button,
   NOT via ::after + currentColor, because Coloris sets picker.style.color
   during drag which causes currentColor in pseudo-elements to flicker. */
.clr-swatches button {
	width: 30px;
	height: 30px;
	margin: 0 2px;
	padding: 0;
	border: 1px solid var(--border-color);
	position: relative !important;
	overflow: hidden !important;
	/* Use the Coloris-set 'color' property as the visible background */
	background: currentColor !important;
	font-size: 0 !important;
	text-indent: -9999px !important;
	box-sizing: border-box;
	border-radius: 3px;
	box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
}

/* Kill both pseudo-elements — we don't need them */
.clr-swatches button:before,
.clr-swatches button:after {
	content: none !important;
	display: none !important;
}

.clr-swatches::before {
	content: 'Recent\00A0\A Colors:' !important;
	word-break: break-word;
	white-space: normal;
	/*display: flex;*/
	max-width: 140px;
	color: #000;
	font-size: 1.3em;
	margin-top: -10px;
	text-align: center;
}

.clr-swatches div {
	margin-top: 10px;
}

.clr-segmented label {
	font-weight: inherit;
}

/*.clr-swatches button:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: var(--color);
border: 1px solid var(--border-color);
}*/

.clr-field {
	border-radius: 2px !important;
}

.clr-field button {
	display: none !important;
}

.clr-picker .clr-gradient {
	border-radius: 0 !important;
}

.clr-picker input[type="text"] {
	border-radius: 2px !important;
	font-family: inherit;
	font-size: 1.2em !important;
}

.clr-segmented label {
	font-weight: inherit;
	color: #000;
}

/* Dark Mode Styles */
body.dark-mode {
	--bg-color: var(--dark-bg-color);
	--text-color: var(--dark-text-color);
	--sidebar-bg: var(--dark-sidebar-bg);
	--button-bg: var(--dark-button-bg);
	--button-hover-bg: var(--dark-button-hover-bg);
	--border-color: var(--dark-border-color);
	--drop-overlay-bg: var(--dark-drop-overlay-bg);
	--sidebar-content-bg: var(--dark-sidebar-content-bg);
}

body.dark-mode #opentype-features .content:not(:has(.feature-container)) {
	color: var(--dark-text-color);
}



body.dark-mode .file-format {
	color: var(--dark-text-color);
}

body.dark-mode button:not(.active-button) {
	color: var(--dark-text-color);
	border: 1px solid;
	border-radius: 2px;
}

/* body.dark-mode .remove-column {
	color: var(--border-color)
} */

body.dark-mode .remove-column:hover {
	font-weight: 800 !important;
}

body.dark-mode select {
	background-color: var(--dark-button-bg);
	color: var(--dark-text-color);
	border-color: var(--dark-border-color);
	background-image: url("data:image/svg+xml;utf8,<svg fill='%23e0e0e0' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
}

body.dark-mode #add-some-fonts {
	color: var(--dark-text-color);
}

/* Default "Add Some Fonts" Area Styling */
#add-some-fonts {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 60vh;
	width: 100%;
	text-align: center;
}

#add-some-fonts .welcome-title {
	font-size: 4em;
	font-weight: 800;
	margin: 0 0 40px 0;
	color: var(--custom-text-color, var(--text-color));
}

#add-some-fonts .instruction {
	font-size: 2em;
	font-weight: 550;
	margin: 0 0 5px 0;
	color: var(--custom-text-color, var(--text-color));
}

#add-some-fonts .disclaimer {
	font-size: 2em;
	font-weight: 550;
	margin: 0 0 40px 0;
	color: var(--custom-text-color, var(--text-color));
	font-style: italic;
}

#add-some-fonts .or-text {
	font-size: 2em;
	font-weight: var(--show-me-mono-medium);
	margin: 0 0 12px 0;
	color: var(--custom-text-color, var(--text-color));
}

#add-some-fonts .or-text .emoji-system {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

#add-some-fonts .arrow-indicator {
	margin: -10px 0 0 0;
	font-feature-settings: "ss10" 1;
}

#add-some-fonts .interface-font-button {
	font-size: 1.5em;
	padding: 15px 25px;
	background-color: var(--button-bg);
	color: var(--text-color);
	border: 2px solid var(--custom-text-color, var(--text-color));
	border-radius: 5px;
	cursor: pointer;
	transition: all 0.3s ease;
	font-weight: 600;
}

#add-some-fonts .interface-font-button:hover {
	background-color: var(--custom-text-color, var(--text-color)) !important;
	color: var(--custom-bg-color, var(--bg-color)) !important;
	border-color: var(--custom-bg-color, var(--bg-color)) !important;
}

/* Dark mode adjustments for add-some-fonts */
body.dark-mode #add-some-fonts .welcome-title,
body.dark-mode #add-some-fonts .instruction,
body.dark-mode #add-some-fonts .disclaimer {
	color: var(--custom-text-color, var(--dark-text-color));
}

body.dark-mode #add-some-fonts .interface-font-button {
	background-color: var(--dark-button-bg);
	color: var(--dark-text-color);
	border-color: var(--custom-text-color, var(--dark-text-color));
}

body.dark-mode #add-some-fonts .interface-font-button:hover {
	background-color: var(--custom-text-color, var(--dark-text-color)) !important;
	color: var(--custom-bg-color, var(--dark-bg-color)) !important;
	border-color: var(--custom-bg-color, var(--dark-bg-color)) !important;
}

/* About Section Styling */
#about-section {
	text-align: center;
	padding: 10px 0 30px 0;
}

#sidebar #about-tester-button {
	font-size: 1.1em;
	padding: 15px 25px;
	background-color: var(--button-bg) !important;
	color: var(--text-color) !important;
	border: 2px solid var(--custom-text-color, var(--text-color)) !important;
	border-radius: 5px !important;
	cursor: pointer;
	transition: all 0.3s ease;
	font-weight: 600;
}

#sidebar #about-tester-button:hover {
	background-color: var(--custom-text-color, var(--text-color)) !important;
	color: var(--custom-bg-color, var(--bg-color)) !important;
	border-color: var(--custom-text-color, var(--text-color)) !important;
}

/* Dark mode styling for about section */
body.dark-mode #sidebar #about-tester-button {
	background-color: var(--dark-button-bg) !important;
	color: var(--dark-text-color) !important;
	border-color: var(--custom-text-color, var(--dark-text-color)) !important;
}

body.dark-mode #sidebar #about-tester-button:hover {
	background-color: var(--custom-text-color, var(--dark-text-color)) !important;
	color: var(--custom-bg-color, var(--dark-bg-color)) !important;
	border-color: var(--custom-text-color, var(--dark-text-color)) !important;
}

body.dark-mode .font-item {
	background-color: var(--dark-button-bg);
	color: var(--dark-text-color);
	border-color: transparent;
}

body.dark-mode .font-item:hover,
body.dark-mode .font-item-container:hover .font-item {
	background-color: var(--dark-button-hover-bg);
}

body.dark-mode .font-item.active {
	background-color: var(--dark-button-bg); /* Keep same background as default */
	border-color: var(--custom-text-color, var(--dark-text-color));
}

body.dark-mode .font-info-icon {
	color: rgba(255, 255, 255, 0.6);
}

body.dark-mode .font-info-icon:hover {
	color: var(--dark-highlight-color);
}

body.dark-mode input[type="range"] {
	background: var(--dark-border-color);
}

body.dark-mode .glyph-grid .glyph-box {
	border-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .text-display.glyph-grid {
	background: transparent;
}

body.dark-mode .text-column {
	background: transparent;
}

/* When background image is applied, make text columns transparent in dark mode */
body[style*="background-image"].dark-mode .text-column {
	background: transparent !important;
}

/* Also make text-display elements transparent when background image is applied - but only in text columns */
body[style*="background-image"].dark-mode #text-columns .text-display {
	background: transparent !important;
}

/* Dark mode styles for font info popup */
body.dark-mode .font-info-popup {
	background-color: rgb(40, 40, 40) !important; /* Hardcoded dark background */
	color: rgba(250, 250, 250, 0.9) !important; /* Hardcoded light text */
	box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

body.dark-mode .font-info-content h2 {
	color: rgba(250, 250, 250, 0.9) !important; /* Hardcoded light text */
	border-bottom-color: rgba(255, 255, 255, 0.2) !important; /* Hardcoded light border */
}

body.dark-mode .info-row {
	color: rgba(250, 250, 250, 0.9) !important; /* Hardcoded light text */
	border-bottom-color: rgba(255, 255, 255, 0.1) !important; /* Hardcoded light border */
}

body.dark-mode .info-label,
body.dark-mode .info-value {
	color: rgba(250, 250, 250, 0.9) !important; /* Hardcoded light text */
}

body.dark-mode .info-label .id {
	color: rgba(255, 255, 255, 0.6) !important; /* Hardcoded light gray text */
}

body.dark-mode .font-info-popup .close-button {
	color: rgba(250, 250, 250, 0.9) !important; /* Hardcoded light text */
}

/* Fade-out effect for column dropdowns and close buttons when sidebar is collapsed */
body.sidebar-collapsed .font-select,
body.sidebar-collapsed .remove-column,
body.sidebar-collapsed #compare-fonts {
	transition: opacity 0.5s ease;
	opacity: 1;
}
body.sidebar-collapsed .fade-out,
body.sidebar-collapsed #compare-fonts.fade-out {
	opacity: 0;
	pointer-events: none;
}

/* About popup easter egg */
#about-easter-egg {
	text-align: center;
	margin: 20px 0 5px 0;
	font-size: 24px;
	cursor: pointer;
	user-select: none;
}

/* Rainbow text styling */
.rainbow-text {
	font-size: 1.8em;
	line-height: 1;
	display: inline-block;
	cursor: pointer;
	user-select: none;
}

#about-content h2 {
	text-align: center;
}

.emoji {
	font-family: Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, sans-serif;
	font-style: normal;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
