/* =====================
   ArtGalleryStyles.css - Main Stylesheet for Art Gallery Website
   Contains variables, theming, layout, grid, modals, buttons, and responsive design.
   ===================== */

/* ============== ROOT VARIABLES ============== */
:root {
	/*
	   Base Theme Colors: Used for backgrounds and panels
	   Adjust these to change the overall color scheme
	*/
	--bg-main: #f7e8c3;
	--bg-secondary: #f0d792;
	--bg-dark: #0e3513;
	--bg-panel: #fff9e6;

	/* Accent Colors: Used for highlights, borders, and buttons */
	--accent: #79672e;
	--accent-dark: #b4942d;
	--border: #8b7355;

	/* Text Colors: For main text, headers, and accents */
	--text-main: #41372b;
	--text-accent: #fff;
	--text-header: #ffffff;

	/* Shadows: Used for depth and separation */
	--shadow: 0 2px 8px #d4af3744;
	--shadow-strong: 0 2px 16px #b4942d66;
	--shadow-inset: 0 2px 8px #8b735533 inset;

	/* Modal Colors: For modal backgrounds and headers */
	--modal-bg: #fff9e6;
	--modal-border: #d4af37;
	--modal-header-bg: #b4942d;
	--modal-header-text: #fff9e6;
	--modal-section-header: #b4942d;

	/* Button Colors: For all main buttons */
	--button-bg: #c5a026;
	--button-hover-bg: #b4942d;
	--button-text: #fff9e6;

	/* Form Input Colors: For input backgrounds and borders */
	--input-bg: #fff9e6;
	--input-border: #d4af37;
	--input-text: #8b7355;

	/* Dropdown Colors: For dropdown menus and items */
	--dropdown-bg: #f0d792;
	--dropdown-hover-bg: #d4af37;
	--dropdown-text: #8b7355;
	--dropdown-hover-text: #fff;

	/* Pagination Colors: For pagination controls */
	--pagination-bg: #f6e7b2;
	--pagination-text: #000000;
	--pagination-border: #bfa76a;
	--pagination-current-bg: #bfa76a;
	--pagination-current-text: #000000;
	--pagination-current-border: #a97b2c;
	--pagination-current-shadow: 0 0 8px 2px #a97b2c;

	/* Footer Colors: For the site footer */
	--footer-bg: #bfa76a;
	--footer-text: #fff;

	/* Featured Section Colors: For the featured artworks area */
	--featured-bg: linear-gradient(to bottom,
			var(--bg-secondary),
			var(--bg-panel));
	--featured-border: #b4942d;
	--featured-header: #79672e;

	/* Sidebar Colors: For the sidebar filter area */
	--sidebar-bg: var(--bg-secondary);
	--sidebar-border: var(--border);
	--sidebar-text: var(--text-main);
	--sidebar-button-bg: var(--button-bg);
	--sidebar-button-text: var(--button-text);

	/* Gallery Content Colors: For the main gallery area */
	--gallery-bg: var(--bg-panel);
	--gallery-border: var(--border);
	--gallery-header: var(--accent-dark);

	/* Art Grid Colors: For artwork cards and grid */
	--art-item-bg: var(--bg-panel);
	--art-item-border: var(--accent);
	--art-item-hover-border: var(--accent-dark);
	--art-title-color: var(--text-main);

	/* Container-Specific Button Colors: For buttons in different sections */
	--featured-button-bg: #d4af37;
	--featured-button-hover-bg: #b4942d;
	--featured-button-text: #fff9e6;
	--featured-button-border: #8b7355;

	--modal-button-bg: #c5a026;
	--modal-button-hover-bg: #b4942d;
	--modal-button-text: #fff9e6;
	--modal-button-border: #8b7355;

	--sidebar-button-bg: #d4af37;
	--sidebar-button-hover-bg: #b4942d;
	--sidebar-button-text: #fff9e6;
	--sidebar-button-border: #8b7355;

	--gallery-button-bg: #c5a026;
	--gallery-button-hover-bg: #b4942d;
	--gallery-button-text: #fff9e6;
	--gallery-button-border: #8b7355;

	/* Re-randomize Button Colors: For the featured section's dice button */
	--rerandom-button-bg: #c5a026;
	--rerandom-button-hover-bg: #b4942d;
	--rerandom-button-text: #fff9e6;
	--rerandom-button-border: #a97b2c;

	/* New Theme-agnostic Variables: For favorites, focus, etc. */
	--favorite-color: #ff69b4;
	--favorite-color-hover: #ffc0cb;
	--focus-ring-color: #ffcc00;
	--focus-ring-shadow: rgba(255, 204, 0, 0.3);

	/* Loading Skeleton: For loading placeholders */
	--loading-bg-start: #f0f0f0;
	--loading-bg-mid: #e0e0e0;
	--loading-bg-end: #f0f0f0;

	--art-gradient-border-start: #ffe082;
	--art-gradient-border-end: #bfa76a;
	--art-gradient-border-dark-start: #3a3a6a;
	--art-gradient-border-dark-end: #bfa76a;
}

/* ============== DARK THEME OVERRIDES ============== */
body.dark-theme {
	/*
	   All variables here override the :root variables above when .dark-theme is on <body>
	   This enables easy light/dark theming throughout the site.
	*/
	--bg-main: #2d3748;
	--bg-secondary: #1a202c;
	--bg-dark: #121212;
	--bg-panel: #2d3748;

	--accent: #f6e05e;
	--accent-dark: #d69e2e;
	--border: #4a5568;

	--text-main: #e2e8f0;
	--text-accent: #1a202c;
	--text-header: #f7fafc;

	--shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	--shadow-strong: 0 2px 16px rgba(0, 0, 0, 0.5);
	--shadow-inset: 0 2px 8px rgba(0, 0, 0, 0.4) inset;

	--modal-bg: #2d3748;
	--modal-border: var(--accent-dark);
	--modal-header-bg: #1a202c;
	--modal-header-text: var(--text-header);
	--modal-section-header: var(--accent);

	--button-bg: var(--accent-dark);
	--button-hover-bg: var(--accent);
	--button-text: #1a202c;

	--input-bg: #1a202c;
	--input-border: var(--border);
	--input-text: var(--text-main);

	--dropdown-bg: #4a5568;
	--dropdown-hover-bg: var(--accent-dark);
	--dropdown-text: var(--text-main);
	--dropdown-hover-text: #1a202c;

	--pagination-bg: #181818;
	--pagination-text: #fff;
	--pagination-border: #ffd700;
	--pagination-current-bg: #ffd700;
	--pagination-current-text: #222;
	--pagination-current-border: #ffd700;
	--pagination-current-shadow: 0 0 8px 2px #ffd700;

	--footer-bg: #1a202c;
	--footer-text: var(--text-main);

	--featured-bg: linear-gradient(to bottom,
			var(--bg-secondary),
			var(--bg-panel));
	--featured-border: var(--accent-dark);
	--featured-header: var(--accent);

	--sidebar-bg: var(--bg-secondary);
	--sidebar-border: var(--border);
	--sidebar-text: var(--text-main);

	--gallery-bg: var(--bg-panel);
	--gallery-border: var(--border);
	--gallery-header: var(--accent);

	--art-item-bg: var(--bg-panel);
	--art-item-border: var(--accent);
	--art-item-hover-border: var(--accent-dark);
	--art-title-color: var(--text-main);

	--featured-button-bg: var(--accent-dark);
	--featured-button-hover-bg: var(--accent);
	--featured-button-text: #1a202c;
	--featured-button-border: var(--accent-dark);

	--rerandom-button-bg: var(--accent-dark);
	--rerandom-button-hover-bg: var(--accent);
	--rerandom-button-text: #1a202c;
	--rerandom-button-border: var(--accent-dark);

	--favorite-color: #ff69b4;
	--favorite-color-hover: #ffc0cb;
	--focus-ring-color: #f6e05e;
	--focus-ring-shadow: rgba(246, 224, 94, 0.4);

	--loading-bg-start: #4a5568;
	--loading-bg-mid: #2d3748;
	--loading-bg-end: #4a5568;
}

/* ============== GLOBAL ELEMENT STYLES ============== */
html,
*,
*::before,
*::after {
	box-sizing: border-box;
}

svg,
.icon {
	display: inline-block;
	vertical-align: middle;
	width: 1em;
	height: 1em;
	fill: currentColor;
	shape-rendering: geometricPrecision;
}

body {
	font-family: "EB Garamond", "Cormorant Garamond", "Georgia", "Times New Roman", serif;
	background: var(--bg-dark) url("https://www.transparenttextures.com/patterns/green-fibers.png");
	color: var(--text-main);
	border: none;
	box-shadow: 0 0 60px #000a;
	min-height: 100vh;
	padding: 32px 10px;
	position: relative;
	overflow-x: hidden;
}

body.sidebar-open-padding {
	/* New class to be added by JS */
	padding-top: 10px;
	/* Reduced padding when sidebar is open and toggle is hidden */
}



/* Remove any old pseudo-elements */

/* ============== HEADER STYLING ============== */
header {
	padding: 20px 0;
	text-align: center;
	margin-bottom: 10px;
	/* Space below header before nav */
}

/* ============== SECTION DIVIDER STYLING ============== */
.section-divider {
	height: 50px;
	/* Adjust height as needed */
	background-image: url("https://openclipart.org/download/314167/Vintage_Roses_Flourish_Line_Art_Gold_No_BG.svg");
	/* Gold flourish SVG */
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	/* Or adjust as needed, e.g., auto 100% */
	margin: 20px 0;
	/* Adjust spacing as needed */
	border: none;
	/* Remove any default borders */
}

/* ============== SKIP LINK STYLING ============== */
.skip-link {
	position: absolute;
	left: -9999px;
	/* Move it far off-screen initially */
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
	/* Standard visually-hidden styles, but allowing focus */
	padding: 0;
	margin: -1px;
	/* to ensure no layout impact */
	border: 0;
	clip: rect(0 0 0 0);
	/* deprecated but still used as fallback */
	clip-path: inset(50%);
	/* modern way */

	/* Keep your theming for when it becomes visible */
	background-color: var(--accent-dark);
	color: var(--text-accent);
	font-family: "Cinzel", serif;
	text-decoration: none;
	box-shadow: var(--shadow-strong);
	z-index: 9999;
	border-radius: 0 0 5px 5px;
	transition: none;
	/* Remove transitions for this pattern initially, can add back if needed */
}

.skip-link:focus {
	left: 10px;
	/* Bring it on-screen */
	top: 0;
	width: auto;
	/* Let content dictate width */
	height: auto;
	/* Let content dictate height */
	overflow: visible;
	padding: 10px 15px;
	/* Your original padding */
	margin: 0;
	clip: auto;
	clip-path: none;
	outline: 2px solid var(--accent);
	/* Keep your focus outline */
}

/* Accessible focus styles for all interactive elements */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus,
.art-card:focus {
	outline: 3px solid var(--focus-ring-color);
	outline-offset: 2px;
	box-shadow: 0 0 0 3px var(--focus-ring-shadow);
	z-index: 10;
}

.art-card:focus {
	border-color: var(--focus-ring-color);
}

/* Ensure skip link is visible on focus (already added in HTML, but reinforce here) */
.skip-link:focus {
	position: absolute;
	left: 10px;
	top: 10px;
	background: var(--bg-panel);
	color: var(--text-main);
	padding: 8px 16px;
	border: 2px solid var(--border);
	z-index: 10000;
	outline: none;
	text-decoration: underline;
}

/* ============== THUMBNAIL & ACCESSIBILITY IMPROVEMENTS ============== */
/* Make thumbnail clickable area a real button for keyboard users */
.thumb-button {
	display: block;
	width: 100%;
	padding: 0;
	margin: 0;
	border: none;
	background: transparent;
	text-align: left;
	cursor: pointer;
}

.responsive-thumb {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
	border-radius: 6px;
}

/* Larger hit target for favorite controls and visible pressed state */
.favorite-btn {
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	background: rgba(0,0,0,0.0);
	border: 1px solid transparent;
}
.favorite-btn[aria-pressed="true"] i { color: var(--favorite-color); }

/* Improve focus visibility for keyboard users (use :focus-visible where available) */
:focus-visible {
	outline: 3px solid var(--focus-ring-color);
	outline-offset: 2px;
	box-shadow: 0 0 0 3px var(--focus-ring-shadow);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
	* {
		animation: none !important;
		transition: none !important;
	}
}

/* ============== CONTAINER BORDER STYLES ============== */
/* Main page framing will be handled by body border-image and img.ornate-corner */


#featured-art::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(to right, var(--accent), var(--accent-dark));
}

#featured-art h2 {
	font-family: "Cinzel Decorative", "Cinzel", serif;
	font-size: 2em;
	color: var(--text-main);
	text-align: center;
	margin: 0 0 1rem 0;
	position: relative;
	display: inline-block;
}

#featured-art h2::after {
	content: "";
	position: absolute;
	width: 100%;
	height: 4px;
	bottom: -4px;
	left: 0;
	background: linear-gradient(to right,
			transparent,
			var(--accent),
			transparent);
}

#featured-art .featured-header {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	gap: 0.5em;
}

#featured-art .featured-header>.featured-left {
	order: 1;
	justify-content: flex-start;
	flex: 0 0 auto;
}

#featured-art .featured-header>.featured-center {
	order: 2;
	flex: 1 1 auto;
	text-align: center;
	justify-content: center;
	min-width: 0;
}

#featured-art .featured-header>.featured-right {
	order: 3;
	justify-content: flex-end;
	flex: 0 0 auto;
}

#featured-art .featured-header button {
	min-width: 40px;
	max-width: 100%;
}

.art-grid,
#pagination {
	border: none;
	box-shadow: none;
	border-radius: 0;
	padding: 10px 0;
	/* Basic spacing */
}

/* ============== MODAL STYLES ============== */
/* Ensure modals are hidden by default */
#advanced-filters-modal,
#tags-modal,
#performance-dashboard-modal {
	/* display: none; /* Default hidden state - changing approach */
	visibility: hidden;
	/* DIAGNOSTIC: Force hidden */
	opacity: 0;
	/* DIAGNOSTIC: Force transparent */
	transition:
		opacity 0.3s ease,
		visibility 0s linear 0.3s;
	position: fixed;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	background-color: var(--bg-panel, #fff8e1);
	/* Thematic background */
	/* Ornate border for modals */
	border-width: 16px;
	/* Adjust thickness as needed */
	border-style: solid;
	border-image: var(--ornament-border, var(--ornate-border-fallback)) 32 repeat;
	box-shadow: var(--shadow-strong, 0 2px 16px #bfa76a55);
	z-index: 1000;
	padding: 0;
	/* Remove padding, header/content will manage it */
	border-radius: 0;
	/* Ornate border often looks better without radius */
	width: 640px;
	/* Increased width for horizontal fit */
	max-width: 98vw;
	/* Allow almost full viewport width */
	min-width: 340px;
	/* Prevent too small on mobile */
	display: flex;
	/* Always flex, visibility controls appearance */
	flex-direction: column;
	/* position: relative; /* Needed for pseudo-elements - can be removed if ornaments are gone */
	max-height: 80vh;
}

#advanced-filters-modal.modal-visible,
#tags-modal.modal-visible,
#performance-dashboard-modal.modal-visible {
	opacity: 1;
	/* Ensure visible state overrides */
	visibility: visible;
	/* Ensure visible state overrides */
	transition:
		opacity 0.3s ease,
		visibility 0s linear 0s;
}

#fullscreen-viewer {
	/* Styles for fullscreen viewer are likely more specific */
	/* but ensure it's hidden if it also behaves like a modal initially */
	display: none;
	/* Assuming it's controlled by JS to become visible */
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.9);
	/* Semi-transparent background */
	z-index: 2000;
	/* High z-index to be on top */
	/* Flexbox to center content if needed, adjust as per your layout */
	display: flex;
	align-items: center;
	justify-content: center;
	/* Initially hidden, made visible by JS adding .visible class */
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.3s ease,
		visibility 0s linear 0.3s;
	outline: none;
	/* Remove default outline since we'll add custom focus styles */
}

#fullscreen-viewer.visible {
	display: flex;
	/* Or block, depending on internal layout */
	opacity: 1;
	visibility: visible;
	transition:
		opacity 0.3s ease,
		visibility 0s linear 0s;
}

#fullscreen-viewer.modal-has-modal #close-btn {
	display: none;
}

