/* ==========================================================================
   Community Forums — MyBB-Grade Layout, Postbit, Polls & ModCP Styles
   ========================================================================== */

.forum-subnav {
  background: rgba(18, 18, 26, 0.94);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.6rem 0;
  margin-bottom: 1.75rem;
}

.forum-subnav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.forum-subnav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.forum-subnav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.36rem 0.72rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}
.forum-subnav-link:hover,
.forum-subnav-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
}
.forum-subnav-link.active {
  color: var(--accent-gold);
  border-color: var(--border-gold);
}
.forum-subnav-modcp {
  color: var(--accent-gold);
  background: rgba(201, 168, 76, 0.1);
  border-color: var(--border-gold);
}

.forum-announcement {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
  background: linear-gradient(90deg, rgba(201, 168, 76, 0.12) 0%, rgba(22, 19, 30, 0.85) 100%);
  border: 1px solid var(--border-gold);
  border-left: 3px solid var(--accent-gold);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.forum-rules-box {
  padding: 1rem 1.25rem;
  background: rgba(26, 22, 37, 0.7);
  border: 1px solid var(--border-medium);
  border-left: 3px solid var(--accent-violet-light);
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.forum-unread-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.65);
  flex-shrink: 0;
}
.forum-read-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

/* MyBB Category & Thread Table Rows */
.forum-cat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 250px;
  gap: 1.25rem;
  align-items: center;
}

.forum-thread-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.forum-thread-row.soft-deleted {
  opacity: 0.62;
  border-left: 3px solid var(--danger-bright);
}
.forum-thread-row.unapproved {
  border-left: 3px solid var(--warning);
}

/* Postbit & Thread View */
.post-card {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 1.5rem;
}
.post-card.soft-deleted {
  opacity: 0.68;
  border-left: 3px solid var(--danger-bright);
}
.post-card.unapproved {
  border-left: 3px solid var(--warning);
}

.postbit-aside {
  border-right: 1px solid var(--border-subtle);
  padding-right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.postbit-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.78rem;
}

.online-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #48545c;
  flex-shrink: 0;
}
.online-indicator.online {
  background: #7aa37a;
  box-shadow: 0 0 6px rgba(122, 163, 122, 0.7);
}

.warning-meter {
  margin-top: 0.25rem;
  padding: 0.35rem 0.5rem;
  background: rgba(139, 37, 0, 0.14);
  border: 1px solid rgba(196, 67, 35, 0.3);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #e89b84;
}

/* Polls */
.poll-box {
  background: linear-gradient(160deg, rgba(22, 19, 30, 0.92), rgba(14, 13, 20, 0.96));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.5rem;
}
.poll-option-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.35rem;
}
.poll-option-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold-deep), var(--accent-gold-bright));
  border-radius: 999px;
}

/* Star Rating Bar */
.star-rate-group {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}
.star-rate-btn {
  background: none;
  border: none;
  padding: 0.15rem;
  cursor: pointer;
  color: var(--text-faint);
  font-size: 1rem;
  line-height: 1;
}
.star-rate-btn.filled,
.star-rate-btn:hover {
  color: var(--accent-gold-bright);
}

/* Inline Moderation Floating Bar */
.inline-mod-bar {
  position: sticky;
  bottom: 1rem;
  z-index: 500;
  margin-top: 1.25rem;
  padding: 0.85rem 1.2rem;
  background: rgba(18, 16, 26, 0.97);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.inline-mod-bar.visible {
  display: flex;
}

/* ModCP Shell */
.modcp-shell {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.modcp-sidebar {
  background: var(--bg-obsidian);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 0.75rem;
  position: sticky;
  top: calc(var(--nav-height) + 1rem);
}
.modcp-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.52rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  margin-bottom: 0.15rem;
}
.modcp-nav-link:hover,
.modcp-nav-link.active {
  background: var(--bg-elevated);
  color: var(--accent-gold);
}

/* Modal Dialog */
.forum-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 10, 0.78);
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.forum-modal-backdrop.open {
  display: flex;
}
.forum-modal {
  width: 100%;
  max-width: 480px;
  background: var(--bg-obsidian);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
}

@media (max-width: 900px) {
  .forum-cat-row {
    grid-template-columns: 1fr;
  }
  .post-card {
    grid-template-columns: 1fr;
  }
  .postbit-aside {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding-right: 0;
    padding-bottom: 0.9rem;
  }
  .modcp-shell {
    grid-template-columns: 1fr;
  }
  .modcp-sidebar {
    position: static;
  }
}
