/************************ Dropdown Menus ******************************/

.postMenuContainer {
	display: inline-block;
}

/* Shared toggle arrow (▶) for all dropdown menus */
.menuToggle {
	cursor: pointer;
	display: inline-block;
	transition: transform 0.15s ease;
	font-family: var(--font-family-sans-serif);
	line-height: 1;
	user-select: none;
}

.menuToggle.menuOpen {
	transform: rotate(90deg); /* ▶ rotates to ▼ */
}

/* Shared dropdown menu base */
.dropdownMenu {
	position: absolute;
	background: var(--color-bg-reply);
	border: 1px solid var(--color-hi-contrast-border);
	box-shadow: 0 2px 4px rgba(0,0,0,0.15);
	min-width: 120px;
	z-index: 9999;
	padding: 2px 0;
}

.dropdownMenu a {
	display: block;
	padding: 2px 4px;
	text-decoration: none;
	color: inherit;
	white-space: nowrap;
	cursor: pointer;
}

.dropdownMenu a:hover {
	background: rgba(0, 0, 0, 0.05);
}

/* Attachment menu toggle — extra spacing in file bar */
.attachmentMenuToggle {
	margin-left: 4px;
	font-size: var(--font-size-x-small);
}

/* Attachment dropdown — slightly smaller than post menu */
.attachmentMenuDropdown {
	min-width: 100px;
	font-size: var(--font-size-small);
}

.attachmentMenuDropdown a {
	padding: 1px 4px;
}

/************************ Posts & Threads ******************************/

.post .nameContainer,
.post .time,
.post .userIP,
.post .postnum,
.post .adminFunctions,
.post .host,
.post .filterpostContainer,
.post .soudaneContainer,
.post .replyButton,
.post .backlinks {
	display: inline-block;
}

.heading {
	color: #af0a0f;
	font-size: 1.125em;
	font-weight: bold;
}

.threadUpdater {
	display: inline;
}

/************************ Attachments & Images ************************/

.multiAttachment {
	display: inline-block;
	vertical-align: top;
}

.multiAttachment .postimg {
	float: none;
}

.multiAttachment .fileProperties {
	display: block;
}

.attachmentButton {
	font-size: var(--font-size-small);
}

.expandimg {
	max-width: 100%;
	cursor: pointer;
}

/************************ Collapsible Details Boxes ********************/

.indicatorHidden {
	display: none !important;
}

.detailsbox {
	background-color: var(--color-bg-main);
	border-color: var(--color-lo-contrast-border) var(--color-hi-contrast-border) var(--color-hi-contrast-border) var(--color-lo-contrast-border);
  border-style: solid;
	border-width: 1px;
}

.detailsbox > summary {
  cursor: pointer;
	background-color: var(--color-bg-postblock);
	padding: 2px 4px;
	font-weight: var(--font-weight-bold);
}

.detailsbox[open] > summary {
	border-bottom: 1px solid var(--color-hi-contrast-border);
}

.detailsboxContent {
	padding: 0.25em;
}

.detailsboxForm {
	display: table;
} 

/************************ JS Alert/Messages *******************************/

/* Container that holds all messages */
.messageStackContainer {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 1000;
	pointer-events: none; /* allow clicks to pass through except on messages */
}

