/* ==== Faux Forum Styles (scoped to forum page) ==== */

/* Toggle button positioning for forum page */
.toggle-btn {
  position: absolute !important;
  top: 230px !important;
  left: 0.4em !important;
  transform: none !important;
  z-index: 1002 !important;
  background: #444;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 1.3em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.day .toggle-btn {
  background: #eee;
  color: #222;
}
.toggle-btn:hover {
  background: #222;
  color: #fff;
  transform: scale(1.08) !important;
}
body.day .toggle-btn:hover {
  background: #ddd;
  color: #222;
  transform: scale(1.08) !important;
}

.forum-layout {
  display: flex;
  gap: 2rem;
  padding: 2rem 2rem 6rem; /* extra bottom for fixed license */
  max-width: 1400px;
  margin: 0 auto;
}

.forum-sidebar {
  width: 280px;
  background: #f4f4f4;
  border: 2px solid #ddd;
  border-radius: 12px;
  padding: 1.2rem 1rem 1.6rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  position: sticky;
  top: 1rem;
  align-self: flex-start;
}
body.night .forum-sidebar {
  background: #222;
  border-color: #333;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.forum-sidebar-title {
  font-size: 1.2rem;
  margin: 0 0 0.6rem;
  letter-spacing: 0.05em;
}

.forum-board-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.board {
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  transition: transform 0.2s, box-shadow 0.25s, background 0.3s;
  position: relative;
}
.board.active {
  border: 2px solid #888;
}
body.night .board {
  background: #1e1e1e;
  border-color: #2c2c2c;
}
.board:hover {
  transform: translateY(-4px) rotate(-0.6deg);
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  background: #fafafa;
}
body.night .board:hover {
  background: #292929;
  box-shadow: 0 6px 18px rgba(0,0,0,0.55);
}
.board-main {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.95rem;
}
.board-name { letter-spacing: 0.02em; }
.board-count { font-size: 0.75rem; opacity: 0.7; }
.board-desc {
  font-size: 0.75rem;
  margin: 0.35rem 0 0;
  opacity: 0.8;
  line-height: 1.2;
}