/* Unified modal content wrapper styles */
.modal-content-wrapper {
	overflow-y: auto;
	flex-grow: 1;
	min-height: 0;
	padding: 15px 20px;
	display: block;
	background-color: var(--bg-main);
	border: 2px solid var(--accent-dark, #a97b2c);
	margin: 10px;
	scrollbar-gutter: stable;
}

/* Stylized Scrollbars for Modal Content */
.modal-content-wrapper::-webkit-scrollbar {
	width: 10px;
}

.modal-content-wrapper::-webkit-scrollbar-track {
	background: var(--bg-secondary, #e9d8a6);
	border-radius: 10px;
}

.modal-content-wrapper::-webkit-scrollbar-thumb {
	background: var(--accent-dark, #a97b2c);
	border-radius: 10px;
}

.modal-content-wrapper::-webkit-scrollbar-thumb:hover {
	background: var(--border, #7c6844);
}

/* For Firefox */
.modal-content-wrapper {
	scrollbar-width: thin;
	scrollbar-color: var(--accent-dark, #a97b2c) var(--bg-secondary, #e9d8a6);
}

/* Unified modal header styles */
.modal-header {
	background-color: var(--accent-dark, #a97b2c);
	color: var(--text-header, #f6e7b2);
	font-family: "Cinzel Decorative", "Cinzel", serif;
	padding: 15px 20px;
	margin: 0;
	text-align: center;
	font-size: 1.8em;
	border-bottom: 2px solid var(--border, #7c6844);
}

/* Specific to advanced-filters-modal structure */
#advanced-filters-modal #current-gallery-info {
	padding: 10px 0;
	text-align: center;
	font-style: italic;
	color: var(--text-main);
	border-bottom: 1px dashed var(--border);
	margin-bottom: 15px;
}

/* Unified modal search container styles */
.modal-search-container {
	margin-bottom: 20px;
	position: relative;
}

.modal-search-container input[type="text"] {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 15px 10px 35px;
	background-color: var(--input-bg, #fff8e1);
	border: 1px solid var(--input-border, #bfa76a);
	border-radius: 4px;
	color: var(--input-text, #7c6844);
	font-size: 1em;
}

.modal-search-container .fa-search {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--input-border, #bfa76a);
}

#advanced-filters-sections section {
	margin-bottom: 20px;
}

#advanced-filters-sections h3 {
	font-family: "Cinzel", serif;
	color: var(--accent-dark, #a97b2c);
	border-bottom: 1px solid var(--accent, #bfa76a);
	padding-bottom: 8px;
	margin-bottom: 10px;
	font-size: 1.4em;
}

#advanced-filters-sections .dropdown-item {
	/* Styling for generated category/tag items */
	padding: 6px 12px;
	/* Match tags-modal items */
	cursor: pointer;
	border-radius: 4px;
	/* margin-bottom: 4px; Remove, use gap on parent */
	transition:
		background-color 0.2s ease,
		color 0.2s ease;
	color: var(--text-main);
	background-color: var(--dropdown-bg, #e9d8a6);
	/* Default background */
	border: 1px solid var(--input-border, #bfa76a);
	/* Add border */
	display: inline-block;
	/* Allow items to sit side-by-side if space allows */
	margin: 4px;
	/* Spacing around items */
}

/* Ensure parent lists use flex for wrapping */
#advanced-categories-list,
#advanced-subcategories-list,
#advanced-tags-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	/* Consistent gap */
	align-items: center;
	/* Align items nicely if they have different heights */
}

#advanced-filters-sections .dropdown-item:hover {
	background-color: var(--dropdown-hover-bg, #bfa76a);
	color: var(--dropdown-hover-text, #fff);
}

/* Styling for selected items in advanced filters modal */
#advanced-filters-sections .dropdown-item.selected-filter-item {
	background-color: var(--accent-dark, #a97b2c);
	/* Ensure override */
	color: var(--text-accent, #fff);
	font-weight: bold;
	border-color: var(--accent-dark, #a97b2c);
}

#advanced-filters-modal button[type="button"]#apply-filters-advanced {
	display: block;
	width: calc(100% - 40px);
	/* Full width minus padding */
	margin: 20px auto 0;
	/* Centered with auto horizontal margins */
	padding: 12px 20px;
	background-color: var(--button-bg, #bfa76a);
	color: var(--button-text, #fff);
	border: none;
	border-radius: 4px;
	font-family: "Cinzel Decorative", "Cinzel", serif;
	font-size: 1.2em;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

#advanced-filters-modal button[type="button"]#apply-filters-advanced:hover {
	background-color: var(--accent-dark, #a97b2c);
}

#advanced-filters-modal button[type="button"]#apply-filters-advanced:disabled {
	background-color: var(--border);
	/* Darker gray when disabled */
	color: var(--text-main);
	cursor: not-allowed;
	opacity: 0.6;
}

/* Unified modal close button styles */
.modal-close-btn {
	position: absolute;
	top: -14px;
	right: -14px;
	width: 36px;
	height: 36px;
	font-size: 1.5em;
	font-weight: bold;
	color: var(--text-header, #f6e7b2);
	background-color: var(--accent-dark, #a97b2c);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 1001;
	transition: color 0.2s, background-color 0.2s, transform 0.2s;
	line-height: 1;
	border: 2px solid var(--bg-panel, #fff8e1);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	padding: 0;
}

.modal-close-btn:hover {
	color: #000;
	background-color: var(--border, #7c6844);
	transform: scale(1.1);
}

/* Similar styling for #tags-modal (used in fullscreen) for consistency */
#tags-modal {
	/* display: none; Already handled by the shared rule */
	/* position, left, top, transform, background-color, border, box-shadow, z-index, padding, border-radius - Inherited or set by shared rule */
	width: 900px;
	max-width: 98vw;
	min-width: 340px;
	max-height: 95vh;
	/* Adjusted max-height */
	/* Ensure flex direction is column for its direct children */
	flex-direction: column;
	z-index: 2100;
}


#tags-modal .categories,
#tags-modal .subcategories,
#tags-modal .tags {
	margin-bottom: 15px;
	padding: 10px;
	border: 1px dashed var(--border, #7c6844);
	border-radius: 4px;
	background-color: var(--bg-secondary);
	min-height: 50px;
	/* Ensure section is visible even if empty initially */
	display: flex;
	/* Allow items to wrap and align */
	flex-wrap: wrap;
	gap: 8px;
	/* Spacing between tag-like boxes */
}

#tags-modal .section-header {
	font-family: "Cinzel", serif;
	color: var(--accent-dark, #a97b2c);
	margin-bottom: 10px;
	/* Increased margin */
	font-size: 1.3em;
	/* Increased size */
	font-weight: bold;
	width: 100%;
	/* Ensure header takes full width before items wrap */
}

#tags-modal span[tabindex="0"] {
	display: inline-block;
	padding: 6px 12px;
	/* Larger padding for div-like feel */
	/* margin: 2px; Removed, using gap on parent */
	border-radius: 4px;
	cursor: pointer;
	background-color: var(--dropdown-bg, #e9d8a6);
	color: var(--text-main);
	transition:
		background-color 0.2s ease,
		color 0.2s ease;
	font-size: 0.95em;
	/* Adjusted size */
	border: 1px solid var(--input-border, #bfa76a);
	/* Add border to look more like boxes */
}

#tags-modal span[tabindex="0"]:hover {
	background-color: var(--dropdown-hover-bg, #bfa76a);
	color: var(--dropdown-hover-text, #fff);
	border-color: var(--dropdown-hover-bg, #bfa76a);
}

#tags-modal .modal-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 10px 0;
	flex-shrink: 0;
	width: 100%;
	/* Take full width */
}


/* ============== SIDEBAR STYLES ============== */
#sidebar-filters {
	/* Default state (e.g., for larger screens or when .open is not present) */
	width: 280px;
	/* Example width, adjust as needed */
	padding: 10px;
	box-sizing: border-box;
	/* The existing border styles will apply from the rule at line 60 */
	/* Ensure #filters div can take up space */
	display: flex;
	/* Use flex to allow #filters to grow */
	flex-direction: column;
	background-color: var(--bg-secondary);
	/* Give sidebar a slightly different panel bg */
	border-width: 2px;
	/* Slimmer border for flyout */
	position: relative;
	/* Ensure close button can be positioned absolutely within */
}

#filters {
	flex-grow: 1;
	/* Allows #filters to take available space */
	overflow-y: auto;
	/* Add scroll if content exceeds height */
}

/* Mobile/collapsible sidebar specific styles */




/* ============== FULLSCREEN VIEWER IMAGE & DETAILS STYLES ============== */
#fullscreen-img-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 90vw;
	height: calc(100vh - 70px);
	padding: 10px;
	box-sizing: border-box;
	position: relative;
}

#fullscreen-img-wrapper {
	flex-grow: 1;
	flex-shrink: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	overflow: hidden;
	margin-bottom: 10px;
}


#fullscreen-thumbnails {
	margin-top: 14px;
	margin-bottom: 0;
	z-index: 1001;
}

#fullscreen-img-error {
	max-width: 90vw;
	min-width: 260px;
	z-index: 1001;
	pointer-events: auto;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
	text-align: center;
}

#fullscreen-img {
	max-width: 80vw;
	max-height: 80vh;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	margin: 0 auto;
	border-radius: 8px;
	box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

#fullscreen-img {
  -webkit-user-drag: none;
  user-select: none;
  touch-action: none;
}

#fullscreen-details {
	display: none;
	/* Hidden by default, JS will toggle */
	flex-shrink: 0;
	width: 100%;
	max-width: 80vw;
	/* Max width for readability, can be % of parent too */
	padding: 15px;
	box-sizing: border-box;
	background-color: rgba(0, 0, 0, 0.75);
	/* Slightly more opaque */
	color: #fff;
	border-radius: 8px;
	/* Apply to all corners if it's a distinct box */
	text-align: center;
	/* margin-top: 10px; /* Removed, wrapper has margin-bottom */
}

#fullscreen-details h3 {
	margin-top: 0;
	margin-bottom: 10px;
	font-size: 1.4em;
}

#fullscreen-details p {
	margin-bottom: 8px;
	font-size: 1em;
}

#fullscreen-details p:last-child {
	margin-bottom: 0;
}

/* Close button for fullscreen viewer */
#fullscreen-viewer #close-btn {
	position: absolute;
	top: 15px;
	/* Adjust as needed */
	right: 15px;
	/* Adjust as needed */
	font-size: 1.8em;
	/* Adjust size */
	font-weight: bold;
	color: var(--text-header);
	/* White color */
	background-color: rgba(0, 0, 0, 0.3);
	border-radius: 50%;
	width: 36px;
	/* Size of circle */
	height: 36px;
	/* Size of circle */
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	cursor: pointer;
	z-index: 2005;
	/* Ensure it's above other fullscreen content */
	transition:
		color 0.2s ease,
		background-color 0.2s ease;
	line-height: 1;
}

#fullscreen-viewer #close-btn:hover {
	color: #dddddd;
	background-color: rgba(0, 0, 0, 0.6);
}

/* Ensure fullscreen menu is visible if JS sets it to flex */
#fullscreen-menu-bar {
	display: none;
	width: 100%;
	justify-content: center;
	padding: 10px 0;
	background-color: rgba(0, 0, 0, 0.8);
	position: absolute;
	bottom: 0;
	left: 0;
	z-index: 2001;
	/* Ensure it's inside the fullscreen viewer container */
	margin: 0;
	border-radius: 0;
}


/* ============== CUSTOM NOTIFICATION POPUP ============== */
.custom-notification {
	position: fixed;
	top: 20px;
	right: 20px;
	background: #2d3748;
	border: 2px solid #4a5568;
	border-radius: 8px;
	padding: 1rem 1.5rem;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	z-index: 10000;
	max-width: 400px;
	transform: translateX(100%);
	transition: transform 0.3s ease, opacity 0.3s ease;
	opacity: 0;
	font-weight: 500;
	line-height: 1.4;
	font-family: "Cinzel", serif;
	font-size: 1rem;
	color: #e2e8f0;
}

.custom-notification.show {
	transform: translateX(0);
	opacity: 1;
}

/* Notification type styles for better visibility */
.custom-notification.info {
	background: #e3f2fd;
	border-color: #2196f3;
	color: #0d47a1;
	box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.custom-notification.success {
	background: #e8f5e8;
	border-color: #4caf50;
	color: #1b5e20;
	box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.custom-notification.warning {
	background: #fff3e0;
	border-color: #ff9800;
	color: #e65100;
	box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.custom-notification.error {
	background: #ffebee;
	border-color: #f44336;
	color: #b71c1c;
	box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

/* Light theme notification adjustments */
body:not(.dark-theme) .custom-notification {
	background: #ffffff;
	border-color: #e2e8f0;
	color: #2d3748;
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Dark theme notification adjustments */
body.dark-theme .custom-notification.info {
	background: #1a237e;
	border-color: #42a5f5;
	color: #e3f2fd;
}

body.dark-theme .custom-notification.success {
	background: #1b5e20;
	border-color: #66bb6a;
	color: #e8f5e8;
}

body.dark-theme .custom-notification.warning {
	background: #e65100;
	border-color: #ffb74d;
	color: #fff3e0;
}

body.dark-theme .custom-notification.error {
	background: #b71c1c;
	border-color: #ef5350;
	color: #ffebee;
}

/* Notification icons */
.custom-notification::before {
	content: '';
	display: inline-block;
	width: 20px;
	height: 20px;
	margin-right: 0.5rem;
	vertical-align: middle;
	background-size: contain;
	background-repeat: no-repeat;
}

.custom-notification.info::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232196f3'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
}

.custom-notification.success::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234caf50'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
}

.custom-notification.warning::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff9800'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E");
}

.custom-notification.error::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f44336'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
}

/* Dark theme icon adjustments */
body.dark-theme .custom-notification.info::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2342a5f5'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
}

body.dark-theme .custom-notification.success::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2366bb6a'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
}

body.dark-theme .custom-notification.warning::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffb74d'%3E%3Cpath d='M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z'/%3E%3C/svg%3E");
}

body.dark-theme .custom-notification.error::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ef5350'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
}

/* Responsive notifications */
@media (max-width: 768px) {
	.custom-notification {
		top: 10px;
		right: 10px;
		left: 10px;
		max-width: none;
		font-size: 0.9rem;
		padding: 0.75rem 1rem;
	}
}

@media (max-width: 480px) {
	.custom-notification {
		top: 5px;
		right: 5px;
		left: 5px;
		font-size: 0.85rem;
		padding: 0.5rem 0.75rem;
	}
}

/* Styling for items in tags modal */
#tags-modal .filter-item-span {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 4px;
	cursor: pointer;
	background-color: var(--modal-bg, #ffffff);
	color: var(--text-main);
	transition:
		background-color 0.2s ease,
		color 0.2s ease;
	font-size: 0.95em;
	/* Adjusted size */
	border: 1px solid var(--input-border, #bfa76a);
	/* Add border to look more like boxes */
}

#tags-modal .filter-item-span:hover {
	background-color: var(--dropdown-hover-bg, #bfa76a);
	color: var(--dropdown-hover-text, #fff);
	border-color: var(--dropdown-hover-bg, #bfa76a);
}

#tags-modal .filter-item-span.selected-filter-item {
	background-color: var(--accent-dark, #a97b2c);
	color: var(--text-accent, #fff);
	border-color: var(--accent-dark, #a97b2c);
	font-weight: bold;
}

.no-filters-message {
	padding: 10px;
	text-align: center;
	color: var(--text-main);
	font-style: italic;
	width: 100%;
	/* Ensure it takes full width in its container */
}

/* ============== NAVIGATION BAR STYLES ============== */
nav>.topnav {
	background-color: transparent;
	padding: 10px 0;
	text-align: center;
	border-bottom: 4px solid var(--border);
	margin-bottom: 20px;
	/* Adding some top margin to push it down from the My Art Gallery header if they are too close */
	margin-top: 10px;
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	/* optional for responsive wrapping */
}

nav>.topnav>a {
	font-family: "Cinzel Decorative", "Cinzel", serif;
	color: var(--text-main);
	text-decoration: none;
	padding: 10px 20px;
	margin: 0 8px;
	border: 2px solid var(--accent-dark);
	/* Default border */
	border-radius: 25px;
	/* Pill-shape */
	background-color: var(--bg-panel);
	/* Lighter button face */
	transition:
		background-color 0.2s ease,
		color 0.2s ease,
		box-shadow 0.2s ease,
		border-color 0.2s ease,
		transform 0.1s ease;
	box-shadow:
		2px 2px 5px rgba(0, 0, 0, 0.2),
		/* Outer shadow for raised look */
		inset 1px 1px 2px rgba(255, 255, 255, 0.3);
	/* Inner highlight */
	display: inline-block;
	line-height: 1.4;
	font-weight: normal;
	/* Let Cinzel Decorative handle boldness if appropriate */
	position: relative;
	top: 0;
}

nav>.topnav>a:hover {
	background-color: var(--bg-secondary);
	border-color: var(--accent);
	color: var(--text-main);
	box-shadow:
		1px 1px 3px rgba(0, 0, 0, 0.15),
		/* Softer shadow on hover */
		inset 1px 1px 3px rgba(255, 255, 255, 0.4);
	top: 1px;
}

nav>.topnav>a.active {
	background-color: var(--accent-dark);
	color: var(--text-accent);
	border-color: var(--accent);
	box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.2);
	/* Pressed-in look */
	top: 1px;
	font-weight: bold;
}


/* ============== DISABLED STATE FOR BUTTONS ============== */


/* Date inputs */
.filter-group input[type="date"] {
	/* General styles already applied by .filter-group input */
	/* Specific tweaks if needed */
	padding: 8px 10px;
	/* Slightly less padding than text inputs if they look too bulky */
	background-color: var(--input-bg);
	/* Ensure consistent background */
}

/* Adjust icon position for search inputs in filter groups if needed */
.filter-group .search-container {
	position: relative;
}

.filter-group .search-container .fa-search {
	position: absolute;
	top: 50%;
	right: 12px;
	left: auto;
	transform: translateY(-50%);
	color: var(--input-border);
	pointer-events: none;
}

#sidebar-filters .filter-group .search-container input[type="text"] {
	padding-right: 35px;
}

/* Enhanced search container styling */
.filter-group .search-container {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.filter-group .search-container input[type="text"] {
	padding: 8px 36px 8px 10px; /* space for clear icon on right */
	border: 1px solid var(--input-border);
	background: var(--input-bg);
	color: var(--input-text);
	border-radius: 6px;
	min-width: 180px;
}

.filter-container-inline { display: inline-flex; align-items: center; gap: 10px; }

.search-icon { position: absolute; right: 40px; color: var(--input-border); pointer-events: none; }

.search-clear-btn {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	border: none;
	background: transparent;
	color: var(--input-border);
	padding: 6px;
	cursor: pointer;
	border-radius: 4px;
}

.search-clear-btn:focus,
.search-clear-btn:hover {
	background: rgba(0,0,0,0.05);
	outline: 2px solid var(--focus-ring-color);
}

@media (max-width: 640px) {
	.filter-group .search-container input[type="text"] { min-width: 120px; }
}


/* ============== LAYOUT WRAPPER STYLES ============== */
.layout-wrapper {
	display: grid;
	grid-template-columns: 280px 1fr;
	/* Sidebar and main content column */
	gap: 20px;
	/* Space between sidebar and main content column */
	align-items: start;
	/* Align items to the top */
}


#sidebar-filters {
	width: 100%;
	/* Override fixed width from JS, let grid control it */
	/* Existing styles for padding, border etc. will apply */
	align-self: start;
	/* Ensure sidebar also only takes its own content height */
}

#featured-art.collapsed .featured-content,
#featured-art.collapsed .featured-header .featured-left,
/* Hide dice button */
#featured-art.collapsed .featured-header .featured-center

/* Optionally hide title too, or just content */
	{
	display: none;
	/* Force hide content when collapsed */
}

#featured-art.collapsed {
	padding-top: 10px;
	padding-bottom: 10px;
}

#featured-art.collapsed .featured-header {
	margin-bottom: 0;
	padding-bottom: 0;
}

#featured-art.collapsed .featured-content::before {
	display: none;
}

#featured-art .featured-content {
	flex-grow: 0;
	flex-shrink: 0;
	display: contents;
	height: auto;
	max-height: 1000px;
	opacity: 1;
	margin: 25px 0 15px;
	padding: 20px;
	transition: all 0.3s ease-in-out;
	overflow: inherit;
	will-change: max-height, opacity, margin, padding;
	border: 2px solid var(--accent-dark);
	border-radius: 12px;
	background-color: var(--bg-panel);
	position: relative;
	box-shadow:
		/* Outermost edge */
		0 0 0 3px var(--accent-dark),
		/* Secondary edge for depth */
		0 0 0 1px var(--accent),
		/* Extra deep inner shadow at the top */
		inset 0 24px 24px -4px rgba(0, 0, 0, 0.6),
		/* Deep secondary top shadow */
		inset 0 16px 16px -4px rgba(0, 0, 0, 0.55),
		/* Sharp top edge shadow */
		inset 0 8px 8px -4px rgba(0, 0, 0, 0.5),
		/* Extra deep bottom shadow */
		inset 0 -20px 20px -4px rgba(0, 0, 0, 0.45),
		/* Deep secondary bottom */
		inset 0 -12px 12px -4px rgba(0, 0, 0, 0.4),
		/* Sharp bottom edge */
		inset 0 -6px 6px -4px rgba(0, 0, 0, 0.45),
		/* Extra deep left shadow */
		inset 20px 0 24px -4px rgba(0, 0, 0, 0.5),
		/* Deep secondary left */
		inset 12px 0 12px -4px rgba(0, 0, 0, 0.45),
		/* Sharp left edge */
		inset 6px 0 6px -4px rgba(0, 0, 0, 0.5),
		/* Extra deep right shadow */
		inset -20px 0 24px -4px rgba(0, 0, 0, 0.5),
		/* Deep secondary right */
		inset -12px 0 12px -4px rgba(0, 0, 0, 0.45),
		/* Sharp right edge */
		inset -6px 0 6px -4px rgba(0, 0, 0, 0.5);
	background-image: linear-gradient(to bottom,
				rgba(0, 0, 0, 0.35) 0%,
				rgba(0, 0, 0, 0.25) 20%,
				rgba(0, 0, 0, 0.15) 40%,
				rgba(0, 0, 0, 0.1) 60%,
				rgba(0, 0, 0, 0.05) 80%,
				rgba(255, 255, 255, 0.02) 100%);
}

#featured-art .featured-content-inner {
	display: contents;
}