/* Each message */
.messageContainer {
	margin: 10px auto;
	padding: 10px;
	width: 90%;
	max-width: 600px;
	box-sizing: border-box;
	display: flex;
	justify-content: space-between;
	align-items: center;
	pointer-events: auto; /* allow close button clicks */
	opacity: 0;
	transform: translateY(-20px);
	transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Appearance for success / failure */
.messageSuccess {
	background-color: var(--color-bg-theading3);
	color: var(--color-fg-theading);
	border: 1px solid var(--color-fg-theading);
}

.messageFailure {
	background-color: var(--color-bg-theading);
	color: var(--color-fg-theading);
	border: 1px solid var(--color-fg-theading);
}

.messagePending {
	background-color: var(--color-bg-theading2, #0040e0);
	color: var(--color-fg-theading);
	border: 1px solid var(--color-fg-theading);
	border-radius: 4px;
}

@keyframes messageSpin {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}

.messageSpin {
	font-size: var(--font-size-large);
	display: inline-block;
	animation: messageSpin 1.5s linear infinite;
}

/* Show & hide animation states */
.messageContainer.show {
	opacity: 1;
	transform: translateY(0);
}

.messageContainer.hide {
	opacity: 0;
	transform: translateY(-20px);
}

/* Text inside the message */
.messageText {
	flex: 1;
}

/* Close button */
.messageClose {
	cursor: pointer;
	margin-left: 10px;
	font-weight: bold;
}

/************************ Deleted Posts (Mod) **************************/

.deletedPostEntry {
	text-align: left;
}

.deletedPost, .deletedFile { 
	opacity: 0.75;
}

.managepostsCommentWrapper {
	word-break: break-word;
	max-height: 200px;
	overflow: auto;
	word-wrap: break-word;
}

.staffNotesContainer {
	font-size: var(--font-size-small);
	color: var(--color-fg-warning);
}

/************************ Overboard ***********************************/

.overboardThreadBoardTitle {
	font-weight: var(--font-weight-bold);
}

.filterSelectBoardItem {
	display: block;
}

#reloadTable {
	margin: 0.5em auto;
}

.littlelist {
	margin: 0;
	padding: 0;
	list-style: none;
}

/************************ Post Form & Dropzone ************************/

.formattingDetails summary {
  width: fit-content;
  font-weight: normal;
  cursor: pointer;
}

.formattingDetails summary:hover {
  font-weight: bold;
}

.dropzoneWrap {
  user-select: none;
  margin-top: 4px;
}

.dropzone {
  border: 2px dashed #888;
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  color: #666;
  transition: color 0.1s ease-in-out, border-color 0.1s ease-in-out;
}

.dropzone:hover {
  color: var(--color-hi-contrast-border);
  border-color: var(--color-hi-contrast-border);
}

.dropzone.dragover {
  border-color: #33a;
  color: #33a;
}

.dropzoneFilePicker {
  display: none;
}

/************************ Filters *************************************/

.filter .comment,
.filter .post,
.filter .omittedposts,
.filter .filesize,
.filter .postimg,
.filter > .reply-container {
  display: none;
}

.filter .post.op {
  display: block;
}

.filter .postinfo,
.filter .category {
  opacity: 0.5;
}

/* .filterpost {
  text-decoration: none;
  font-weight: var(--font-weight-bold);
	font-size: 9pt;
} */

/* .filterpostContainer::before {
	content: "["
}

.filterpostContainer::after {
	content: "]"
} */

.filterpost:hover {
  opacity: 1;
}

.filterImage .postimg {
  opacity: 0;
}

.filterImage .attachmentAnchor {
  position: relative;
}

/************************ Search **************************************/

#searchresult {
	margin-top: 1em;
	text-align: left;
}

/************************ Private Messages *****************************/

.pmSendForm {
	margin: 0.5em 0;
}

.pmBodyInput {
	width: 30em;
	height: 5em;
}

.pmRow.pmRead {
	opacity: 0.85;
}

.pmRow.pmUnread {
	font-weight: var(--font-weight-bold);
}

.pmUnreadIndicator {
	color: var(--color-fg-warning);
	font-weight: var(--font-weight-bold);
}

.pmStatusCell {
	width: 1.5em;
	text-align: center;
}

.pmDateCell {
	white-space: nowrap;
}

.pmViewCell {
	white-space: nowrap;
}

/* View message page */

.pmViewContainer {
	text-align: left;
}

.pmViewNav {
	margin-bottom: 0.5em;
}

.pmViewMeta td {
	padding: 2px 8px 2px 0;
}

.pmViewBody {
	padding: 0.5em 0;
	word-break: break-word;
}

/************************ Media ***************************************/

.pmStickyWrap {
	position: fixed;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	width: var(--pm-slot-width, 728px);
	height: var(--pm-slot-height, 90px);
	max-width: 100%;
	z-index: 900;
	background: transparent;
}

.pmStickyClose {
	position: absolute;
	top: -1.4em;
	right: 0;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	border: none;
	padding: 0 0.4em;
	cursor: pointer;
	font-size: 1em;
	line-height: 1.4em;
	z-index: 901;
}

