/* =======================
   Root: Default Variables
======================= */
:root {
  --background: #ffffee;
  --background-light: #ffffee;
  --background-dark: #f0e0d6;
  --font_color: #800000;
  --border_color: #d9bfb7;
  --link_color: #0000ee;
  --link_color_hover: #5555ff;
  --quote_text: #789922;
  --announcement-color: #b5a748;
  --show-lain: none;
  --show-yotsuba: block;
}

/* =======================
   Lainrocks Theme
======================= */
:root[data-theme="lainrocks"] {
  --font_color: #DBC2BEff;
  --link_color: #7dc0d4;
  --link_color_hover: #6094a3;
  --font_color_shaded: #765A57ff;
  --background: #111;
  --background-light: #0e0e0e;
  --background-dark: #022b2a;
  --border_color: #6E6667ff;
  --form_control_bg: #222222;
  --announcement-color: #b5a748;
  --quote_text: #789922;
  --show-lain: block;
  --show-yotsuba: none;
}

/* =======================
   Yotsuba Theme
======================= */
:root[data-theme="yotsuba"] {
  --background: #ffffee;
  --background-light: #ffffee;
  --background-dark: #f0e0d6;
  --font_color: #800000;
  --border_color: #d9bfb7;
  --link_color: #0000ee;
  --link_color_hover: #5555ff;
  --quote_text: #789922;
  --announcement-color: #b5a748;
  --show-lain: none;
  --show-yotsuba: block;
}

/* =======================
   Base Body and Typography
======================= */
body {
  background-color: var(--background);
  color: var(--font_color);
  margin: 0;
  font-family: Arial, sans-serif;
  transition: background 0.3s, color 0.3s;
}

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

a:hover {
  color: var(--link_color_hover);
}

/* =======================
   Header & Navbar
======================= */
#header {
  width: 50%;
  padding: 20px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

#navbar {
  border-color: var(--border_color);
  text-align: center;
}

/* =======================
   Containers & Content
======================= */
.container {
  border-color: var(--border_color) !important;
}

.content {
  margin-top: 20px;
  flex: 1; /* push footer down if using flex layout */
}

/* =======================
   Cards
======================= */
.card {
  color: var(--font_color);
  background-color: var(--background-light);
  border-color: var(--border_color);
}

.card-header {
  color: var(--font_color);
  background-color: var(--background-dark);
}

.announcement-card-header {
  color: #000;
  background-color: var(--announcement-color);
}

/* =======================
   Links
======================= */
.whitelink:link,
.whitelink:visited {
  color: white;
}

/* =======================
   Special Effects
======================= */
#titleText {
  font-family: "Lucida Console", "Courier New", monospace;
}

.banner {
  width: 240px;
  height: 60px;
}

.glow {
  text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00, 0 0 30px #00ff00, 0 0 40px #00e600;
}

/* =======================
   Positioning
======================= */

.bottom-right-image {
  position: fixed;
  bottom: 0;
  right: 0;
}

.theme-selector {
  position: fixed;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
}

.pagination-wrapper {
  display: inline-block;
}

.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.9rem;
}

.pagination .page,
.pagination .prev,
.pagination .next {
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  color: var(--font_color);
  border: 1px solid var(--border_color);
}

.pagination .page.current {
  font-weight: bold;
  background: rgba(0,0,0,0.08);
}

/* incredibly redundant code lol */

#left-topbar {
  right: 0;
  display: inline;
}

#right-topbar {
  left: 0;
  display: inline;
}

#top-bar {
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center; 
}

#bottom-bar {
  /* like copyright shit  */
  bottom: 0;
  display: flex;
  text-align: center;
}
/* Responsive: move pagination into footer center on narrow screens */
@media (max-width: 600px) {
  .theme-selector {
    left: 0;
    right: 0;
    justify-content: center;
  }
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
}

#lain {
  display: var(--show-lain);
  width: auto;
  height: 25%;
}

#yotsuba {
  display: var(--show-yotsuba);
  width: auto;
  height: 10%;
}

input {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* =======================
   Footer
======================= */
footer {
  position: fixed;
  bottom: -100px;
  left: 0;
  width: 100%;
  background-color: var(--background-dark);
  color: var(--font_color);
  text-align: center;
  padding: 10px 0;
  transition: bottom 0.3s ease-in-out;
  z-index: 1000;
}

footer.show {
  bottom: 0;
}

/* =======================
   Textboard Styles
======================= */
div.sideArrows {
	color: var(--border_color);

	float: left;

	margin-right: 2px;
	margin-top: 0px;
	margin-left: 2px;
}

#boardTitle {
	font-family: Tahoma, sans-serif;
	font-size: 28px;
	font-weight: bold;
	letter-spacing: -2px;
	margin-top: 0px;
}

div.post blockquote.postMessage {
	display: block;
}

blockquote > span.quote {
	color: var(--quote_text);
}

div.post div.postInfo span.postNum a {
	text-decoration: none;
	color: var(--font_color);
}