#featured-art.collapsed .featured-content {
	max-height: 0;
	opacity: 0;
	margin: 0;
	padding: 0;
	border-width: 0;
}

#featured-art .featured-header .featured-left,
#featured-art .featured-header .featured-center {
	transition: opacity 0.3s ease-in-out;
	opacity: 1;
}

#featured-art.collapsed .featured-header .featured-left,
#featured-art.collapsed .featured-header .featured-center {
	opacity: 0;
}


/* Style for section headers like Featured Art and Main Gallery */
.featured-title,
/* Already in HTML for Featured Art */
h3#artworks-header {
	font-family: "Cinzel Decorative", "Cinzel", serif;
	color: var(--accent-dark);
	font-size: 1.8em;
	text-align: center;
	padding: 10px 0 20px 0;
	/* Increased bottom padding to make space for ornament */
	margin: 0 auto 25px auto;
	/* Adjusted margin */
	border: none;
	border-bottom: 3px solid var(--accent-dark);
	background: transparent;
	box-shadow: none;
	width: fit-content;
	position: relative;
	/* Needed for pseudo-element positioning */
	/* Remove panel styles from headers */
	border-radius: 0;
	background-clip: unset;
	letter-spacing: 0.05em;
	font-weight: bold;
}

/* Central ornament for section headers */
.featured-title::after,
h3#artworks-header::after {
	content: "";
	position: absolute;
	bottom: -10px;
	/* Position it to overlap the border slightly, adjust as needed */
	left: 50%;
	transform: translateX(-50%);
	width: 16px;
	/* Size of the ornament */
	height: 16px;
	/* Size of the ornament */
	background-color: var(--accent-dark);
	/* Color of the ornament */
	border: 2px solid var(--bg-panel);
	/* Border to make it pop from the line */
	/* border-radius: 50%; /* Circular ornament, can be changed */
	border-radius: 0;
	/* Square for diamond */
	transform: translateX(-50%) rotate(45deg);
	/* Rotate to form diamond */
	z-index: 1;
		z-index: 100;
	/* Ensure it's above the border-bottom */
}

/* Remove default panel styling from h3#artworks-header as it's now part of #gallery-content panel */
h3#artworks-header {
	border-width: 0;
	/* Will be handled by the rule above for its bottom border */
	border-bottom: 2px solid var(--border);
	/* Re-apply just the bottom decorative border */
	border-image: var(--ornament-border, var(--ornate-border-fallback)) 8 repeat;
	border-image-slice: 0 0 8 0;
	border-image-width: 0 0 8px 0;
	border-top: none;
	border-left: none;
	border-right: none;
	box-shadow: none;
	background-clip: unset;
	background-color: transparent;
}





/* ============== SIDEBAR STYLES (Enhancements) ============== */
#sidebar-filters {
	/* ... existing styles ... */
	background-color: var(--bg-secondary);
	/* Give sidebar a slightly different panel bg */
	position: relative;
	/* Ensure close button can be positioned absolutely within */
}

.filter-group {
	margin-bottom: 15px;
	padding: 15px;
	/* Increased padding */
	border: 1px solid var(--accent-dark);
	/* More prominent engraved line */
	border-radius: 6px;
	/* Slightly adjusted radius */
	background-color: var(--bg-panel);
	/* Inner panel look for each group */
	box-shadow:
		var(--shadow-inset),
		0 1px 3px rgba(0, 0, 0, 0.1);
	/* Added subtle outer shadow for more pop */
}

.filter-group .filter-label {
	font-family: "Cinzel Decorative", "Cinzel", serif;
	/* More ornate font */
	color: var(--accent-dark);
	font-size: 1.2em;
	/* Slightly larger */
	margin-bottom: 10px;
	/* Increased spacing */
	display: block;
	/* Make label take full width */
	text-align: center;
	padding-bottom: 5px;
	/* Space for border */
	border-bottom: 1px solid var(--accent);
	/* Engraved line below label */
	cursor: default;
	pointer-events: none;
	background: none;
	color: inherit;
	font-weight: bold;
	user-select: text;
}

.filter-group .filter-label:focus,
.filter-group .filter-label:hover {
	outline: none;
	background: none;
	color: inherit;
}

.filter-group input[type="text"]:not(.search-container input[type="text"]),
.filter-group input[type="date"],
.filter-group select,
.filter-group button {
	width: 100%;
	box-sizing: border-box;
	padding: 10px;
	box-sizing: border-box;
	border: 1px solid var(--border);
	border-radius: 4px;
	background-color: var(--input-bg);
	color: var(--input-text);
	font-family: "Georgia", serif;
	/* Consistent font */
	margin-bottom: 5px;
	/* Space below each input/button in a group */
}

.filter-group .search-container input[type="text"] {
	width: 100%;
	box-sizing: border-box;
	padding: 10px;
	border: 1px solid var(--border);
	border-radius: 4px;
	background-color: var(--input-bg);
	color: var(--input-text);
	font-family: "Georgia", serif;
	margin-bottom: 0;
	/* Remove double margin if search-container handles it */
}


/* Style the new Advanced Filters button in the sidebar to be full width like other filter items */
#advanced-filters-btn-main {
	width: 100%;
	display: block;
	text-align: left;
	/* Or center, depending on desired look matching target */
	margin-bottom: 10px;
	/* Space below it */
	/* It should inherit general button styling from the combined rule */
}


/* Ensure featured header itself doesn't have a conflicting background or border */
#featured-art .featured-header {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	gap: 0.5em;
}

#featured-art .featured-header>.featured-left {
	order: 1;
	justify-content: flex-start;
	flex: 0 0 auto;
}

#featured-art .featured-header>.featured-center {
	order: 2;
	flex: 1 1 auto;
	text-align: center;
	justify-content: center;
	min-width: 0;
}

#featured-art .featured-header>.featured-right {
	order: 3;
	justify-content: flex-end;
	flex: 0 0 auto;
}

#featured-art .featured-header button {
	min-width: 40px;
	max-width: 100%;
}

#featured-art .featured-ornate-box {
	border: 2px solid var(--accent-dark);
	border-radius: 12px;
	background-color: var(--bg-panel);
	position: relative;
	box-shadow:
		/* Outermost edge */
		0 0 0 3px var(--accent-dark),
		/* Secondary edge for depth */
		0 0 0 1px var(--accent),
		/* Extra deep inner shadow at the top */
		inset 0 24px 24px -4px rgba(0, 0, 0, 0.6),
		/* Deep secondary top shadow */
		inset 0 16px 16px -4px rgba(0, 0, 0, 0.55),
		/* Sharp top edge shadow */
		inset 0 8px 8px -4px rgba(0, 0, 0, 0.5),
		/* Extra deep bottom shadow */
		inset 0 -20px 20px -4px rgba(0, 0, 0, 0.45),
		/* Deep secondary bottom */
		inset 0 -12px 12px -4px rgba(0, 0, 0, 0.4),
		/* Sharp bottom edge */
		inset 0 -6px 6px -4px rgba(0, 0, 0, 0.45),
		/* Extra deep left shadow */
		inset 20px 0 24px -4px rgba(0, 0, 0, 0.5),
		/* Deep secondary left */
		inset 12px 0 12px -4px rgba(0, 0, 0, 0.45),
		/* Sharp left edge */
		inset 6px 0 6px -4px rgba(0, 0, 0, 0.5),
		/* Extra deep right shadow */
		inset -20px 0 24px -4px rgba(0, 0, 0, 0.5),
		/* Deep secondary right */
		inset -12px 0 12px -4px rgba(0, 0, 0, 0.45),
		/* Sharp right edge */
		inset -6px 0 6px -4px rgba(0, 0, 0, 0.5);
	background-image: linear-gradient(to bottom,
				rgba(0, 0, 0, 0.35) 0%,
				rgba(0, 0, 0, 0.25) 20%,
				rgba(0, 0, 0, 0.15) 40%,
				rgba(0, 0, 0, 0.1) 60%,
				rgba(0, 0, 0, 0.05) 80%,
				rgba(255, 255, 255, 0.02) 100%);
}
#featured-art .featured-ornate-box::before {
	content: "✧";
	position: absolute;
	top: -16px;
	left: 50%;
	transform: translateX(-50%);
	color: var(--accent-dark);
	font-size: 1.5em;
	font-weight: 450;
	z-index: 10;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bg-panel);
	border-radius: 4px;
	box-shadow:
		0 0 0 3px var(--accent-dark),
		0 0 0 1px var(--accent),
		0 3px 6px rgba(0, 0, 0, 0.4),
		inset 0 3px 3px rgba(0, 0, 0, 0.5),
		inset 0 6px 8px rgba(0, 0, 0, 0.45);
	border: 2px solid var(--accent);
	text-shadow:
		0 0 1px var(--accent-dark),
		0 0 2px var(--accent-dark);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
	pointer-events: none;
}
#featured-art .featured-content {
	flex-grow: 0;
	flex-shrink: 0;
	display: contents;
	height: auto;
	max-height: 1000px;
	opacity: 1;
	margin: 25px 0 15px;
	padding: 20px;
	transition: all 0.3s ease-in-out;
	overflow: inherit;
	will-change: max-height, opacity, margin, padding;
}



/* ========= Loading Placeholder ========= */
.loading-placeholder {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	background-color: #222;
	/* A subtle background for the placeholder */
	color: #fff;
	/* Color for the spinner icon */
	transition: opacity 0.4s ease-in-out;
}

/* -------------------- */
/* --- Fullscreen Viewer --- */
/* -------------------- */
/* ... existing code ... */

/* ========= Gallery Header and Status ========= */
#gallery-status {
	width: 100%;
	text-align: center;
	margin-bottom: 15px;
}

/* Fallback for fadeIn animation if not defined elsewhere */
@keyframes fadeIn {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

/* At the end of the file (or in a suitable shared CSS location), add the spin animation keyframes: */
@keyframes spin {
	from {
		transform: rotate(0deg);
	}

	to {
		transform: rotate(360deg);
	}
}

/* Special styling for featured art grid */
#featured-grid.art-grid {
	gap: 15px;
	padding: 10px;
	background: rgba(255, 255, 255, 0);
	border-radius: 8px;
}