.pmSlotMobile {
	display: none;
}

.pmPostAd .postinfo {
	margin-bottom: 0.25em;
}

.pmInlineRow {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px;
	margin: 0.5em auto;
	overflow-x: auto;
}

.pmPostAdBadge {
	font-size: var(--font-size-small);
	font-weight: var(--font-weight-bold);
	background: var(--color-bg-theading, #800000);
	color: var(--color-fg-theading, #fff);
	padding: 0 4px;
}

.pmAdImage {
	max-width: 100%;
	height: auto;
	display: inline;
}

.pmPostAdSlot {
	max-width: 100%;
	overflow: hidden;
}

.pmPostAdFrame {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	background: transparent;
}

/************************ Catalog *************************************/

#catalogSettings {
	float: right;
}

#catalogSortForm {
	float: left;
}

#catalogTable {
	margin: 0 auto;
	text-align: center;
	clear: both;
}

/* Auto columns: flex wrapping, centered */
#catalogTable.auto-cols {
	text-align: center;
}

#catalogTable.auto-cols tr,
#catalogTable.auto-cols tbody {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: center;
}

#catalogTable.auto-cols .thread {
	display: inline-block;
	margin: 0.5em;
}

/* Fixed columns: CSS grid */
#catalogTable.fixed-cols tr,
#catalogTable.fixed-cols tbody {
	display: grid;
	grid-template-columns: repeat(var(--cat-cols, 5), auto);
	justify-content: center;
}

#catalogTable.fixed-cols .thread {
	margin: 0.5em;
}

#catalogTable.fixed-cols .catComment {
	max-height: 100px;
	overflow: hidden;
}

#catalogTable.fixed-cols .catComment:hover {
	overflow: auto;
}

/* Full width: stretch table and distribute threads across the page */
#catalogTable.full-width {
	display: block;
	width: 100%;
}

#catalogTable.full-width tbody {
	display: flex;
	flex-wrap: wrap;
	width: 100%;
}

#catalogTable.full-width tr {
	display: flex;
	flex-wrap: wrap;
	width: 100%;
	justify-content: space-evenly;
}

#catalogTable.full-width.fixed-cols tr {
	display: grid;
	grid-template-columns: repeat(var(--cat-cols, 5), 1fr);
	justify-items: center;
}

#catalogTable .thread {
	padding: 0 0 0.5em;
	width: 180px;
	max-height: 250px;
	max-width: 170px;
	text-align: center;
	vertical-align: top;
	overflow-y: hidden;
	overflow-wrap: break-word;
	overflow-wrap: anywhere;
}

#catalogTable .thread:hover {
	overflow-y: auto;
}

#catalogTable .thumb {
	display: block;
	margin: 0 auto 0.75em;
	width: 150px;
	height: 150px;
	object-fit: scale-down;
}

#catalogTable .catPostInfo {
	font-size: var(--font-size-small);
}

#catalogTable .catPostInfo .title {
	display: inline-block;
	font-size: inherit;
  max-width: 100%;
	vertical-align: text-bottom;
	overflow: hidden;
	text-overflow: ellipsis;
  white-space: nowrap;
}

#catalogTable .catPostInfo .Replies {
	display: inline-block;
}

.catComment {
	display: table;
  margin: 0 auto;
	text-align: left;
	font-size: var(--font-size-small);
}

/************************ Utility Classes ******************************/

.buttonLink {
	background: none;       /* No background */
	border: none;           /* No border */
	color: var(--color-fg-link);         /* Link-like blue color */
	font: inherit;          /* Inherit font styles */
	cursor: pointer;       /* Pointer cursor to show it's clickable */
	padding: 0;             /* Remove padding */
}

.alignLeft {
	text-align: left;
}

/* Define the fixed position class with padding and bottom-right placement */
.fixedPosition {
	position: sticky;
	bottom: 5px; /* Adjust the distance from the bottom */
	right: 5px;  /* Adjust the distance from the right */
}

.selectlinktextjs {
	font-size: var(--font-size-x-small);
	user-select: none;
}

.url-input {
	min-width: 35ch;
}

.mod-extra-info {
	text-align: center;
}