div.post div.postInfo span.postNum a:hover, .posteruid .hand:hover {
	color: red !important;
}

div.post div.postInfo span.nameBlock {
	display: inline-block;
}

div.post div.postInfo span.nameBlock span.name {
	color: #117743;
	font-weight: bold;
}

div.post div.postInfo span.nameBlock span.postertrip {
	color: #117743;
	font-weight: normal !important;
}

div.replyContainer div.post div.file div.fileInfo {
	margin-left: 20px;
}

div.post {
	margin: 4px 0;
	overflow: hidden;
}

/* Ensure posts always have a background so theme variables missing won't hide them */
.post {
  background-color: var(--background-light) !important;
  border: 1px solid var(--border_color);
  padding: 2px;
}

/* Replies explicitly use the darker background */
.post.reply, div.reply {
  /*background-color: var(--background-dark) !important; */
  border: 1px solid var(--border_color);
  border-left: none;
  border-top: none;
}

div.thread > div:nth-of-type(2) > div.reply {
	margin-top: 2px !important;
}

div.op {
	display: inline;
}

div.reply {
	background-color: var(--background-dark);

	border: 1px solid var(--border_color);
	border-left: none;
	border-top: none;

	display: table;

	padding: 2px;
}

.post.op {
  background-color: var(--background-dark) !important;
  border: 1px solid var(--border_color);
  border-left: none;
  border-top: none;
  padding: 2px;
}

.postContainer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.postContainer .post {
  flex: 1 1 auto;
}

@media (max-width: 600px) {
  .postContainer { flex-direction: column; }
}

.lastReplyPreview {
  margin-left: 18px;
}
.lastReplyPreview .previewReply {
  background-color: transparent;
  border: none;
  padding: 0;
}
.lastReplyPreview .postInfo {
  padding: 0 4px 2px 0;
}
.postMessage.preview {
  margin: 4px 0 8px 0;
  /* color: #666; */
  color: var(--font_color);
  font-size: 0.95em;
  border-left: 3px solid var(--border_color);
  padding-left: 8px;
  background: transparent;
}
.lastReplyPreview .postNum {
  color: var(--font_color);
}

div.reply input {
	float: none;
}

table {
	border-spacing: 1px;

	margin-left: auto;
	margin-right: auto;
}

form {
  margin-top: 5px;
}

table.postForm > tbody > tr > td:first-child {
	background-color: var(--background-dark );
	color: var(--font_color);
	font-weight: bold;
	border: 1px solid var(--font_color);
	padding: 0 5px;

	font-size: 10pt;
}

tr.rules td {
	border: 0px !important;
	background-color: transparent !important;
	font-weight: normal !important;
}

td {
	margin: 0px;
	padding: 0px;

	font-size: 10pt;
}

input[type=text], table.postForm > tbody textarea {
	margin: 0px;
	margin-right: 2px;
	padding: 2px 4px 3px 4px;

	border: 1px solid #AAA;
	outline: none;

	font-family: arial, helvetica, sans-serif;
	font-size: 10pt;
}

input[type=text]:focus, input:not([type]):focus, textarea:focus {
	border: 1px solid #ea8 !important;
}

table.postForm > tbody > tr > td > input[type=text] {
	width: 244px;
}

/* =======================
   Misc
======================= */
ul {
  list-style-type: square;
}

@media only screen and (min-width: 320px) and (max-width: 480px) {
  .hide-on-mobile {
    display: none;
  }
}

#banner-container {
  text-align: center;
}

/* temporary banner */
#banner-temp {
  margin-top: 5px;
  width: 20%;
  height: 20%;
}
/* Reply anchors shown under OP on board index (>>123) */
.replyList {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.95em;
  color: var(--font_color);
}
.replyList .replyAnchor {
  color: var(--link_color);
  margin-right: 6px;
}
.replyList .replyAnchor:hover {
  color: var(--link_color_hover);
  text-decoration: underline;
}
.replyList .replyMore {
  color: var(--font_color);
  font-weight: bold;
  margin-left: 4px;
}

/* Post counter (gif digits) */
.post-counter {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.post-counter-digit {
  image-rendering: pixelated;
}
.post-counter-label {
  font-size: 0.9rem;
  color: var(--font_color);
  margin-left: 8px;
}

/* =======================
   Capcodes / Staff labels
   ======================= */
.capcode {
  font-weight: bold;
  display: inline-block;
}
.capcode .capcode-label {
  font-weight: normal;
  margin-left: 6px;
  font-size: 0.85em;
  opacity: 0.95;
  padding: 1px 6px;
  border-radius: 3px;
  color: white;
}
.cap-administrator .capcode-label {
  background: #c0392b; /* strong red */
}
.cap-moderator .capcode-label {
  background: #2980b9; /* blue */
}
.capcode.cap-administrator { color: #ffd7d1; }
.capcode.cap-moderator { color: #dbeeff; }