#featured-grid.art-grid img {
	border-width: 4px;
	transform: scale(1);
	transition:
		transform 0.3s ease,
		box-shadow 0.3s ease;
}

#featured-grid.art-grid img:hover {
	transform: scale(1.08);
	box-shadow: 0 8px 24px rgba(169, 123, 44, 0.3);
	border-color: var(--accent-dark);
}


/* Loading States */
.loading {
	position: relative;
	min-height: 200px;
	background: linear-gradient(90deg,
			var(--loading-bg-start) 25%,
			var(--loading-bg-mid) 50%,
			var(--loading-bg-end) 75%);
	background-size: 200% 100%;
	animation: loading 1.5s infinite;
	border-radius: 8px;
}

.art-card {
	position: relative;
	transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
	box-shadow: none;
	background: none !important;
	background-color: transparent !important;
	position: relative;
	overflow: visible;
}

.art-card::before {
	content: "";
	position: absolute;
	top: -4px; left: -4px; right: -4px; bottom: -4px;
	border: none;
	border-radius: inherit;
	background: none !important;
	pointer-events: none;
	z-index: 10;
	transition: border-color 0.25s;
}

.art-card:hover::before,
.art-card:focus-visible::before {
	border-color: var(--art-item-hover-border, var(--accent-dark));
}

.art-card:hover,
.art-card:focus-visible {
	transform: scale(1.035);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
	border-color: var(--art-item-hover-border);
	z-index: 2;
}

/* Responsive icon size for loading/error */
.art-card .loading-placeholder i,
.art-card .loading-placeholder.error i {
	font-size: 2.2em;
	transition: font-size 0.2s;
}

.grid-square .art-card .loading-placeholder i,
.grid-square .art-card .loading-placeholder.error i {
	font-size: 2.8em;
}

.grid-default .art-card .loading-placeholder i,
.grid-default .art-card .loading-placeholder.error i {
	font-size: 2.2em;
}


.grid-square .art-card,
.grid-default .art-card {
	position: relative;
	z-index: 1;
	z-index: 100;
	background: transparent !important;
}

.grid-square .art-card:hover,
.grid-square .art-card:focus,
.grid-default .art-card:hover,
.grid-default .art-card:focus {
	z-index: 10;
}

.art-card.loading img {
	opacity: 0;
}

.art-card.error {
	background-color: #fff0f0;
	border: 1px solid #ffcccc;
}

.art-card.error img {
	opacity: 0.5;
}

/* Image loading placeholder */
.art-card img {
	transition: opacity 0.3s ease-in-out;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Loading animation for the entire grid */
.art-grid.loading {
	opacity: 1;
	pointer-events: auto;
}

.loading-placeholder {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg,
			var(--loading-bg-start) 25%,
			var(--loading-bg-mid) 50%,
			var(--loading-bg-end) 75%);
	background-size: 200% 100%;
	animation: loading 1.5s infinite;
	border-radius: 8px;
	z-index: 1;
		z-index: 100;
}

#pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin-top: 2rem;
}


.page-numbers-container {
	display: flex;
	align-items: center;
	gap: 5px;
}

.page-numbers-container .page-number {
	padding: 6px 12px;
	min-width: 38px;
	text-align: center;
}

.page-numbers-container .page-number.active {
	background-color: var(--accent-color);
	color: var(--bg-color);
	border-color: var(--accent-color);
	font-weight: bold;
}

.page-numbers-container .ellipsis {
	padding: 6px;
	color: var(--text-color-secondary);
}

#gallery-status {
	text-align: center;
	margin: 1rem 0;
}

/* ========= Art Grid ========= */
.art-grid {
	display: grid;
	margin: 0 auto;
	animation: fadeIn 0.5s ease;
}

/* Default grid sizes (will be overridden by artwork size classes) */
.grid-default {
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 14px;
}

.grid-square {
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 14px;
}


.favorite-btn {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	background: rgba(30, 30, 30, 0.7);
	border: none;
	border-radius: 50%;
	padding: 6px;
	cursor: pointer;
	color: #e73c83;
	font-size: 1.2em;
	transition: background 0.2s;
	/* Ensure consistent sizing */
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.favorite-btn.favorited {
	color: var(--favorite-color);
	/* Hot pink for favorited */
}

.favorite-btn:hover {
	color: var(--favorite-color-hover);
	/* Lighter pink on hover */
}

.favorite-btn:focus {
	outline: none;
	border: none;
	box-shadow: none;
}

.favorite-btn:focus-visible {
	outline: 2px solid var(--favorite-color-hover);
	outline-offset: 2px;
	border-radius: 50%;
	/* Ensure focus outline is also circular */
}

/* Show focus ring only for keyboard users */

.favorite-btn.heart-beat-animation {
	animation: heart-beat 0.3s ease-in-out;
}

@keyframes heart-beat {
	0% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.3);
	}

	100% {
		transform: scale(1);
	}
}

/* ============== THEME TOGGLE BUTTON ============== */

#theme-toggle .fa-moon {
	display: none;
	/* Hidden by default */
}

body.dark-theme #theme-toggle .fa-sun {
	display: none;
	/* Hide sun icon in dark mode */
}

body.dark-theme #theme-toggle .fa-moon {
	display: inline-block;
	/* Show moon icon in dark mode */
}

.fullscreen-thumbnails {
	display: flex;
	gap: 10px;
	justify-content: center;
	margin-top: 4px;
	/* Reduced from 14px */
	margin-bottom: 24px;
	/* Add space below thumbnails row */
	position: relative;
	z-index: 1001;
	padding-top: 6px;
	padding-bottom: 20px;
}

.fullscreen-thumb {
	width: 80px;
	/* was 60px */
	height: 54px;
	/* was 40px */
	object-fit: cover;
	border: 2px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	transition:
		border 0.2s,
		box-shadow 0.2s;
	background: #222;
}

.fullscreen-thumb.selected {
	border: 2px solid gold;
	box-shadow: 0 0 8px gold;
}


#fullscreen-details {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	z-index: 1002;
	background: rgba(0, 0, 0, 0.92);
	padding: 24px 32px;
	border-radius: 12px;
	max-width: 90vw;
	max-height: 80vh;
	overflow-y: auto;
	box-shadow: 0 4px 32px #000a;
}


/* ========== UNIFIED MODAL PAGINATION BUTTONS (ALL CONTEXTS) ========== */
.modal-pagination,
#advanced-categories-pagination,
#advanced-subcategories-pagination,
#advanced-tags-pagination,
#fullscreen-viewer #tags-modal .modal-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 10px 0;
	gap: 4px;
	width: 100%;
}