/************************ Tables *******************************/
.tableViewportWrapper {
	max-width: 100%;
	overflow: auto;
}

.formtable {
	display: table;
	margin: 1em auto;
}

/************************ BBcode **************************************/

.neon {
    color: #ff1414;
    text-shadow: 0 0 5px #ff1414, 0 0 10px #ff1414, 0 0 20px #ff1414;
}

.echoText {
    text-shadow:
        2px 2px 0 rgba(0,0,0,0.45),
        4px 4px 0 rgba(0,0,0,0.35),
        6px 6px 0 rgba(0,0,0,0.25),
        8px 8px 0 rgba(0,0,0,0.15),
        10px 10px 0 rgba(0,0,0,0.08);
}

/************************ Mobile **************************************/

.pmMobileOnly {
	display: none;
}

@media screen and (max-width: 650px) {
	.pmMobileOnly {
		display: block;
	}

	.dropdownMenu a { line-height: 2 }

	.pmSlotTop {
		display: none;
	}

	.pmSlotMobile {
		display: block;
	}

	.pmDesktopOnly {
		display: none;
	}

	.pmStickyWrap {
		display: none;
	}
}

/* Thread watcher module */
.threadWatcherContent {
	padding: 0.75em;
	max-height: 60vh;
	overflow-y: auto;
}

/* Fixed (non-scrolling) header bar above the scrollable watch list. */
.threadWatcherHeader {
	padding: 0.25em 0.5em;
	border-bottom: 1px solid var(--color-border, rgba(128, 128, 128, 0.4));
}

.threadWatcherRefresh {
	display: inline-block;
	cursor: pointer;
	text-decoration: none;
	color: inherit;
	line-height: 1;
	padding: 0.1em 0.25em;
}

.threadWatcherRefresh.twSpinning {
	animation: twSpin 0.6s linear infinite;
}

/* Locked: during a poll or the post-refresh cooldown — not clickable, dimmed. */
.threadWatcherRefresh.twLocked {
	pointer-events: none;
	opacity: 0.5;
}

@keyframes twSpin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

/* "Updated: <time>" text after the refresh button. */
.threadWatcherUpdatedLabel {
	margin-left: 0.5em;
	font-size: var(--font-size-small);
	opacity: 0.7;
}

.threadWatcherUpdated {
	margin-left: 0.25em;
	font-size: var(--font-size-small);
	opacity: 0.7;
}

/* Watcher status colors: green = unread replies, red = an unread reply quotes you.
   Applies to both the admin-bar top-link and the watched-thread list entries. */
.threadWatcherToplink.twUnread,
.threadWatcherList .threadWatcherLink.twUnread {
	color: #2e7d32;
	font-weight: var(--font-weight-bold);
}

.threadWatcherToplink.twQuoted,
.threadWatcherList .threadWatcherLink.twQuoted {
	color: var(--color-fg-warning);
	font-weight: var(--font-weight-bold);
}

@media screen and (max-width: 600px) {
	#catalogTable .thread {
		width: 140px;
		max-width: 140px;
	}
	
	#catalogTable .thumb {
		max-width: 135px;
	}
}

/************************ Windows *************************************/

/* Shared window-manager, settings, and quick-reply logic for both the
   kokoimg and kokotxt style sets. Theme-specific colors/z-index that differ
   between the two live as overrides in their respective base.css files. */

#formfuncs a,
a.linkjs {
	text-decoration: underline;
	color: inherit;
}

/* Window Manager */
@keyframes fade {
	0% { filter: opacity(0); transform: scale(0.95); }
	100% { filter: opacity(1); transform: scale(1); }
}

@keyframes fadeout {
	0% { filter: opacity(1); transform: scale(1); }
	100% { filter: opacity(0); transform: scale(0.95); }
}

.window {
	position: fixed;
	z-index: 1000;
	background-color: inherit;
	border-width: 1px;
	border-style: solid;
	min-width: 220px;
	min-height: 220px;
	max-width: 100vw;
	max-height: 100vh;
	overflow: hidden;
	opacity: 0.75;
	animation: fade 0.1s;
}

/* .wclosing {
	animation: fadeout 0.1s;
} */

#wintop,
.window:hover {
	opacity: 1;
}

