html[data-bs-theme="light"], 
[data-bs-theme="light"] body { background: #f8f9fa !important; }
html[data-bs-theme="dark"],
[data-bs-theme="dark"] body { background: #212529 !important; }
[data-bs-theme="dark"] .navbar { background-color: #2b3035 !important; }
[data-bs-theme="dark"] pre { background: #2b3035 !important; color: #f8f9fa; }
[data-bs-theme="light"] pre { background: #fff; padding: 1rem; border-radius: 4px; }

/* Slightly brighter card bodies than page background */
[data-bs-theme="light"] .card .card-body { background-color: #ffffff; }
[data-bs-theme="dark"] .card .card-body { background-color: #2b3035; }

/* JSON syntax highlighting */
.json-pre { background: transparent; color: inherit; }
.json-key { color: #66d9ef; }
.json-string { color: #a6e22e; }
.json-number { color: #ae81ff; }
.json-boolean { color: #fd971f; }
.json-null { color: #f92672; }
.json-pre mark { background-color: #ffeb3b55; color: inherit; padding: 0 1px; border-radius: 2px; }

/* Tooltip for cover preview: no padding/background/border */
.tooltip.cover-tooltip .tooltip-inner {
	padding: 0;
	background: transparent;
	border: none;
	box-shadow: none;
}
.tooltip.cover-tooltip .tooltip-arrow { display: none; }
.tooltip.cover-tooltip .tooltip-inner img {
	display: block;
	border: none;
	outline: none;
}

.upcoming-scroll,
.latest-scroll {
	position: relative;
	overflow-x: auto;
	padding: 0 1rem 1rem;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: rgba(13, 110, 253, 0.85) rgba(13, 110, 253, 0.2);
	scroll-padding: 0 1rem;
	cursor: grab; /* desktop hint */
} 

/* While dragging: show grabbing cursor and avoid text selection */
.upcoming-scroll.dragging,
.latest-scroll.dragging {
	cursor: grabbing !important;
	user-select: none;
	-webkit-user-select: none;
	-ms-user-select: none;
	scroll-behavior: auto;
}
.upcoming-scroll::-webkit-scrollbar,
.latest-scroll::-webkit-scrollbar {
	height: 6px;
}
.upcoming-scroll::-webkit-scrollbar-thumb,
.latest-scroll::-webkit-scrollbar-thumb {
	background: rgba(13, 110, 253, 0.85);
	border-radius: 999px;
	transition: background 0.2s ease;
}
.upcoming-scroll:hover::-webkit-scrollbar-thumb,
.latest-scroll:hover::-webkit-scrollbar-thumb {
	background: rgba(13, 110, 253, 1);
}

.upcoming-scroll::-webkit-scrollbar-track,
.latest-scroll::-webkit-scrollbar-track {
	background: rgba(13, 110, 253, 0.2);
	border-radius: 999px;
}
.upcoming-scroll .row,
.latest-scroll .row {
	/* Keep items on a single horizontal rail for swipe */
	flex-wrap: nowrap;
	margin-left: 0;
	margin-right: 0;
}

.upcoming-scroll .card-img-top,
.latest-scroll .card-img-top {
		width: 100%;
		height: auto;
		border-radius: 0;
		-webkit-user-drag: none; /* Safari/Chrome */
		-webkit-user-select: none;
		user-select: none;
} 
.upcoming-scroll .row > .col,
.latest-scroll .row > .col {
		flex: 0 0 72vw;
		max-width: 320px;
} 
@media (min-width: 576px) {
		.upcoming-scroll .row > .col,
		.latest-scroll .row > .col { flex: 0 0 55vw; max-width: 360px; }
}
@media (min-width: 768px) {
		.upcoming-scroll .row > .col,
		.latest-scroll .row > .col { flex: 0 0 33.3333%; max-width: 33.3333%; }
}
@media (min-width: 992px) {
		.upcoming-scroll .row > .col,
		.latest-scroll .row > .col { flex: 0 0 25%; max-width: 25%; }
}

.all-series-table-wrapper {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	width: 100%;
	margin: 0;
	padding: 0;
}
.all-series-table {
	width: 100%;
	min-width: 0;
	table-layout: auto;
}

@media (max-width: 991.98px) {
	.all-series-table {
		table-layout: auto;
	}
}
.table-scroll-hint { display: none; }
.all-series-table td {
	vertical-align: middle;
	padding-bottom: 0.6rem;
}
.all-series-table .narrators-col {
	max-width: 260px;
	white-space: normal;
	word-break: break-word;
}
.all-series-table td.narrators-col {
	white-space: normal;
}
.all-series-table td.books-col {
	text-align: right;
	padding-right: 1.25rem;
}
.all-series-table td.duration-col {
	white-space: nowrap;
	text-align: right;
	padding-right: 1rem;
}

/* Reduce spacing between cover and series columns for tighter layout */
.all-series-table td.series-cover-cell {
	padding-right: 0.25rem;
	width: auto;
	white-space: nowrap;
	position: relative;
	/* Ensure the cell can be brought above siblings when hovered */
	z-index: 1;
}
/* Ensure cover image is constrained to the intended height but keeps aspect ratio */
.all-series-table td.series-cover-cell img {
	height: 40px;
	width: auto;
	display: block;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	transform-origin: left center;
	will-change: transform;
	position: relative;
	z-index: 1;
}
/* Hover / keyboard focus preview (desktop only) - use Bootstrap tooltip preview instead of custom overlay */
.all-series-table td.series-cover-cell:hover,
.all-series-table td.series-cover-cell:focus-within {
	z-index: 1;
}
.all-series-table td.series-cover-cell:hover img,
.all-series-table td.series-cover-cell:focus-within img {
	/* No custom scaling here — tooltips provide the preview */
	transform: none;
	box-shadow: none;
	position: relative;
	z-index: 1;
}
/* Don't apply any hover behavior on small screens (touch devices) */
@media (max-width: 575.98px) {
	.all-series-table td.series-cover-cell img,
	.all-series-table td.series-cover-cell:hover img,
	.all-series-table td.series-cover-cell:focus-within img {
		transform: none !important;
		box-shadow: none !important;
		position: relative !important;
		pointer-events: auto !important;
	}
}
.all-series-table td.series-col {
	padding-left: 0.25rem;
	min-width: 0;
	width: auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	/* removed absolute positioning and reserved padding so the icon sits inline before the title */
} 

/* Keep the link truncation working with space for an inline icon */
.all-series-table td.series-col .series-link {
	display: inline-block;
	vertical-align: middle;
	line-height: 1;
	max-width: calc(100% - 1.25rem);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
} 

/* Show the narrator-warning icon inline before the series title */
.all-series-table td.series-col .bi-exclamation-triangle {
	/* use inline-flex and center the icon vertically so it lines up with the title */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1em;
	line-height: 1;
	height: 1em;
	vertical-align: middle;
	margin-right: 0.4rem;
}

/* Info icon shown when narrator-change ignore is enabled */
.all-series-table td.series-col .ignore-narrator-icon {
	font-size: 0.95rem;
	vertical-align: middle;
	line-height: 1;
	opacity: 0.95;
	cursor: default;
}
.all-series-table td.series-col .ignore-narrator-icon:hover {
	opacity: 1;
}

/* Upcoming column: next release */
.all-series-table td.next-release-col {
	white-space: nowrap;
	text-align: right;
	padding-right: 1.25rem;
}.all-series-table td.last-release-col {
	white-space: nowrap;
	text-align: right;
	padding-right: 1.25rem;
}

.all-series-table th.sortable-col {
	cursor: pointer;
	position: relative;
	user-select: none;
}
.all-series-table th.sortable-col::after {
	content: '';
	font-size: 0.75rem;
	margin-left: 0.35rem;
	opacity: 0.5;
}
.all-series-table th.sortable-col[data-sort-dir="asc"]::after {
	content: '▲';
	opacity: 0.9;
}
.all-series-table th.sortable-col[data-sort-dir="desc"]::after {
	content: '▼';
	opacity: 0.9;
}

.series-book-hidden {
	opacity: 0.75;
	border-left: 3px solid var(--bs-warning, #ffc107);
}


@media (max-width: 767.98px) {
	.all-series-table { font-size: 0.95rem; }
	.all-series-table th,
	.all-series-table td { padding: 0.55rem 0.65rem; }
	.all-series-table .series-col .series-link { max-width: 230px; vertical-align: middle; line-height: 1; }
	.all-series-table .narrators-col { max-width: 200px; }
	.table-scroll-hint { display: block; }
	/* On mobile, keep the swipe rail left-aligned even when bootstrap would center */
	.upcoming-scroll .row.justify-content-center,
	.latest-scroll .row.justify-content-center { justify-content: flex-start !important; }
} 


/* Mobile config tweaks: tighter card padding, full-width primary actions */
@media (max-width: 575.98px) {
	.card .card-body { padding: 0.6rem !important; }
	.card .card-header { padding: 0.55rem 0.75rem; font-size: 0.95rem; }
	form#settingsForm { padding-bottom: 0.5rem; }
	/* Make important action buttons stack and fill width on very small screens */
	.btn-primary, .btn-danger, .btn-warning, .btn-secondary { width: 100%; display: block; margin-bottom: 0.5rem; }
	.two-step-confirm { min-width: auto; }
	/* Reduce spacing inside the developer/DB cards to avoid large scrolls */
	.card .card-body .mb-3 { margin-bottom: 0.5rem !important; }
}


/* Two-step confirm buttons: reserve width to avoid layout shift when label changes */
.two-step-confirm {
	min-width: 14ch; /* long enough for 'Confirm remove' / 'Confirm delete' */
	white-space: nowrap;
	text-align: center;
}

/* Collapsible section chevron animation */
.collapse-icon {
	transition: transform 0.2s ease;
}

[data-bs-theme="dark"] .collapse-icon {
	color: #adb5bd;
}

[data-bs-theme="light"] .collapse-icon {
	color: #6c757d;
}

[data-bs-target="#knownSeriesCollapse"].collapsed .collapse-icon,
[data-bs-target="#statisticsCollapse"].collapsed .collapse-icon {
	transform: rotate(-90deg);
}

/* Mobile table adjustments */
@media (max-width: 767px) {
  .all-series-table .series-col {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: none;
  }
  .all-series-table .series-link {
    display: inline-block;
    font-size: 0.95rem;
    max-width: calc(100% - 1.5rem);
  }
  .all-series-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.75rem;
    padding: 0 0.75rem;
  }
  .all-series-table {
    width: 100%;
    min-width: auto;
    font-size: 0.95rem;
  }
  .all-series-table td, .all-series-table th {
    padding: 0.55rem 0.65rem;
  }
  .all-series-table .books-col, .all-series-table .duration-col {
    min-width: auto;
  }
}

/* (mobile navbar styles removed — reverted) */