.modal-pagination button,
#advanced-categories-pagination button,
#advanced-subcategories-pagination button,
#advanced-tags-pagination button,
#fullscreen-viewer #tags-modal .modal-pagination .page-number {
	background: var(--pagination-bg, #f6e7b2);
	color: var(--pagination-text, #8b7355);
	border: 2px solid var(--pagination-border, #bfa76a);
	padding: 8px 14px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 1em;
	margin: 0 2px;
	transition:
		background 0.2s,
		color 0.2s,
		border 0.2s;
}

/* Unified current/active page button style */
.modal-pagination button.current,
.modal-pagination .page-number.current,
#advanced-categories-pagination button.current,
#advanced-subcategories-pagination button.current,
#advanced-tags-pagination button.current,
#fullscreen-viewer #tags-modal .modal-pagination .page-number.current {
	background: var(--focus-ring-color, #ffd700);
	color: var(--pagination-current-text, #000000);
	font-weight: bold;
	border: 3px solid var(--pagination-current-border, #ffd700);
	outline: 2px solid var(--pagination-current-border, #ffd700);
	box-shadow: var(--pagination-current-shadow, 0 0 8px 2px #ffd700);
	z-index: 2;
	font-size: 1.05em;
	transition:
		background 0.2s,
		border 0.2s,
		box-shadow 0.2s,
		outline 0.2s;
}

/* Focus state for current page button */
.modal-pagination button.current:focus,
.modal-pagination .page-number.current:focus,
#advanced-categories-pagination button.current:focus,
#advanced-subcategories-pagination button.current:focus,
#advanced-tags-pagination button.current:focus,
#fullscreen-viewer #tags-modal .modal-pagination .page-number.current:focus {
	outline: 3px solid #ff00ff;
	/* Magenta outline for focus */
	outline-offset: 2px;
}

/* Disabled state */
.modal-pagination button:disabled,
#advanced-categories-pagination button:disabled,
#advanced-subcategories-pagination button:disabled,
#advanced-tags-pagination button:disabled,
#fullscreen-viewer #tags-modal .modal-pagination .page-number:disabled {
	background: #ccc;
	color: #777;
	cursor: not-allowed;
	opacity: 0.6;
}

/* Dark theme overrides */
body.dark-theme .modal-pagination button,
body.dark-theme #advanced-categories-pagination button,
body.dark-theme #advanced-subcategories-pagination button,
body.dark-theme #advanced-tags-pagination button,
body.dark-theme #fullscreen-viewer #tags-modal .modal-pagination .page-number {
	background: var(--pagination-bg, #181818);
	color: var(--pagination-text, #fff);
	border: 2px solid var(--pagination-border, #ffd700);
}

body.dark-theme .modal-pagination button.current,
body.dark-theme .modal-pagination .page-number.current,
body.dark-theme #advanced-categories-pagination button.current,
body.dark-theme #advanced-subcategories-pagination button.current,
body.dark-theme #advanced-tags-pagination button.current,
body.dark-theme #fullscreen-viewer #tags-modal .modal-pagination .page-number.current {
	background: var(--pagination-current-bg, #ffd700);
	color: var(--pagination-current-text, #222);
	border: 3px solid var(--pagination-current-border, #ffd700);
	outline: 2px solid var(--pagination-current-border, #ffd700);
	box-shadow: var(--pagination-current-shadow, 0 0 8px 2px #ffd700);
}

/* Prevent scrolling in fullscreen mode */

.fullscreen {
	overflow: hidden;
}

body.fullscreen-active,
html.fullscreen-active {
	overflow: hidden;
	height: 100%;
}


.grid-default .art-card {
	aspect-ratio: auto;
	height: auto;
	min-height: 0;
	min-width: 0;
	overflow: visible;
	display: flex;
	flex-direction: column;
	justify-content: stretch;
}

.grid-default .art-card img {
	width: 100%;
	height: auto;
	aspect-ratio: auto;
	object-fit: contain;
	border-radius: 8px;
	display: block;
}

/* ============== FULLSCREEN ACCESSIBILITY IMPROVEMENTS ============== */

/* Ensure fullscreen viewer can receive focus */
#fullscreen-viewer {
	/* ... existing styles ... */
	outline: none;
	/* Remove default outline since we'll add custom focus styles */
}

/* Custom focus indicators for fullscreen elements */
#fullscreen-viewer:focus-visible {
	outline: 3px solid var(--focus-ring-color, #ffcc00);
	outline-offset: 2px;
}

/* Focus styles for fullscreen buttons */
#fullscreen-viewer button:focus-visible {
	outline: 3px solid var(--focus-ring-color, #ffcc00);
	outline-offset: 2px;
	box-shadow: 0 0 0 3px var(--focus-ring-shadow, rgba(255, 204, 0, 0.3));
}

/* Focus styles for fullscreen thumbnails */
.fullscreen-thumb:focus-visible {
	outline: 3px solid var(--focus-ring-color, #ffcc00);
	outline-offset: 2px;
	box-shadow: 0 0 0 3px var(--focus-ring-shadow, rgba(255, 204, 0, 0.3));
}

/* Focus styles for fullscreen image */
#fullscreen-img:focus-visible {
	outline: 3px solid var(--focus-ring-color, #ffcc00);
	outline-offset: 2px;
	box-shadow: 0 0 0 3px var(--focus-ring-shadow, rgba(255, 204, 0, 0.3));
}

/* Ensure fullscreen menu buttons are properly focusable */
#fullscreen-menu-bar button {
	/* ... existing styles ... */
	outline: none;
	/* Remove default outline */
}

#fullscreen-menu-bar button:focus-visible {
	outline: 3px solid var(--focus-ring-color, #ffcc00);
	outline-offset: 2px;
	box-shadow: 0 0 0 3px var(--focus-ring-shadow, rgba(255, 204, 0, 0.3));
}

/* High contrast focus indicators for better accessibility */





.global-loading-spinner {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(20, 20, 30, 0.65);
	z-index: 3000;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: all;
	transition: opacity 0.3s;
}

.global-loading-spinner .spinner {
	width: 64px;
	height: 64px;
	border: 8px solid #e7c873;
	border-top: 8px solid #b4942d;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	background: none;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ========== Improved Square Grid Layout (Targeted) ========== */
/* Grid definitions are now handled by artwork size classes */


/* Only in Square Layout */
.grid-square .art-card,
#featured-grid.grid-square .art-card {
	position: relative;
	width: 100%;
	aspect-ratio: 1/1;
	min-width: 0;
	min-height: 0;
	border-radius: 12px;
	overflow: hidden;
	display: block;
	background: none !important;
	background-color: transparent !important;
	border: none;
	box-shadow: none;
	max-width: 100%;
}

.grid-square .art-card img,
#featured-grid.grid-square .art-card img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 1;
	border-radius: 10px;
	border: none;
	background: none;
	display: block;
}

.grid-square .art-card .art-title,
#featured-grid.grid-square .art-card .art-title {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.7) 80%, rgba(0, 0, 0, 0) 100%);
	color: #fff;
	font-size: 0.85em;
	padding: 1.2em 0.5em 0.45em 0.5em;
	margin: 0;
	display: block;
	width: 100%;
	box-sizing: border-box;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	z-index: 2;
	text-align: center;
	border-bottom-left-radius: 12px;
	border-bottom-right-radius: 12px;
	box-sizing: border-box;
	pointer-events: none;
	user-select: none;
	text-shadow: 0 2px 8px #000, 0 1px 2px #000;
	letter-spacing: 0.01em;
	line-height: 1.2;
	min-height: 2.2em;
	max-height: 3.2em;
	overflow: hidden;
	white-space: normal;
}


.grid-square,
.grid-default {
	display: grid;
}

#featured-grid.art-grid,
#featured-grid.grid-square {
	display: grid;
}

#featured-grid {
	width: 100%;
	min-width: 0;
	max-width: 100%;
}

#featured-grid.grid-square {
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 14px;
}

@media screen and (max-width: 480px) {
    #featured-grid.grid-square {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .grid-square .art-card .art-title,
    #featured-grid.grid-square .art-card .art-title {
        font-size: 0.75em;
        padding: 1em 0.4em 0.4em 0.4em;
    }
}

#featured-art .featured-content {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.grid-square .art-card {
	position: relative;
	z-index: 1;
		z-index: 100;
}

.grid-square .art-card:hover,
.grid-square .art-card:focus {
	z-index: 10;
}


.grid-square .art-card {
	position: relative;
	z-index: 1;
	border-radius: 12px;
	overflow: visible;
}

.grid-square .art-card::before {
	content: "";
	position: absolute;
	inset: -3px;
	border-radius: 14px;
	z-index: 1;
	pointer-events: none;
	padding: 0;
	background: linear-gradient(135deg, var(--art-gradient-border-start, #ffe082), var(--art-gradient-border-end, #bfa76a));
	/* fallback gold gradient */
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
	transition: background 0.3s;
	border: 3px solid var(--art-gradient-border-end, #bfa76a);
	transition: box-shadow 0.2s, filter 0.2s, border-color 0.2s;
}

body.dark-theme .grid-square .art-card::before {
	background: linear-gradient(135deg, var(--art-gradient-border-dark-start, #3a3a6a), var(--art-gradient-border-dark-end, #bfa76a));
}

.grid-square .art-card img {
	position: relative;
	z-index: 2;
	border-radius: 10px;
	border: none;
	background: none;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.grid-square .art-card.loading-skeleton::before {
	display: none;
}

.featured-loading-skeleton {
	background: linear-gradient(135deg, #23243a 60%, #2d2e4a 100%);
	border-radius: 12px;
	min-height: 120px;
	min-width: 120px;
	margin: 0.5em;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
	animation: loading 1.5s infinite;
}

.grid-square .art-card {
	position: relative;
	/* ...other styles... */
}

.grid-square .art-card::before {
	z-index: 1;
}

.grid-square .art-card img {
	z-index: 2;
}

.grid-square .art-card .favorite-btn {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 3;
	background: rgba(30, 30, 30, 0.55);
	border-radius: 50%;
	padding: 0.3em;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* =====================
   MAIN GALLERY GLOW EFFECT (square layout)
   Applies to: .grid-square .art-card (main gallery only)
   ===================== */
.grid-square .art-card:hover::before,
.grid-square .art-card:focus-visible::before {
	border-color: #ffe082;
	box-shadow:
		0 0 0 2.5px #ffe082,
		0 0 7px 2px #ffe08244,
		0 2px 8px 0 #ffe08222;
	filter: brightness(1.06) saturate(1.08);
	opacity: 1;
	transition: box-shadow 0.2s, filter 0.2s, border-color 0.2s;
}

/* =====================
   FEATURED GALLERY GLOW EFFECT (square layout)
   Applies to: #featured-grid.grid-square .art-card (featured section only)
   ===================== */
#featured-grid.grid-square .art-card:hover::before,
#featured-grid.grid-square .art-card:focus-visible::before {
	border-color: #ffe082;
	box-shadow:
		0 0 0 3px #ffe082,
		0 0 18px 6px #ffe08277,
		0 8px 24px 0 #ffe08244;
	filter: brightness(1.13) saturate(1.18);
	opacity: 1;
	transition: box-shadow 0.2s, filter 0.2s, border-color 0.2s;
}



#featured-grid.art-grid,
#featured-grid.grid-square,
.art-grid,
.grid-square {
	display: grid;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0 auto;
	padding: 10px 0;
	box-sizing: border-box;
}


.grid-square .art-card,
#featured-grid.grid-square .art-card,
.art-grid .art-card {
	position: relative;
	width: 100%;
	aspect-ratio: 1/1;
	min-width: 0;
	min-height: 0;
	border-radius: 12px;
	overflow: visible;
	display: block;
}


.grid-square .art-card img,
#featured-grid.grid-square .art-card img,
.art-grid .art-card img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 2;
	border-radius: 10px;
	border: none;
	background: none;
	display: block;
}


.grid-square .art-card .art-title,
#featured-grid.grid-square .art-card .art-title,
.art-grid .art-card .art-title {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 80%, rgba(0, 0, 0, 0.1) 100%);
	color: #fff;
	font-size: 1em;
	padding: 0.5em 0.7em 0.45em 0.7em;
	margin: 0;
	z-index: 2;
	text-align: center;
	border-bottom-left-radius: 12px;
	border-bottom-right-radius: 12px;
	box-sizing: border-box;
	pointer-events: none;
	user-select: none;
	text-shadow: 0 2px 8px #000, 0 1px 2px #000;
	letter-spacing: 0.01em;
	line-height: 1.2;
	min-height: 2.2em;
	max-height: 3.2em;
	overflow: hidden;
	white-space: normal;
}










/* --- SQUARE LAYOUT ART CARD --- */
.grid-square .art-card {
	position: relative;
	z-index: 1;
	border-radius: 12px;
	overflow: visible;
	width: 100%;
	aspect-ratio: 1/1;
	min-width: 0;
	min-height: 0;
	display: block;
}

.grid-square .art-card:hover,
.grid-square .art-card:focus {
	z-index: 10;
}

.grid-square .art-card::before {
	content: "";
	position: absolute;
	inset: -3px;
	border-radius: 14px;
	z-index: 1;
	pointer-events: none;
	padding: 0;
	background: linear-gradient(135deg, var(--art-gradient-border-start, #ffe082), var(--art-gradient-border-end, #bfa76a));
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
	border: 3px solid var(--art-gradient-border-end, #bfa76a);
	transition: box-shadow 0.2s, filter 0.2s, border-color 0.2s;
}

.grid-square .art-card img {
	position: relative;
	z-index: 2;
	border-radius: 10px;
	border: none;
	background: none;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}


/* =====================
   SHARED ART CARD BASE
   ===================== */
.art-card {
	position: relative;
	z-index: 1;
	width: 100%;
	min-width: 0;
	min-height: 0;
	display: block;
	transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
	background: var(--art-item-bg);
	overflow: visible;
	flex-direction: column;
}

.art-card:hover,
.art-card:focus-visible {
	transform: scale(1.035);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
	border-color: var(--art-item-hover-border);
	z-index: 2;
}

.art-card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	cursor: pointer;
	transition: transform 0.2s, box-shadow 0.3s, filter 0.3s, opacity 0.3s;
	border: 4px solid var(--accent);
	padding: 5px;
	background-color: var(--bg-panel);
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	display: block;
}

.art-card.loading img {
	opacity: 0;
}

.art-card.error {
	background-color: #fff0f0;
	border: 1px solid #ffcccc;
}

.art-card.error img {
	opacity: 0.5;
}

.art-title {
	padding: 5px;
	text-align: center;
	color: var(--text-main);
	font-size: 14px;
	margin-top: 5px;
}

.art-card .favorite-btn {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 3;
	background: rgba(30, 30, 30, 0.55);
	border-radius: 50%;
	padding: 0.3em;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #e73c83;
	font-size: 1.2em;
	transition: background 0.2s;
}

/* Alternate images indicator - accent gradient, animation, tooltip */
.art-card .alt-images-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 48%;
  height: 48%;
  z-index: 3;
  background: linear-gradient(135deg, #bfa76a 0%, transparent 80%), rgba(30, 30, 30, 0.7);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  border-top-left-radius: 12px;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  pointer-events: auto;
  transition: transform 0.18s, background 0.2s, opacity 0.2s;
  opacity: 0.8;
}

.art-card:hover .alt-images-indicator {
  background: linear-gradient(135deg, #bfa76a 0%, transparent 80%), rgba(30, 30, 30, 0.7);
  transform: scale(1.08);
  opacity: 1;
}

.art-card .alt-images-indicator span {
  position: absolute;
  top: 7px;
  left: 10px;
  color: #fff;
  font-size: 1.3em;
  font-weight: bold;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  user-select: none;
  pointer-events: none;
}

body.dark-theme .art-card .alt-images-indicator {
  background: linear-gradient(135deg, #bfa76a 0%, transparent 80%), rgba(0,0,0,0.45);
}
body.dark-theme .art-card:hover .alt-images-indicator {
  background: linear-gradient(135deg, #bfa76a 0%, transparent 80%), rgba(0,0,0,0.7);
}

/* Tooltip for alt-images-indicator */
.alt-images-indicator-tooltip {
  position: absolute;
  top: -44px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  background: #23232a;
  color: #fff;
  border: 1.5px solid #bfa76a;
  border-radius: 7px;
  padding: 6px 14px;
  font-size: 0.98em;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s 0.18s;
  visibility: hidden;
  min-width: max-content;
  max-width: 200px;
  font-weight: normal;
  text-transform: none;
  letter-spacing: normal;
}

/* Responsive tooltip positioning to prevent cropping */
@media (max-width: 768px) {
  .alt-images-indicator-tooltip {
    left: 25%;
    transform: translateX(-25%);
    max-width: 150px;
    font-size: 0.9em;
    padding: 4px 10px;
  }
  
  /* If tooltip would be cropped on the left, move it right */
  .art-card .alt-images-indicator:hover .alt-images-indicator-tooltip {
    left: 75%;
    transform: translateX(-75%);
  }
}

@media (max-width: 480px) {
  .alt-images-indicator-tooltip {
    left: 10%;
    transform: translateX(-10%);
    max-width: 120px;
    font-size: 0.85em;
    padding: 3px 8px;
  }
  
  /* If tooltip would be cropped on the left, move it right */
  .art-card .alt-images-indicator:hover .alt-images-indicator-tooltip {
    left: 90%;
    transform: translateX(-90%);
  }
}

/* Ensure tooltip doesn't get cropped on very small screens */
@media (max-width: 320px) {
  .alt-images-indicator-tooltip {
    left: 5%;
    transform: translateX(-5%);
    max-width: 100px;
    font-size: 0.8em;
    padding: 2px 6px;
  }
  
  /* If tooltip would be cropped on the left, move it right */
  .art-card .alt-images-indicator:hover .alt-images-indicator-tooltip {
    left: 95%;
    transform: translateX(-95%);
  }
}

/* Responsive alt-images-indicator sizing and positioning */
@media (max-width: 768px) {
  .art-card .alt-images-indicator {
    width: 42%;
    height: 42%;
    border-top-left-radius: 10px;
  }
  
  .art-card .alt-images-indicator span {
    top: 5px;
    left: 8px;
    font-size: 1.1em;
  }
}

@media (max-width: 480px) {
  .art-card .alt-images-indicator {
    width: 38%;
    height: 38%;
    border-top-left-radius: 8px;
  }
  
  .art-card .alt-images-indicator span {
    top: 4px;
    left: 6px;
    font-size: 1em;
  }
}

@media (max-width: 320px) {
  .art-card .alt-images-indicator {
    width: 35%;
    height: 35%;
    border-top-left-radius: 6px;
  }
  
  .art-card .alt-images-indicator span {
    top: 3px;
    left: 5px;
    font-size: 0.9em;
  }
}

.art-card:hover .alt-images-indicator-tooltip,
.art-card:focus-within .alt-images-indicator-tooltip {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.12s;
  visibility: visible;
  display: block;
}

.alt-images-indicator-tooltip::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px 7px 0 7px;
  border-style: solid;
  border-color: #23232a transparent transparent transparent;
  filter: drop-shadow(0 1px 2px #bfa76a);
  z-index: -1;
}

.art-card .alt-images-indicator:hover .alt-images-indicator-tooltip,
.art-card .alt-images-indicator:focus-within .alt-images-indicator-tooltip,
.art-card:hover .alt-images-indicator .alt-images-indicator-tooltip {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.12s;
  visibility: visible;
  display: block;
}

/* =====================
   SQUARE LAYOUT (grid-square, art-grid, #featured-grid.grid-square)
   ===================== */
.grid-square .art-card,
.art-grid .art-card,
#featured-grid.grid-square .art-card {
	border-radius: 12px;
	aspect-ratio: 1/1;
	overflow: visible;
}

.grid-square .art-card::before,
.art-grid .art-card::before,
#featured-grid.grid-square .art-card::before {
	content: "";
	position: absolute;
	inset: -3px;
	border-radius: 14px;
	z-index: 10;
	pointer-events: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
	border: 3px solid var(--art-gradient-border-end, #bfa76a);
	transition: box-shadow 0.2s, filter 0.2s, border-color 0.2s;
}


.grid-square .art-card img,
.art-grid .art-card img,
#featured-grid.grid-square .art-card img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 2;
	border-radius: 10px;
	border: none;
	background: none;
	display: block;
	padding: 0;
	box-shadow: none;
}

.grid-square .art-card .art-title,
.art-grid .art-card .art-title,
#featured-grid.grid-square .art-card .art-title {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 80%, rgba(0, 0, 0, 0.1) 100%);
	color: #fff;
	font-size: 1em;
	padding: 0.5em 0.7em 0.45em 0.7em;
	margin: 0;
	z-index: 2;
	text-align: center;
	border-bottom-left-radius: 12px;
	border-bottom-right-radius: 12px;
	box-sizing: border-box;
	pointer-events: none;
	user-select: none;
	text-shadow: 0 2px 8px #000, 0 1px 2px #000;
	letter-spacing: 0.01em;
	line-height: 1.2;
	min-height: 2.2em;
	max-height: 3.2em;
	overflow: visible;
	white-space: normal;
}


/* =====================
   MOBILE RESPONSIVE STYLES (max-width: 600px)
   ===================== */
@media (max-width: 600px) {

	/* Loading placeholder icons */
	.art-card .loading-placeholder i,
	.art-card .loading-placeholder.error i {
		font-size: 1.5em;
	}

	/* Grid layouts - base mobile sizing */
	.grid-default,
	.grid-square {
		gap: 8px;
	}


	/* Featured grid - base mobile sizing */
	#featured-grid.art-grid,
	#featured-grid.grid-square {
		gap: 8px;
	}

	/* Art cards */
	.art-card,
	.grid-square .art-card,
	#featured-grid.grid-square .art-card {
		border-radius: 8px;
		min-height: 100px;
	}

	/* Art card images */
	.art-card img,
	.grid-square .art-card img,
	#featured-grid.grid-square .art-card img {
		border-radius: 8px;
	}

	/* Art card titles */
	.grid-square .art-card .art-title,
	#featured-grid.grid-square .art-card .art-title {
		border-bottom-left-radius: 8px;
		border-bottom-right-radius: 8px;
		font-size: 0.95em;
		padding: 0.35em 0.5em 0.3em 0.5em;
	}


	/* Artwork size classes - maintain square layout styling */
	/* Note: Specific section rules below override these general rules */




}

/* =====================
   SHARED PANEL/CONTAINER BASE
   ===================== */
.panel {
	background-color: var(--bg-panel);
	border: 2px solid var(--border);
	border-radius: 12px;
	padding: 20px;
	margin-bottom: 20px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	position: relative;
}

/* Refactored panel selectors */
#sidebar-filters {
	/* Inherit .panel, override as needed */
	background-color: var(--sidebar-bg);
	background-image: radial-gradient(circle at 1px 1px, var(--sidebar-border) 1px, transparent 0);
	background-size: 10px 10px;
	margin-bottom: 0;
	align-self: start;
	color: var(--sidebar-text);
}

#featured-art {
	/* Inherit .panel, override as needed */
	margin-bottom: 3rem;
	padding: 2rem;
	background: var(--featured-bg);
	border-radius: 12px;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
	border: 3px solid var(--featured-border);
	overflow: hidden;
}

#gallery-content {
	/* Inherit .panel, override as needed */
	border: 2px solid var(--gallery-border);
	box-shadow: 0 2px 24px #0006, 0 0 0 6px var(--gallery-border) inset;
	background-color: var(--gallery-bg);
	padding: 15px;
}

footer {
	/* Inherit .panel, override as needed */
	border-radius: 28px;
	border-width: 8px;
	border-image: var(--ornament-border, var(--ornate-border-fallback)) 32 repeat;
	box-shadow: 0 2px 24px #0006, 0 0 0 6px var(--border) inset;
	background-color: var(--footer-bg);
	color: var(--footer-text);
	padding: 20px;
	text-align: center;
	margin-top: 20px;
}

/* =====================
   SHARED BUTTON SYSTEM
   ===================== */

/* Base button styles */
.btn {
	font-family: "Cinzel Decorative", "Cinzel", serif;
	color: var(--button-text);
	text-decoration: none;
	padding: 8px 15px;
	margin: 0 2px;
	border: 2px solid var(--border);
	border-radius: 8px;
	background-color: var(--button-bg);
	transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
	box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2), inset 1px 1px 3px rgba(255, 255, 255, 0.3);
	cursor: pointer;
	text-align: center;
	display: inline-block;
}

.btn:hover {
	background-color: var(--accent-dark);
	color: var(--text-accent);
	border-color: var(--accent);
	box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3) inset, 2px 2px 5px rgba(0, 0, 0, 0.2);
}

.btn:disabled,
.btn.button-disabled {
	background-color: var(--border);
	color: var(--text-main);
	border-color: var(--text-main);
	box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4) inset;
	cursor: not-allowed;
	opacity: 0.6;
}