.window.minimized {
	border-bottom: none;
	min-height: 1em;
}

/* When minimized, hide everything in the window except its title bar.
   Generic so any window content (forms, tables, the thread watcher, etc.) collapses. */
.window.minimized > *:not(.winbar) {
	display: none;
}

.winbar {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid;
	cursor: move;
	vertical-align: middle;
}

.winname {
	flex-grow: 1;
	margin: 0.125em 0.25em;
	font-weight: var(--font-weight-bold);
	text-align: left;
}

.winctrl {
	display: flex;
	justify-content: space-between;
	flex-grow: 0;
	justify-content: flex-end;
	gap: 0.25em;
	margin: 0.25em;
	text-align: right;
}

.winctrl button {
	background-color: transparent;
	border: none;
	border-radius: 4px;
	padding: 0;
	width: 1em;
	height: 1em;
	min-width: 16px;
	min-height: 16px;
	cursor: pointer;
	font-size: var(--font-size-regular);
	/* transition: all 0.1s; */
}

.winctrl button img {
	display: block;
	width: 100%;
	height: 100%;
}

/* Settings */

#settabs {
	padding: 0.5em;
	padding-bottom: 0;
}

#settabs a {
	padding: 0.125em 0.25em;
}

#settarea {
	display: flex;
	flex-direction: column;
	padding: 0.5em;
	padding-top: 0;
	max-height: calc(100vh - 5em);
	overflow: auto;
}

#settarea > * {
	display: flex;
	flex-direction: row;
	/* transition: all 0.1s; */
	user-select: none;
}

/* General tab: fixed height, scroll overflow */
#settarea.settarea_general {
	height: 420px;
	max-height: calc(100vh - 5em);
}

#settarea > .settsection {
	flex-direction: column;
}

.settsection label {
	display: flex;
	flex-direction: row;
	user-select: none;
}

.settsectionheader {
	margin: 0.5em 0 0.125em;
	font-size: var(--font-size-small);
	font-weight: bold;
	opacity: 0.7;
	border-bottom: 1px solid var(--color-bg-window-item-highlight);
}

#settarea [type=number] {
	width: 5em;
}

.winctrl button:hover,
#settarea > label:hover,
.settsection label:hover,
.settab_selected {
	background-color: var(--color-bg-window-item-highlight);
}

#settusercss,
#settuserfilter {
	width: 100%;
	height: 199px;
	min-width: 202px;
	min-height: 110px;
	max-width: calc(100vw - 35px);
	max-height: calc(100vh - 119px);
}

#settarea details {
	max-width: fit-content;
	font-size: var(--font-size-small);
}

#settarea details ul {
	margin: 0;
	padding-left: 1em;
}

#filterdie {
  display: block;
  font-size: var(--font-size-small);
}

/************************ Quick reply  ********************************/

#qrinputs {
	display: flex;
	flex-direction: column;
}

#qrinputs > div {
	display: flex;
	flex-direction: row;
}

#qrinputs > div > .inputtext {
	flex-basis: -moz-available;
	width: 100%;
}

#qrinputs button {
	white-space: nowrap;
}

#qrcaptcha {
	padding: 0.2em;
	margin: 0.2em 0;
}

#qrcom {
	width: 250px;
	height: 110px;
	min-width: 250px;
	min-height: 110px;
	max-width: calc(100vw - 35px);
	max-height: calc(100vh - 119px);
}

/******************** Windows/settings/quick reply (mobile) **********/

@media screen and (max-width: 450px) {
	.window {
		top: 0 !important;
		left: 50% !important;
		transform: translate(-50%, 0%) !important;
		width: 100vw !important;
		min-height: initial;
		animation: none;
	}

	.window.minimized {
		top: auto !important;
		bottom: 0;
	}

	.winname {
		font-size: 1.25em;
	}

	.winctrl {
		font-size: 1.5em;
	}

	#settarea {
		line-height: 1.5;
	}

	#settusercss,
	#settuserfilter {
		height: calc(100vh - 23em);
		min-height: initial;
		max-width: 100% !important;
		max-height: 100% !important;
	}

	#qrcom {
		width: 100%;
		max-width: initial;
	}
}