/* Thread Area */
.forum-thread {
  flex: 1;
  min-width: 0;
  background: linear-gradient(180deg,#ffffff,#f9f9f9);
  border: 2px solid #dcdcdc;
  border-radius: 16px;
  padding: 1.8rem 2rem 2.5rem;
  box-shadow: 0 6px 30px rgba(0,0,0,0.10);
}
body.night .forum-thread {
  background: linear-gradient(180deg,#202020,#181818);
  border-color: #2e2e2e;
  box-shadow: 0 6px 30px rgba(0,0,0,0.55);
}

.thread-header {
  border-bottom: 1px dashed #bbb;
  padding-bottom: 0.9rem;
  margin-bottom: 1.2rem;
}
body.night .thread-header { border-color: #444; }
.thread-title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  letter-spacing: 0.03em;
}
.thread-meta {
  display: flex;
  gap: 1.2rem;
  font-size: 0.75rem;
  opacity: 0.75;
  flex-wrap: wrap;
}

/* Posts */
.posts {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.post {
  display: flex;
  gap: 1rem;
  background: #fff;
  border: 1px solid #cecece;
  border-radius: 14px;
  padding: 0.9rem 1rem 1rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.3s;
}
body.night .post {
  background: #222;
  border-color: #333;
}
.post:before {
  content: "";
  position: absolute;
  top: -24px;
  right: -24px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at center, rgba(0,0,0,0.04), transparent 60%);
  transform: rotate(25deg);
  pointer-events: none;
}
body.night .post:before {
  background: radial-gradient(circle at center, rgba(255,255,255,0.04), transparent 60%);
}
.post:hover {
  /* Hover effect removed */
}
/* Hover effect removed for night mode as well */

.post-left {
  width: 145px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.25rem;
}
.avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  user-select: none;
}
.avatar.seed-a { background: linear-gradient(135deg,#6a4ffd,#b39eff); }
.avatar.seed-b { background: linear-gradient(135deg,#ff6b3d,#ffb199); }
.avatar.seed-c { background: linear-gradient(135deg,#34bfa3,#6de8d1); }
.avatar.seed-d { background: linear-gradient(135deg,#d84fb4,#ff9edc); }
body.night .avatar { box-shadow: 0 4px 14px rgba(0,0,0,0.55); }

.user-block {
  text-align: center;
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.username { font-weight: 600; font-size: 0.8rem; }
.role {
  font-size: 0.6rem;
  padding: 0.15rem 0.45rem;
  border-radius: 50px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}
.tag-founder { background: #6a4ffd; color: #fff; }
.tag-moderator { background: #ff6b3d; color: #fff; }
.tag-member { background: #555; color: #fff; }
body.night .tag-member { background: #777; }
.stat { opacity: 0.6; }

.post-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.post-meta {
  font-size: 0.65rem;
  display: flex;
  gap: 1rem;
  opacity: 0.6;
  flex-wrap: wrap;
}
.post-id { font-weight: 600; opacity: 0.7; }
.post-content p { margin: 0 0 0.6rem; line-height: 1.35; }
.post-content blockquote {
  margin: 0.4rem 0 0.6rem;
  padding: 0.4rem 0.8rem;
  background: #f5f5f5;
  border-left: 4px solid #bbb;
  font-size: 0.8rem;
  border-radius: 6px;
}
body.night .post-content blockquote {
  background: #2a2a2a;
  border-color: #444;
}

/* Reply box */
.reply-box {
  margin-top: 2rem;
  padding: 1.2rem 1.2rem 1.5rem;
  background: #ffffff;
  border: 1px solid #cfcfcf;
  border-radius: 14px;
}
body.night .reply-box { background: #202020; border-color: #333; }
.reply-title { margin: 0 0 0.9rem; font-size: 1.1rem; letter-spacing: 0.04em; }
.reply-form { display: flex; flex-direction: column; gap: 0.9rem; }
.field-group { display: flex; flex-direction: column; gap: 0.35rem; }
.field-group label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}
.field-group input,
.field-group textarea {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid #bbb;
  border-radius: 8px;
  background: #fafafa;
}
.field-group textarea { resize: vertical; min-height: 120px; }
body.night .field-group input,
body.night .field-group textarea {
  background: #2a2a2a;
  border-color: #444;
  color: #eee;
}
.post-btn {
  padding: 0.65rem 1.1rem;
  border: none;
  border-radius: 8px;
  background: #6a4ffd;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: not-allowed;
  opacity: 0.55;
}
.form-note { font-size: 0.65rem; opacity: 0.6; margin: -0.4rem 0 0; }

/* --- Forum Header --- */
.forum-header {
  background: #232b3b;
  color: #fff;
  padding: 0.7em 2em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.1em;
  border-bottom: 3px solid #0a1a2f;
  position: relative;
}
.forum-header .forum-nav {
  display: flex;
  gap: 1.5em;
}
.forum-header .forum-nav a {
  color: #fffdc0;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s;
}
.forum-header .forum-nav a:hover {
  color: #7ec8e3;
}
.forum-header .forum-search {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-left: 3em;
}
.forum-header input[type="text"] {
  padding: 0.3em 0.7em;
  border-radius: 4px;
  border: 1px solid #444;
  background: #181f2a;
  color: #fff;
}
.forum-header button {
  background: #1e90ff;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.3em 1em;
  font-weight: bold;
  cursor: pointer;
}

/* User avatar in top right */
.forum-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-left: 1.5em;
  cursor: pointer;
}
.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2em;
  height: 2.2em;
  border-radius: 50%;
  background: linear-gradient(135deg,#6a4ffd,#b39eff);
  color: #fff;
  font-weight: bold;
  font-size: 1.1em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  border: 2px solid #fff;
  letter-spacing: 0.04em;
}
body.night .user-avatar {
  background: linear-gradient(135deg,#232b3b,#6a4ffd);
  border-color: #232b3b;
}
.user-name {
  color: #fffdc0;
  font-weight: bold;
  font-size: 1em;
  letter-spacing: 0.03em;
}
body.night .user-name {
  color: #7ec8e3;
}

/* --- Breadcrumbs --- */
.forum-breadcrumbs {
  background: #1a2233;
  color: #b0c4de;
  padding: 0.5em 2em;
  font-size: 0.95em;
  border-bottom: 1px solid #223;
}
.forum-breadcrumbs a {
  color: #7ec8e3;
  text-decoration: none;
}
.forum-breadcrumbs a:hover {
  text-decoration: underline;
}

/* --- Forum List Table --- */
.forum-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
body.night .forum-table {
  background: #232b3b;
  color: #e0e6f0;
}
.forum-table th, .forum-table td {
  padding: 1em 0.8em;
  border-bottom: 1px solid #e0e0e0;
  text-align: left;
}
body.night .forum-table th, body.night .forum-table td {
  border-bottom: 1px solid #2a3550;
}
.forum-table th {
  background: #e6f0fa;
  color: #232b3b;
  font-size: 1em;
  font-weight: bold;
}
body.night .forum-table th {
  background: #1a2233;
  color: #7ec8e3;
}
.forum-table tr:hover td {
  background: #f0f8ff;
}
body.night .forum-table tr:hover td {
  background: #1e2a3a;
}
.forum-table .forum-title {
  font-weight: bold;
  color: #1e90ff;
}
body.night .forum-table .forum-title {
  color: #7ec8e3;
}
.forum-table .last-post a {
  color: #1e90ff;
  text-decoration: none;
}
body.night .forum-table .last-post a {
  color: #7ec8e3;
}

/* --- Pagination --- */
.forum-pagination {
  display: flex;
  gap: 0.3em;
  margin: 1em 0 2em 0;
  justify-content: flex-start;
}
.forum-pagination button, .forum-pagination a {
  background: #e6f0fa;
  color: #232b3b;
  border: 1px solid #b0c4de;
  border-radius: 4px;
  padding: 0.3em 0.9em;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.forum-pagination .active, .forum-pagination button:disabled {
  background: #1e90ff;
  color: #fff;
  border-color: #1e90ff;
  cursor: default;
}
.forum-pagination a:hover:not(.active) {
  background: #b0c4de;
  color: #232b3b;
}
body.night .forum-pagination button, body.night .forum-pagination a {
  background: #232b3b;
  color: #7ec8e3;
  border: 1px solid #2a3550;
}
body.night .forum-pagination .active, body.night .forum-pagination button:disabled {
  background: #7ec8e3;
  color: #232b3b;
  border-color: #7ec8e3;
}

/* --- General BG --- */
body {
  background: #0a1a2f url('Images/forum-bg.jpg') repeat-x top center;
  background-size: cover;
}
body.night {
  background: #0a1a2f url('Images/forum-bg.jpg') repeat-x top center;
  background-size: cover;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .forum-header, .forum-breadcrumbs {
    padding: 0.7em 0.5em;
  }
  .forum-table th, .forum-table td {
    padding: 0.7em 0.4em;
  }
}
@media (max-width: 980px) {
  .forum-layout {
    flex-direction: column;
    padding: 1.2rem 1rem 6rem;
  }
  .forum-sidebar { position: static; width: 100%; }
  .post { flex-direction: column; }
  .post-left {
    flex-direction: row;
    width: auto;
    justify-content: flex-start;
    gap: 1rem;
  }
  .user-block { text-align: left; align-items: flex-start; }
}

/* Night mode text balance */
body.night .post-content p,
body.night .reply-box,
body.night .forum-sidebar,
body.night .forum-thread {
  color: #e5e5e5;
}

.toggle-btn {
  position: fixed;
  top: 1em;
  left: 1em;
  background: #444;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.4em 1em;
  font-size: 1.2em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  z-index: 1002;
}
body.day .toggle-btn {
  background: #eee;
  color: #222;
}
.toggle-btn:hover {
  background: #222;
  color: #fff;
  transform: scale(1.08);
}
body.day .toggle-btn:hover {
  background: #ddd;
  color: #222;
  transform: scale(1.08);
}

/* User dropdown styles */
.forum-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-left: 1.5em;
  cursor: pointer;
}
.user-dropdown {
  display: none;
  position: absolute;
  top: 120%;
  right: 0;
  background: #232b3b;
  border: 1px solid #1e90ff;
  border-radius: 8px;
  min-width: 120px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  z-index: 1003;
  padding: 0.5em 0;
}
.user-dropdown a {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 0.5em 1em;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.user-dropdown a:hover {
  background: #1e90ff;
  color: #fff;
}
.forum-user:hover .user-dropdown,
.forum-user:focus-within .user-dropdown {
  display: block;
}