/* Featured section buttons */
.btn-featured {
	background-color: var(--featured-button-bg);
	color: var(--featured-button-text);
	border: 2px solid var(--featured-button-border);
	border-radius: 6px;
	padding: 8px 12px;
	transition: background-color 0.3s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-featured:hover {
	background-color: var(--featured-button-hover-bg);
	color: var(--featured-button-text);
	border-color: var(--featured-button-border);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
	transform: scale(1.05);
}

/* Rerandom button */
.btn-rerandom {
	background-color: var(--rerandom-button-bg);
	color: var(--rerandom-button-text);
	border: 2px solid var(--rerandom-button-border);
	border-radius: 6px;
	padding: 8px 12px;
	transition: background-color 0.3s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-rerandom:hover {
	background-color: var(--rerandom-button-hover-bg);
	color: var(--rerandom-button-text);
	border-color: var(--rerandom-button-border);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
	transform: scale(1.05);
}

/* Filter group buttons */

/* Pagination buttons */
.btn-pagination {
	background-color: var(--button-bg);
	color: var(--button-text);
	border: 1px solid var(--button-border);
	padding: 8px 16px;
	cursor: pointer;
	transition: all 0.2s ease-in-out;
	border-radius: 4px;
}

.btn-pagination:hover:not(:disabled) {
	background-color: var(--button-hover-bg);
	color: var(--button-hover-text);
	border-color: var(--button-hover-border);
}

.btn-pagination:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Modal pagination buttons */

/* Fullscreen menu buttons */
.btn-fullscreen-menu {
	background: none;
	border: none;
	color: var(--text-header);
	font-size: 1.5em;
	padding: 5px 15px;
	cursor: pointer;
	transition: color 0.2s ease;
	outline: none;
}

.btn-fullscreen-menu:hover {
	color: var(--accent, #bfa76a);
}

.btn-fullscreen-menu.button-disabled {
	color: rgb(179, 170, 170);
	cursor: default;
}




.btn-close-minimal:hover {
	color: #000000;
	background-color: var(--border);
	transform: scale(1.1);
}

.btn-close-minimal:focus-visible {
	outline: 3px solid var(--focus-ring-color, #ffcc00);
	outline-offset: 2px;
	box-shadow: 0 0 0 3px var(--focus-ring-shadow, rgba(255, 204, 0, 0.3));
}

/* Theme toggle button */
.btn-theme-toggle {
	font-family: "Cinzel Decorative", "Cinzel", serif;
	color: var(--text-main);
	text-decoration: none;
	padding: 10px;
	margin: 0 8px;
	border: 2px solid var(--accent-dark);
	border-radius: 50%;
	width: 44px;
	height: 44px;
	background-color: var(--bg-panel);
	transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
	box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2), inset 1px 1px 2px rgba(255, 255, 255, 0.3);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1.4;
	font-weight: normal;
	position: relative;
	top: 0;
	cursor: pointer;
}

.btn-theme-toggle:hover {
	background-color: var(--bg-secondary);
	border-color: var(--accent);
	color: var(--text-main);
	box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.15), inset 1px 1px 3px rgba(255, 255, 255, 0.4);
	top: 1px;
}

/* Dark theme overrides */

/* =====================
   CLOSE BUTTON STYLES (MODALS, SIDEBAR, FULLSCREEN)
   ===================== */

/*
.modal-close-btn
- Used for modal dialogs (e.g., tags modal, advanced filters modal)
- Circular, visually prominent, positioned at top-right of modal
- Accessible and consistent across modals
*/
.modal-close-btn {
	position: absolute;
	top: -14px;
	/* Overlaps modal border for visual pop */
	right: -14px;
	width: 36px;
	height: 36px;
	font-size: 1.5em;
	font-weight: bold;
	color: var(--text-header, #f6e7b2);
	background-color: var(--accent-dark, #a97b2c);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 1001;
	transition: color 0.2s, background-color 0.2s, transform 0.2s;
	line-height: 1;
	border: 2px solid var(--bg-panel, #fff8e1);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	padding: 0;
}

.modal-close-btn:hover {
	color: #000;
	background-color: var(--border, #7c6844);
	transform: scale(1.1);
}

.modal-close-btn:focus-visible {
	outline: 3px solid var(--focus-ring-color, #ffcc00);
	outline-offset: 2px;
	box-shadow: 0 0 0 3px var(--focus-ring-shadow, rgba(255, 204, 0, 0.3));
}

/*
Context-specific override for fullscreen viewer close button
- Keeps the close button inside the visible area
*/
#fullscreen-viewer .modal-close-btn,
#fullscreen-viewer #close-btn {
	top: 15px;
	right: 15px;
}

/*
.btn-close
- Legacy/other close buttons (if any remain)
- Same visual style as modal-close-btn, but keep for backward compatibility
*/


/*
.btn-close-minimal
- Used for sidebar close button (mobile/compact contexts)
- Smaller, less visually prominent, but still accessible
- Only visible on mobile (see media query)
*/
.btn-close-minimal {
	position: absolute;
	top: 10px;
	right: 15px;
	font-size: 1.5em;
	font-weight: bold;
	color: var(--text-header);
	background-color: var(--accent-dark);
	border: 2px solid var(--bg-panel);
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: none;
	/* Hidden by default, only show on mobile */
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 10;
	transition: color 0.2s, background-color 0.2s, transform 0.2s;
	line-height: 1;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}



.btn-close-minimal:hover {
	color: #000000;
	background-color: var(--border);
	transform: scale(1.1);
}

.btn-close-minimal:focus-visible {
	outline: 3px solid var(--focus-ring-color, #ffcc00);
	outline-offset: 2px;
	box-shadow: 0 0 0 3px var(--focus-ring-shadow, rgba(255, 204, 0, 0.3));
}

/* End close button styles */

.fullscreen-thumbnails-bar .thumbs-arrow {
	background: var(--bg-panel, #fff9e6);
	color: var(--accent-dark, #a97b2c);
	border: 2px solid var(--accent-dark, #a97b2c);
	border-radius: 6px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.3em;
	margin: 0 4px;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.10);
	transition: background 0.2s, color 0.2s, border 0.2s, transform 0.15s;
	outline: none;
	padding: 0;
}

.fullscreen-thumbnails-bar .thumbs-arrow:hover:not(:disabled) {
	background: var(--accent-dark, #b4942d);
	color: #fff;
	border-color: var(--accent, #79672e);
	transform: scale(1.08);
}

.fullscreen-thumbnails-bar .thumbs-arrow:focus-visible {
	outline: 3px solid var(--focus-ring-color, #ffcc00);
	outline-offset: 2px;
	box-shadow: 0 0 0 3px var(--focus-ring-shadow, rgba(255, 204, 0, 0.3));
}

.fullscreen-thumbnails-bar .thumbs-arrow:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	background: #eee;
	color: #aaa;
	border-color: #ccc;
	transform: none;
}





/* Unified dropdown bar styling for all dropdowns */
.dropdown-bar {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px #d4af3744;
  font-size: 1em;
  display: flex;
  align-items: center;
  gap: 0.5em;
  justify-content: center;
}

.dropdown-bar label {
  color: var(--text-main);
  font-family: inherit;
}

.dropdown-bar select {
  background: var(--input-bg);
  color: var(--input-text);
  border: 1px solid var(--input-border);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 1em;
  transition: border-color 0.2s;
}

.dropdown-bar select:focus {
  border-color: var(--accent-dark);
  outline: none;
}

/* =====================
   UNIFIED MEDIA QUERIES (CLEANED)
   ===================== */

/* ============== MOBILE LARGE (max-width: 768px) ============== */
@media (max-width: 768px) {
  /* Body and layout adjustments */
  body:not(.sidebar-open-padding) { padding-top: 0; }
  html, body { overflow-x: hidden; }

  /* Logo responsiveness */
  header img, .logo, .site-logo {
    max-width: 100%;
    height: auto;
    display: block;
  }
  header img.site-logo {
    max-width: 90vw;
    width: 100%;
    margin: 0 auto 12px auto;
  }

  /* Sidebar mobile behavior */
  #sidebar-filters {
    position: fixed;
    top: 0; left: -285px; bottom: 0;
    height: 100vh;
    padding: 10px 0 10px 0;
    border-left-width: 0; border-right-width: 0;
    overflow: hidden;
    box-sizing: border-box;
    z-index: 1040;
    background-color: var(--bg-panel, #fff8e1);
    border-top: none; border-bottom: none; border-image: none;
    display: none;
    flex-direction: column;
    visibility: hidden;
    transition: left 0.3s, visibility 0.3s, padding-left 0.3s, padding-right 0.3s, border-left-width 0.3s, border-right-width 0.3s;
  }
  #sidebar-filters.open {
    left: 0; z-index: 1050; visibility: visible; display: flex;
    width: 280px; padding-left: 10px; padding-right: 10px;
    border-right-width: 2px; border-left-width: 0;
    overflow: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    transition: left 0.3s, visibility 0s, padding-left 0s, padding-right 0s, border-left-width 0s, border-right-width 0s;
  }
  #sidebar-filters #filters {
    flex-grow: 1; overflow-y: auto; height: 100%; padding-top: 30px;
  }
  #sidebar-toggle {
    display: block; position: fixed; top: 10px; left: 10px; z-index: 1000;
    background: var(--button-bg, #bfa76a); color: var(--button-text, #fff);
    border: 1px solid var(--accent-dark, #a97b2c); padding: 8px 12px; border-radius: 4px;
    cursor: pointer; font-family: "Cinzel", serif;
  }
  #sidebar-toggle .fa-bars { margin-right: 6px; }

	/* When a modal or overlay needs the toggle hidden, JS will set data-hidden-by-modal="true".
		 Respect that on small/mobile screens while leaving desktop media queries to control visibility. */
	#sidebar-toggle[data-hidden-by-modal="true"] {
		display: none !important;
		pointer-events: none;
		opacity: 0;
	}

  /* Navigation adjustments */
  nav>.topnav { padding-left: 0; padding-right: 0; }
  nav>.topnav>a {
    display: block; margin: 8px 0; width: 100%; max-width: 300px; text-align: center;
  }

  /* Layout adjustments */
  .layout-wrapper { grid-template-columns: 1fr; }

  /* Featured art header mobile adjustments */
  #featured-art .featured-header {
    flex-direction: column; align-items: center; gap: 0.5em; padding: 0.5em 0;
  }
  #featured-art .featured-header>.featured-center {
    font-size: 1.3em; margin-bottom: 0.2em; width: 100%; text-align: center;
    word-break: normal; white-space: normal;
  }
  #featured-art .featured-header button {
    width: auto; min-width: 36px; max-width: 120px; margin: 0; font-size: 1em;
  }

  /* Scrollbar styling for mobile sidebar */
  #filters::-webkit-scrollbar { width: 8px; }
  #filters::-webkit-scrollbar-track { background: var(--bg-secondary, #e9d8a6); border-radius: 8px; }
  #filters::-webkit-scrollbar-thumb { background: var(--accent-dark, #a97b2c); border-radius: 8px; }
  #filters::-webkit-scrollbar-thumb:hover { background: var(--border, #7c6844); }
  #filters { scrollbar-width: thin; scrollbar-color: var(--sidebar-border) var(--sidebar-bg); }

  /* Button adjustments */
  .btn-close-minimal { display: flex; }
}

/* ============== MOBILE LARGE PORTRAIT (max-width: 768px and orientation: portrait) ============== */
@media (max-width: 768px) and (orientation: portrait) {
  #featured-art .featured-header,
  #featured-art .featured-header-buttons-row-fake {
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
    padding: 0.5em 0;
    justify-content: center;
    width: 100%;
  }
  #featured-art .featured-header>.featured-center {
    order: 1; width: 100%; margin-bottom: 0.2em; font-size: 1.3em; text-align: center;
  }
  #featured-art .featured-header>.featured-left,
  #featured-art .featured-header>.featured-right {
    order: unset; flex: unset; justify-content: center; width: auto; margin-bottom: 0;
  }
  #featured-art .featured-header-buttons-row-fake {
    display: flex; flex-direction: row; justify-content: center; align-items: center; gap: 0.5em; margin-bottom: 0.2em; order: 2;
  }
  #featured-art .featured-left, #featured-art .featured-right { margin-bottom: 0; width: auto; }
}

/* ============== MOBILE SMALL (max-width: 600px) ============== */
@media (max-width: 600px) {
  /* Loading placeholder icons */
  .art-card .loading-placeholder i, .art-card .loading-placeholder.error i { font-size: 1.5em; }
  /* Grid layouts - base mobile sizing */
  .grid-default, .grid-square, #featured-grid.art-grid, #featured-grid.grid-square { gap: 8px; }
  /* Art cards and images */
  .art-card, .grid-square .art-card, #featured-grid.grid-square .art-card { border-radius: 8px; min-height: 100px; }
  .art-card img, .grid-square .art-card img, #featured-grid.grid-square .art-card img { border-radius: 8px; }
  /* Art card titles */
  .grid-square .art-card .art-title, #featured-grid.grid-square .art-card .art-title {
    border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; font-size: 0.95em; padding: 0.35em 0.5em 0.3em 0.5em;
  }
  /* Featured Art Section: Force single column */
  #featured-art .art-grid, #featured-art .grid-square, #featured-grid.art-grid, #featured-grid.grid-square {
    grid-template-columns: 1fr ; gap: 14px;
  }
}

/* ============== DESKTOP (min-width: 769px) ============== */
@media (min-width: 769px) {
  #sidebar-toggle { display: none; }
  #sidebar-filters {
    position: static; height: auto;
    border-image: var(--ornament-border, var(--ornate-border-fallback)) 32 repeat;
    box-shadow: 0 2px 24px #0006, 0 0 0 6px var(--border) inset;
  }
}

/* ============== LANDSCAPE MOBILE (orientation: landscape and max-width: 900px) ============== */
@media (orientation: landscape) and (max-width: 900px) {
  #fullscreen-viewer #fullscreen-img-container {
    flex-direction: row; align-items: center; justify-content: center; height: 100vh; max-height: 100vh;
  }
  #fullscreen-img.portrait-artwork {
    max-width: 40vw; max-height: 90vh; width: auto; height: auto; margin: 0 auto; display: block;
  }
}

/* ============== ACCESSIBILITY (prefers-contrast: high) ============== */
@media (prefers-contrast: high) {
  #fullscreen-viewer button:focus-visible,
  .fullscreen-thumb:focus-visible,
  #fullscreen-img:focus-visible,
  #fullscreen-menu-bar button:focus-visible {
    outline: 3px solid #000000;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.5);
  }
}

/* =====================
   UNIFIED ARTWORK SIZE CLASSES
   ===================== */

/* Base grid sizes for different artwork sizes */
.art-size-small .art-grid,
.art-size-small .grid-default,
.art-size-small .grid-square,
.art-size-small #featured-grid.art-grid,
.art-size-small #featured-grid.grid-square {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) ;
  gap: 10px;
}

.art-size-medium .art-grid,
.art-size-medium .grid-default,
.art-size-medium .grid-square,
.art-size-medium #featured-grid.art-grid,
.art-size-medium #featured-grid.grid-square {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) ;
  gap: 14px;
}

.art-size-large .art-grid,
.art-size-large .grid-default,
.art-size-large .grid-square,
.art-size-large #featured-grid.art-grid,
.art-size-large #featured-grid.grid-square {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) ;
  gap: 18px;
}

/* Mobile responsive adjustments for artwork sizes */
@media (max-width: 600px) {
  .art-size-small .art-grid,
  .art-size-small .grid-default,
  .art-size-small .grid-square {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) ;
    gap: 8px;
  }
  .art-size-small #featured-grid.art-grid,
  .art-size-small #featured-grid.grid-square {
    grid-template-columns: repeat(3, 1fr) ;
    gap: 8px;
  }
  .art-size-medium .art-grid,
  .art-size-medium .grid-default,
  .art-size-medium .grid-square,
  .art-size-medium #featured-grid.art-grid,
  .art-size-medium #featured-grid.grid-square {
    grid-template-columns: repeat(2, 1fr) ;
    gap: 10px;
  }
  .art-size-large .art-grid,
  .art-size-large .grid-default,
  .art-size-large .grid-square,
  .art-size-large #featured-grid.art-grid,
  .art-size-large #featured-grid.grid-square {
    grid-template-columns: 1fr ;
    gap: 16px;
  }
}

/* Tablet responsive adjustments */
@media (min-width: 601px) and (max-width: 768px) {
  .art-size-small .art-grid,
  .art-size-small .grid-default,
  .art-size-small .grid-square,
  .art-size-small #featured-grid.art-grid,
  .art-size-small #featured-grid.grid-square {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) ;
    gap: 10px;
  }

  .art-size-medium .art-grid,
  .art-size-medium .grid-default,
  .art-size-medium .grid-square,
  .art-size-medium #featured-grid.art-grid,
  .art-size-medium #featured-grid.grid-square {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) ;
    gap: 12px;
  }

  .art-size-large .art-grid,
  .art-size-large .grid-default,
  .art-size-large .grid-square,
  .art-size-large #featured-grid.art-grid,
  .art-size-large #featured-grid.grid-square {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)) ;
    gap: 16px;
  }
}

/* =====================
   UNIFIED MEDIA QUERIES (CLEANED)
   ===================== */

#gallery-content.hide-artwork-ui .art-title,
#gallery-content.hide-artwork-ui .favorite-btn,
#gallery-content.hide-artwork-ui .alt-images-indicator,
#featured-art.hide-artwork-ui .art-title,
#featured-art.hide-artwork-ui .favorite-btn,
#featured-art.hide-artwork-ui .alt-images-indicator {
  display: none !important;
}

/* Also hide the alt-version tooltip when Hide UI is enabled */
#gallery-content.hide-artwork-ui .alt-images-indicator-tooltip,
#featured-art.hide-artwork-ui .alt-images-indicator-tooltip {
  display: none !important;
}

#fs-fav-btn.favorited,
.btn-fullscreen-menu.favorited {
  color: var(--favorite-color, #ff69b4);
}
#fs-fav-btn {
  transition: color 0.2s;
}

#fullscreen-img.zoomed-in {
  cursor: grab;
  transition: transform 0.2s;
  /* The transform is set inline by JS for panning */
  /* Optionally, add a subtle border or shadow for effect */
  box-shadow: 0 0 0 4px var(--accent-dark, #b4942d);
}


/* === Fullscreen Settings Modals (Zoom & Slideshow) === */
.fullscreen-settings-modal {
  display: none; /* Hidden by default, shown by JS */
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2100; /* Above overlay and fullscreen viewer */
  background: var(--bg-panel, #fff9e6);
  border: 3px solid var(--accent-dark, #b4942d);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  min-width: 320px;
  max-width: 95vw;
  min-height: 120px;
  max-height: 90vh;
  padding: 0;
  flex-direction: column;
  outline: none;
  pointer-events: auto;
}
.fullscreen-settings-modal[style*="display: flex"] {
  display: flex ;
}
.fullscreen-settings-modal .modal-content-wrapper {
  padding: 24px 32px;
  background: none;
  border: none;
  box-shadow: none;
}
.fullscreen-settings-modal h3 {
  font-family: "Cinzel Decorative", "Cinzel", serif;
  font-size: 1.3em;
  color: var(--accent-dark, #b4942d);
  margin-bottom: 18px;
  text-align: center;
}
.fullscreen-settings-modal label {
  display: block;
  margin-bottom: 12px;
  color: var(--text-main, #41372b);
  font-size: 1.1em;
}
.fullscreen-settings-modal input[type="range"] {
  width: 100%;
  margin: 12px 0 18px 0;
  accent-color: var(--accent-dark, #b4942d);
  /* Mobile-specific improvements */
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-secondary, #e9d8a6);
  outline: none;
  cursor: pointer;
}

/* Custom slider thumb for better mobile touch */
.fullscreen-settings-modal input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-dark, #b4942d);
  cursor: pointer;
  border: 2px solid var(--bg-panel, #fff9e6);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.fullscreen-settings-modal input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-dark, #b4942d);
  cursor: pointer;
  border: 2px solid var(--bg-panel, #fff9e6);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Larger touch targets on mobile */
@media (max-width: 768px) {
  .fullscreen-settings-modal input[type="range"] {
    height: 12px;
    margin: 16px 0 24px 0;
  }
  
  .fullscreen-settings-modal input[type="range"]::-webkit-slider-thumb {
    width: 32px;
    height: 32px;
  }
  
  .fullscreen-settings-modal input[type="range"]::-moz-range-thumb {
    width: 32px;
    height: 32px;
  }
}
.fullscreen-settings-modal .modal-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
}
.fullscreen-settings-modal .btn {
  min-width: 90px;
  font-size: 1em;
  padding: 8px 18px;
}

/* === Immersive Fullscreen Slideshow Mode === */
#fullscreen-viewer.immersive {
  background: #000 ;
  z-index: 3000;
}
/* Removed: #fullscreen-viewer.immersive *:not(#fullscreen-img) { display: none ; } */
/* Removed: #fullscreen-viewer .immersive-img { ... } */
#fullscreen-viewer.immersive > *:not(#fullscreen-img-container):not(#fullscreen-menu-bar) {
  display: none ;
}
#fullscreen-viewer.immersive #fullscreen-img-container,
#fullscreen-viewer.immersive #fullscreen-img-wrapper,
#fullscreen-viewer.immersive #fullscreen-img {
  display: block ;
}

#fullscreen-viewer.immersive #fullscreen-img-container,
#fullscreen-viewer.immersive #fullscreen-img-wrapper {
  position: fixed ;
  top: 0; left: 0; width: 100vw; height: 100vh;
  margin: 0 ;
  padding: 0 ;
  background: #000 ;
  display: flex ;
  align-items: center ;
  justify-content: center ;
  border-radius: 0 ;
  box-shadow: none ;
  z-index: 3001;
  overflow: visible ;
}

#fullscreen-viewer.immersive #fullscreen-img {
  position: relative ;
  max-width: 100vw ;
  max-height: 100vh ;
  width: auto ;
  height: auto ;
  object-fit: contain ;
  margin: 0 auto ;
  border: none ;
  box-shadow: none ;
  border-radius: 0 ;
  background: #000 ;
  left: 0; top: 0;
  display: block ;
}

@media (max-width: 600px) {
  #fullscreen-menu-bar {
    flex-direction: row ;
    justify-content: space-between ;
    align-items: center ;
    width: 100vw ;
    left: 0 ;
    padding: 8px 0 ;
    bottom: 0 ;
    position: fixed ;
    z-index: 3002 ;
    background: rgba(0,0,0,0.92) ;
    gap: 0 ;
  }
  #fullscreen-menu-bar button {
    flex: 1 1 0;
    min-width: 48px;
    max-width: 100vw;
    font-size: 1.5em;
    padding: 14px 0;
    margin: 0;
    border-radius: 0;
    background: none;
    border: none;
    color: #fff;
    outline: none;
    box-shadow: none;
    transition: background 0.2s, color 0.2s;
  }
  #fullscreen-menu-bar button:active {
    background: rgba(255,255,255,0.08);
  }
}

/* Screen reader only class for accessibility announcements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============== KEYBOARD SHORTCUTS MODAL ============== */
#keyboard-shortcuts-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-panel);
  border: 2px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  max-width: 700px;
  width: 95vw;
  max-height: 85vh;
  overflow: hidden;
  display: none;
  flex-direction: column;
}

#keyboard-shortcuts-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  display: none;
}

#keyboard-shortcuts-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 24px 15px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: 6px 6px 0 0;
  position: relative;
}

#keyboard-shortcuts-modal .modal-header h2 {
  margin: 0;
  font-family: "Cinzel Decorative", "Cinzel", serif;
  color: var(--accent-dark);
  font-size: 1.3em;
  display: flex;
  align-items: center;
  gap: 8px;
}

#keyboard-shortcuts-modal .modal-close-btn {
  position: relative;
  right: 0;
  top: 0;
  width: 40px;
  height: 40px;
  margin-left: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#keyboard-shortcuts-modal .modal-close-btn:focus,
#keyboard-shortcuts-modal .modal-close-btn:hover {
  background: var(--accent);
  color: var(--button-text);
  transform: scale(1.05);
}

#keyboard-shortcuts-modal .modal-close-btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#keyboard-shortcuts-modal .modal-content {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-secondary);
}

#keyboard-shortcuts-modal .modal-content::-webkit-scrollbar {
  width: 8px;
}

#keyboard-shortcuts-modal .modal-content::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

#keyboard-shortcuts-modal .modal-content::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

#keyboard-shortcuts-modal .shortcuts-section {
  margin-bottom: 25px;
}

#keyboard-shortcuts-modal .shortcuts-section h3 {
  font-family: "Cinzel Decorative", "Cinzel", serif;
  color: var(--accent-dark);
  font-size: 1.1em;
  margin-bottom: 12px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

#keyboard-shortcuts-modal .shortcut-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 8px 0;
}

#keyboard-shortcuts-modal .shortcut-item kbd {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-family: monospace;
  font-size: 0.9em;
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  min-width: 20px;
  text-align: center;
  white-space: nowrap;
}

#keyboard-shortcuts-modal .shortcut-item span {
  color: var(--text-main);
  font-size: 0.95em;
  flex: 1;
  line-height: 1.4;
}

#keyboard-shortcuts-modal .shortcuts-section p {
  margin: 8px 0;
  color: var(--text-secondary);
  font-size: 0.9em;
  line-height: 1.4;
}

#keyboard-shortcuts-modal .shortcuts-section p kbd {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 0.85em;
  color: var(--text-main);
}

/* Tablet responsiveness */
@media (max-width: 1024px) {
  #keyboard-shortcuts-modal {
    max-width: 90vw;
    max-height: 80vh;
  }
  
  #keyboard-shortcuts-modal .shortcut-item {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  #keyboard-shortcuts-modal .shortcut-item kbd {
    flex-shrink: 0;
  }
}

/* Mobile responsiveness for keyboard shortcuts modal */
@media (max-width: 768px) {
  #keyboard-shortcuts-modal {
    width: 95vw;
    max-height: 90vh;
    margin: 10px;
    top: 5vh;
    transform: translateX(-50%);
  }
  
  #keyboard-shortcuts-modal .modal-header {
    padding: 12px 15px;
  }
  
  #keyboard-shortcuts-modal .modal-header h2 {
    font-size: 1.1em;
  }
  
  #keyboard-shortcuts-modal .modal-close-btn {
    padding: 6px 10px;
    min-width: 36px;
    min-height: 36px;
    font-size: 1em;
  }
  
  #keyboard-shortcuts-modal .modal-content {
    padding: 15px;
  }
  
  #keyboard-shortcuts-modal .shortcut-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 6px 0;
  }
  
  #keyboard-shortcuts-modal .shortcut-item kbd {
    align-self: flex-start;
    font-size: 0.85em;
    padding: 3px 6px;
  }
  
  #keyboard-shortcuts-modal .shortcuts-section h3 {
    font-size: 1em;
  }
  
  #keyboard-shortcuts-modal .shortcuts-section {
    margin-bottom: 20px;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  #keyboard-shortcuts-modal {
    width: 98vw;
    max-height: 95vh;
    top: 2.5vh;
  }
  
  #keyboard-shortcuts-modal .modal-content {
    padding: 12px;
  }
  
  #keyboard-shortcuts-modal .shortcuts-section {
    margin-bottom: 18px;
  }
  
  #keyboard-shortcuts-modal .shortcut-item span {
    font-size: 0.9em;
  }
}

/* Prevent background scroll when modal is open */
body.modal-open {
  overflow: hidden ;
  position: fixed;
  width: 100%;
}

/* Prevent sidebar scrolling when modal is open - more specific rules */
#sidebar-filters.modal-open,
#sidebar-filters.modal-open #filters,
#sidebar-filters.modal-open * {
  overflow: hidden ;
  scroll-behavior: auto ;
}

/* Also prevent any scrollable containers within sidebar */
#sidebar-filters.modal-open .filter-group,
#sidebar-filters.modal-open .dropdown-bar,
#sidebar-filters.modal-open .search-container {
  overflow: hidden ;
}

/* Hide skip link when modal is open to prevent overlay */
body.modal-open .skip-link {
  display: none ;
}

/* Ensure modal content is focusable and scrollable */
#keyboard-shortcuts-modal .modal-content {
  scroll-behavior: smooth;
  transition: outline 0.2s ease;
  /* Prevent scroll chaining to parent */
  overscroll-behavior: contain;
}

#keyboard-shortcuts-modal .modal-content:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 169, 123, 44), 0.2);
}

/* Keyboard navigation hint */
#keyboard-shortcuts-modal .modal-content:focus::after {
  content: "Use ↑↓ arrows, Page Up/Down, Home/End, or Space to scroll";
  position: absolute;
  top: -30px;
  left: 0;
  background: var(--accent);
  color: var(--button-text);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  white-space: nowrap;
  z-index: 2001;
  opacity: 0.9;
}

@media (max-width: 768px) {
	.fullscreen-settings-modal input[type="range"] {
	  -webkit-appearance: auto ;
	  appearance: auto ;
	  height: initial ;
	  background: initial ;
	  border-radius: initial ;
	  /* Remove or override any other custom styles here */
	}
	.fullscreen-settings-modal input[type="range"]::-webkit-slider-thumb,
	.fullscreen-settings-modal input[type="range"]::-moz-range-thumb {
	  -webkit-appearance: auto ;
	  appearance: auto ;
	  width: initial ;
	  height: initial ;
	  border-radius: initial ;
	  background: initial ;
	  border: initial ;
	  box-shadow: initial ;
	}
  }

/* =====================
   PERFORMANCE DASHBOARD MODAL REDESIGN
   ===================== */
#performance-dashboard-modal {
  /* Inherit modal base styles, then override for unique look */
  background: var(--bg-panel);
  border: 3px solid #2bb3c0;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(43,179,192,0.18), 0 2px 24px #0006;
  padding: 0;
  min-width: 340px;
  max-width: 98vw;
  min-height: 220px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  font-family: 'Segoe UI', 'EB Garamond', serif;
}

#performance-dashboard-modal .modal-header {
  background: linear-gradient(90deg, #2bb3c0 0%, #1e7fa3 100%);
  color: #fff;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 1.5em;
  padding: 22px 32px 18px 32px;
  text-align: left;
  border-bottom: 2px solid #1e7fa3;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 12px;
}

#performance-dashboard-modal .modal-header .fa-tachometer-alt {
  font-size: 1.2em;
  margin-right: 10px;
  color: #fff;
}

#performance-dashboard-modal .modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #fff;
  color: #2bb3c0;
  border: 2px solid #2bb3c0;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  z-index: 1001;
}
#performance-dashboard-modal .modal-close-btn:hover {
  background: #2bb3c0;
  color: #fff;
  transform: scale(1.08);
}

#performance-dashboard-modal .modal-content-wrapper {
  background: none;
  border: none;
  box-shadow: none;
  padding: 32px 32px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  overflow-y: auto;
}

.performance-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  width: 100%;
  margin: 0 auto;
}

.performance-metric-card {
  background: linear-gradient(135deg, #e6fafd 60%, #f7fafd 100%);
  border: 2px solid #2bb3c0;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(43,179,192,0.08);
  padding: 22px 18px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
  animation: metric-fadein 0.7s cubic-bezier(0.4,0,0.2,1);
}
.performance-metric-card:hover {
  box-shadow: 0 4px 24px #2bb3c044;
  transform: translateY(-2px) scale(1.03);
}

.performance-metric-icon {
  font-size: 2.1em;
  color: #2bb3c0;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 4px #2bb3c022);
}
.performance-metric-label {
  font-family: 'Cinzel', serif;
  color: #1e7fa3;
  font-size: 1.08em;
  margin-bottom: 6px;
  text-align: center;
  letter-spacing: 0.01em;
}
.performance-metric-value {
  font-size: 2.1em;
  font-weight: bold;
  color: #0e3513;
  text-shadow: 0 1px 0 #fff, 0 2px 8px #2bb3c022;
  margin-bottom: 2px;
  transition: color 0.2s;
}
.performance-metric-unit {
  font-size: 0.95em;
  color: #1e7fa3;
  margin-left: 2px;
}
.performance-metric-description {
  font-size: 0.95em;
  color: #4a5568;
  margin-top: 4px;
  text-align: center;
}

@keyframes metric-fadein {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* Responsive adjustments */
@media (max-width: 600px) {
  #performance-dashboard-modal .modal-header {
    font-size: 1.1em;
    padding: 16px 12px 12px 16px;
  }
  #performance-dashboard-modal .modal-content-wrapper {
    padding: 16px 8px 12px 8px;
    gap: 14px;
  }
  .performance-metrics-grid {
    gap: 12px;
  }
  .performance-metric-card {
    padding: 14px 8px 12px 8px;
    min-height: 80px;
  }
}

/* Dark theme overrides */
body.dark-theme #performance-dashboard-modal {
  background: #1a2730;
  border-color: #2bb3c0;
  box-shadow: 0 8px 32px #2bb3c044, 0 2px 24px #000a;
}
body.dark-theme #performance-dashboard-modal .modal-header {
  background: linear-gradient(90deg, #1e7fa3 0%, #2bb3c0 100%);
  color: #fff;
  border-bottom: 2px solid #2bb3c0;
}
body.dark-theme .performance-metric-card {
  background: linear-gradient(135deg, #183c4a 60%, #1a2730 100%);
  border-color: #2bb3c0;
  box-shadow: 0 2px 12px #2bb3c044;
}
body.dark-theme .performance-metric-label {
  color: #2bb3c0;
}
body.dark-theme .performance-metric-value {
  color: #e6fafd;
  text-shadow: 0 1px 0 #1a2730, 0 2px 8px #2bb3c022;
}
body.dark-theme .performance-metric-unit {
  color: #2bb3c0;
}
body.dark-theme .performance-metric-description {
  color: #b0c4cc;
}

.performance-chart-section {
  margin-top: 32px;
  background: rgba(43,179,192,0.07);
  border-radius: 12px;
  padding: 18px 12px;
  box-shadow: 0 2px 8px #2bb3c022;
}
.performance-chart-section h4 {
  font-family: 'Cinzel', serif;
  color: #1e7fa3;
  margin-bottom: 12px;
  font-size: 1.1em;
}
.performance-history-section {
  margin-top: 24px;
  background: rgba(43,179,192,0.04);
  border-radius: 10px;
  padding: 14px 10px;
}
.performance-history-section h4 {
  font-family: 'Cinzel', serif;
  color: #1e7fa3;
  margin-bottom: 8px;
  font-size: 1.05em;
}
.perf-history-log {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.98em;
  color: #4a5568;
}
.perf-history-log li {
  margin-bottom: 6px;
  border-left: 3px solid #2bb3c0;
  padding-left: 8px;
  font-family: 'Segoe UI', serif;
}

/* =====================
   PERFORMANCE DASHBOARD STYLES
   ===================== */
#performance-dashboard-modal {
  /* Inherit modal base styles, then override for unique look */
  background: var(--bg-panel);
  border: 3px solid #2bb3c0;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(43,179,192,0.18), 0 2px 24px #0006;
  padding: 0;
  min-width: 340px;
  max-width: 98vw;
  min-height: 220px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  font-family: 'Segoe UI', 'EB Garamond', serif;
}

#performance-dashboard-modal .modal-header {
  background: linear-gradient(90deg, #2bb3c0 0%, #1e7fa3 100%);
  color: #fff;
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 1.5em;
  padding: 22px 32px 18px 32px;
  text-align: left;
  border-bottom: 2px solid #1e7fa3;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 12px;
}

#performance-dashboard-modal .modal-header .fa-tachometer-alt {
  font-size: 1.2em;
  margin-right: 10px;
  color: #fff;
}

#performance-dashboard-modal .modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: #fff;
  color: #2bb3c0;
  border: 2px solid #2bb3c0;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  z-index: 1001;
}
#performance-dashboard-modal .modal-close-btn:hover {
  background: #2bb3c0;
  color: #fff;
  transform: scale(1.08);
}

#performance-dashboard-modal .modal-content-wrapper {
  background: none;
  border: none;
  box-shadow: none;
  padding: 32px 32px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  overflow-y: auto;
}

/* Performance Dashboard Modal Content Scrolling */
#performance-dashboard-modal .modal-content {
  max-height: calc(90vh - 80px);
  overflow-y: auto;
  flex: 1;
}

/* Performance Dashboard Scrollbar Styling */
#performance-dashboard-modal .modal-content::-webkit-scrollbar {
  width: 10px;
}

#performance-dashboard-modal .modal-content::-webkit-scrollbar-track {
  background: rgba(43,179,192,0.1);
  border-radius: 8px;
  margin: 4px;
}

#performance-dashboard-modal .modal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #2bb3c0 0%, #1e7fa3 100%);
  border-radius: 8px;
  border: 2px solid rgba(43,179,192,0.2);
}

#performance-dashboard-modal .modal-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #1e7fa3 0%, #2bb3c0 100%);
  box-shadow: 0 2px 8px rgba(43,179,192,0.3);
}

/* Error list scrollbar */
.dashboard-error-list-ul::-webkit-scrollbar {
  width: 8px;
}

.dashboard-error-list-ul::-webkit-scrollbar-track {
  background: rgba(239,68,68,0.1);
  border-radius: 6px;
  margin: 2px;
}

.dashboard-error-list-ul::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-radius: 6px;
  border: 1px solid rgba(239,68,68,0.3);
}

.dashboard-error-list-ul::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  box-shadow: 0 2px 6px rgba(239,68,68,0.4);
}

/* Firefox scrollbar styling */
#performance-dashboard-modal .modal-content {
  scrollbar-width: thin;
  scrollbar-color: #2bb3c0 rgba(43,179,192,0.1);
}

.dashboard-error-list-ul {
  scrollbar-width: thin;
  scrollbar-color: #ef4444 rgba(239,68,68,0.1);
}

/* Performance Description */
.performance-description {
  text-align: center;
  color: #b0c4d4;
  font-size: 1.05em;
  margin-bottom: 1rem;
  line-height: 1.4;
}

/* Performance Grid */
.performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  width: 100%;
  margin: 0 auto;
}

/* Performance Cards */
.performance-card {
  background: linear-gradient(135deg, #e6fafd 60%, #f7fafd 100%);
  border: 2px solid #2bb3c0;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(43,179,192,0.08);
  padding: 22px 18px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
  animation: metric-fadein 0.7s cubic-bezier(0.4,0,0.2,1);
}

.performance-card:hover {
  box-shadow: 0 4px 24px #2bb3c044;
  transform: translateY(-2px) scale(1.03);
}

.performance-card h4 {
  font-family: 'Cinzel', serif;
  color: #1e7fa3;
  font-size: 1.08em;
  margin-bottom: 12px;
  text-align: center;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.performance-card h4 i {
  font-size: 1.1em;
  color: #2bb3c0;
}

/* Metric Values */
.metric-value {
  font-size: 2.1em;
  font-weight: bold;
  color: #0e3513;
  text-shadow: 0 1px 0 #fff, 0 2px 8px #2bb3c022;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.metric-value.green {
  color: #22c55e;
}

.metric-value.orange {
  color: #f59e0b;
}

.metric-value.red {
  color: #ef4444;
}

/* Metric Details */
.metric-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 0.9em;
  color: #4a5568;
  text-align: center;
}

.metric-details span {
  font-size: 0.85em;
  color: #6b7280;
}

/* Metric Explanation */
.metric-explanation {
  font-size: 0.95em;
  color: #4a5568;
  text-align: center;
  font-weight: 500;
}

/* Dashboard Charts */
.dashboard-charts {
  margin-top: 32px;
  background: rgba(43,179,192,0.07);
  border-radius: 12px;
  padding: 18px 12px;
  box-shadow: 0 2px 8px #2bb3c022;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.chart-description {
  text-align: center;
  margin-bottom: 0.5em;
  font-size: 1.05em;
  color: #b0c4d4;
  line-height: 1.4;
}

/* Chart Canvas Styling */
#performance-fps-chart {
  max-width: 600px !important;
  width: 100% !important;
  height: 180px !important;
  margin: 2rem auto !important;
  display: block !important;
}

/* Improve chart readability in portrait mobile */
@media (max-width: 600px) and (orientation: portrait) {
  #performance-fps-chart {
    height: 240px !important; /* taller for narrow screens */
    margin: 1rem auto !important;
  }
}

/* Dashboard Error List */
.dashboard-error-list {
  margin-top: 24px;
  background: rgba(239,68,68,0.08);
  border-radius: 10px;
  padding: 14px 10px;
  border: 1px solid rgba(239,68,68,0.2);
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.dashboard-error-list h4 {
  font-family: 'Cinzel', serif;
  color: #dc2626;
  margin-bottom: 12px;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-error-list-ul {
  max-height: 200px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.dashboard-error-list-ul li {
  padding: 8px 12px;
  margin-bottom: 6px;
  background: rgba(239,68,68,0.05);
  border-radius: 6px;
  border-left: 3px solid #ef4444;
  font-size: 0.9em;
  line-height: 1.4;
}

.dashboard-error-list-ul li:last-child {
  margin-bottom: 0;
}

/* Performance Actions */
.performance-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
  padding-top: 20px;
}

.performance-actions .btn {
  background: linear-gradient(135deg, #2bb3c0 0%, #1e7fa3 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.performance-actions .btn:hover {
  background: linear-gradient(135deg, #1e7fa3 0%, #2bb3c0 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(43,179,192,0.3);
}

/* Performance Tips */
.performance-tips {
  margin-top: 24px;
  background: rgba(34,197,94,0.08);
  border-radius: 10px;
  padding: 14px 10px;
  border: 1px solid rgba(34,197,94,0.2);
}

.performance-tips h4 {
  font-family: 'Cinzel', serif;
  color: #16a34a;
  margin-bottom: 12px;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.performance-tips ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.performance-tips li {
  padding: 6px 0;
  font-size: 0.9em;
  color: #4a5568;
  line-height: 1.4;
  position: relative;
  padding-left: 20px;
}

.performance-tips li::before {
  content: "💡";
  position: absolute;
  left: 0;
  top: 6px;
  font-size: 0.8em;
}

@keyframes metric-fadein {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* Responsive adjustments */
@media (max-width: 600px) {
  #performance-dashboard-modal .modal-header {
    font-size: 1.1em;
    padding: 16px 12px 12px 16px;
  }
  #performance-dashboard-modal .modal-content-wrapper {
    padding: 16px 8px 12px 8px;
    gap: 14px;
  }
  .performance-grid {
    gap: 12px;
  }
  .performance-card {
    padding: 14px 8px 12px 8px;
    min-height: 80px;
  }
  .performance-actions {
    flex-direction: column;
    gap: 8px;
  }
  .performance-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Dark theme overrides */
body.dark-theme #performance-dashboard-modal {
  background: #1a2730;
  border-color: #2bb3c0;
  box-shadow: 0 8px 32px #2bb3c044, 0 2px 24px #000a;
}

body.dark-theme #performance-dashboard-modal .modal-header {
  background: linear-gradient(90deg, #1e7fa3 0%, #2bb3c0 100%);
  color: #fff;
  border-bottom: 2px solid #2bb3c0;
}

body.dark-theme .performance-card {
  background: linear-gradient(135deg, #183c4a 60%, #1a2730 100%);
  border-color: #2bb3c0;
  box-shadow: 0 2px 12px #2bb3c044;
}

body.dark-theme .performance-card h4 {
  color: #2bb3c0;
}

body.dark-theme .metric-value {
  color: #e6fafd;
  text-shadow: 0 1px 0 #1a2730, 0 2px 8px #2bb3c022;
}

body.dark-theme .metric-details span {
  color: #b0c4cc;
}

body.dark-theme .metric-explanation {
  color: #b0c4cc;
}

body.dark-theme .performance-description {
  color: #b0c4d4;
}

body.dark-theme .chart-description {
  color: #b0c4d4;
}

body.dark-theme .dashboard-error-list {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.3);
}

body.dark-theme .dashboard-error-list-ul li {
  background: rgba(239,68,68,0.1);
  color: #fca5a5;
}

body.dark-theme .performance-tips {
  background: rgba(34,197,94,0.15);
  border-color: rgba(34,197,94,0.3);
}

body.dark-theme .performance-tips li {
  color: #bbf7d0;
}

.performance-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  width: 100%;
  margin: 0 auto;
}

.performance-metric-card {
  background: linear-gradient(135deg, #e6fafd 60%, #f7fafd 100%);
  border: 2px solid #2bb3c0;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(43,179,192,0.08);
  padding: 22px 18px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
  animation: metric-fadein 0.7s cubic-bezier(0.4,0,0.2,1);
}
.performance-metric-card:hover {
  box-shadow: 0 4px 24px #2bb3c044;
  transform: translateY(-2px) scale(1.03);
}

.performance-metric-icon {
  font-size: 2.1em;
  color: #2bb3c0;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 4px #2bb3c022);
}
.performance-metric-label {
  font-family: 'Cinzel', serif;
  color: #1e7fa3;
  font-size: 1.08em;
  margin-bottom: 6px;
  text-align: center;
  letter-spacing: 0.01em;
}
.performance-metric-value {
  font-size: 2.1em;
  font-weight: bold;
  color: #0e3513;
  text-shadow: 0 1px 0 #fff, 0 2px 8px #2bb3c022;
  margin-bottom: 2px;
  transition: color 0.2s;
}
.performance-metric-unit {
  font-size: 0.95em;
  color: #1e7fa3;
  margin-left: 2px;
}
.performance-metric-description {
  font-size: 0.95em;
  color: #4a5568;
  margin-top: 4px;
  text-align: center;
}

.performance-chart-section {
  margin-top: 32px;
  background: rgba(43,179,192,0.07);
  border-radius: 12px;
  padding: 18px 12px;
  box-shadow: 0 2px 8px #2bb3c022;
}
.performance-chart-section h4 {
  font-family: 'Cinzel', serif;
  color: #1e7fa3;
  margin-bottom: 12px;
  font-size: 1.1em;
}
.performance-history-section {
  margin-top: 24px;
  background: rgba(43,179,192,0.04);
  border-radius: 10px;
  padding: 14px 10px;
}
.performance-history-section h4 {
  font-family: 'Cinzel', serif;
  color: #1e7fa3;
  margin-bottom: 12px;
  font-size: 1.1em;
}
.perf-history-log {
  max-height: 200px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin: 0;
}
.perf-history-log li {
  padding: 8px 12px;
  margin-bottom: 6px;
  background: rgba(43,179,192,0.05);
  border-radius: 6px;
  border-left: 3px solid #2bb3c0;
  font-size: 0.9em;
  line-height: 1.4;
}

/* Error filtering and grouping styles */
.error-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(43,179,192,0.2);
}

.error-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.error-filter {
  padding: 0.5rem;
  border: 2px solid rgba(43,179,192,0.3);
  border-radius: 6px;
  background: rgba(43,179,192,0.1);
  color: #b0c4d4;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.error-filter:hover {
  border-color: rgba(43,179,192,0.5);
  background: rgba(43,179,192,0.15);
}

.error-filter:focus {
  outline: none;
  border-color: #2bb3c0;
  box-shadow: 0 0 0 2px rgba(43,179,192,0.2);
}

.btn-small {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

/* Grouped error display */
.grouped-errors {
  max-height: 400px;
  overflow-y: auto;
}

.error-category {
  margin-bottom: 1.5rem;
  border: 2px solid rgba(43,179,192,0.2);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.error-category:hover {
  border-color: rgba(43,179,192,0.4);
  box-shadow: 0 2px 8px rgba(43,179,192,0.1);
}

.category-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(43,179,192,0.1) 0%, rgba(30,127,163,0.1) 100%);
  border-bottom: 1px solid rgba(43,179,192,0.2);
  font-weight: 600;
  color: #b0c4d4;
}

.category-icon {
  font-size: 1.2rem;
  margin-right: 0.5rem;
}

.category-name {
  flex: 1;
  font-size: 1rem;
}

.error-count {
  background: rgba(239,68,68,0.2);
  color: #ef4444;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.category-errors {
  padding: 0.5rem 1rem;
  margin: 0;
  list-style: none;
}

.category-errors li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(43,179,192,0.1);
  font-size: 0.9rem;
  line-height: 1.4;
}

.category-errors li:last-child {
  border-bottom: none;
}

/* Category-specific styling */
.error-category-network {
  border-left: 4px solid #3b82f6;
}

.error-category-network .category-header {
  background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(37,99,235,0.1) 100%);
}

.error-category-gallery {
  border-left: 4px solid #8b5cf6;
}

.error-category-gallery .category-header {
  background: linear-gradient(135deg, rgba(139,92,246,0.1) 0%, rgba(124,58,237,0.1) 100%);
}

.error-category-performance {
  border-left: 4px solid #f59e0b;
}

.error-category-performance .category-header {
  background: linear-gradient(135deg, rgba(245,158,11,0.1) 0%, rgba(217,119,6,0.1) 100%);
}

.error-category-memory {
  border-left: 4px solid #ef4444;
}

.error-category-memory .category-header {
  background: linear-gradient(135deg, rgba(239,68,68,0.1) 0%, rgba(220,38,38,0.1) 100%);
}

/* Flat error display */
.flat-errors {
  max-height: 400px;
  overflow-y: auto;
}

/* No errors message */
.no-errors {
  text-align: center;
  padding: 2rem;
  color: #22c55e;
  font-style: italic;
  font-size: 1.1rem;
}

/* Light theme adjustments */
body:not(.dark-theme) .error-filter {
  background: #ffffff;
  color: #2d3748;
  border-color: #e2e8f0;
}

body:not(.dark-theme) .error-filter:hover {
  border-color: #cbd5e0;
  background: #f7fafc;
}

body:not(.dark-theme) .error-category {
  border-color: #e2e8f0;
  background: #ffffff;
}

body:not(.dark-theme) .category-header {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  color: #2d3748;
  border-bottom-color: #e2e8f0;
}

body:not(.dark-theme) .category-errors li {
  border-bottom-color: #f1f5f9;
  color: #4a5568;
}

