/* ── Forum layout ───────────────────────────────────────── */
.forum-wrap {
  display: flex;
  min-height: calc(100vh - 64px);
  padding-top: 64px;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.forum-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #0d1018;
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}

.forum-sidebar-header {
  padding: 1rem 1rem 0.5rem;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #555;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 0.25rem;
}

.forum-channel-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.75rem;
  margin: 0.1rem 0.5rem;
  border-radius: 6px;
  text-decoration: none;
  color: #666;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}

.forum-channel-link:hover {
  background: rgba(255,255,255,0.05);
  color: #ccc;
}

.forum-channel-link.active {
  background: rgba(212,175,55,0.1);
  color: var(--gold);
}

.forum-channel-icon {
  font-size: 0.95rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.forum-channel-hash {
  color: #444;
  font-size: 1rem;
  margin-right: 1px;
}

.forum-channel-badge {
  margin-left: auto;
  background: rgba(212,175,55,0.15);
  color: var(--gold);
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 700;
}

/* ── Main area ───────────────────────────────────────────── */
.forum-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 900px;
}

/* ── Channel header ──────────────────────────────────────── */
.forum-channel-header {
  position: sticky;
  top: 64px;
  z-index: 10;
  background: rgba(10,12,16,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.forum-channel-header-icon { font-size: 1.2rem; }

.forum-channel-header h1 {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.forum-channel-header p {
  font-size: 0.78rem;
  color: #555;
  margin: 0;
}

.forum-channel-header-sep {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.1);
  margin: 0 0.25rem;
}

/* ── Messages list ───────────────────────────────────────── */
.forum-messages {
  flex: 1;
  padding: 1rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.forum-msg {
  display: flex;
  gap: 1rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  transition: background 0.1s;
  position: relative;
}

.forum-msg:hover {
  background: rgba(255,255,255,0.025);
}

.forum-msg:hover .forum-msg-actions {
  opacity: 1;
  pointer-events: all;
}

.forum-msg.pinned {
  background: rgba(212,175,55,0.04);
  border-left: 2px solid rgba(212,175,55,0.3);
  margin-left: -2px;
}

.forum-msg.deleted .forum-msg-content {
  color: #3a3a3a;
  font-style: italic;
}

/* Avatar */
.forum-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1f2e, #2a2f3e);
  border: 1px solid rgba(212,175,55,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Message body */
.forum-msg-body { flex: 1; min-width: 0; }

.forum-msg-meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
  flex-wrap: wrap;
}

.forum-msg-author {
  font-weight: 700;
  font-size: 0.9rem;
  color: #e0e0e0;
  text-decoration: none;
}

.forum-msg-author:hover { color: var(--gold); }

.forum-msg-time {
  font-size: 0.7rem;
  color: #3a3a3a;
}

.forum-msg-content {
  font-size: 0.88rem;
  color: #bbb;
  line-height: 1.6;
  word-break: break-word;
  white-space: pre-wrap;
}

.forum-msg-content a { color: var(--gold); }

/* Edited tag */
.forum-msg-edited {
  font-size: 0.7rem;
  color: #444;
  margin-left: 4px;
}

/* Quote */
.forum-quote {
  border-left: 3px solid rgba(212,175,55,0.4);
  background: rgba(255,255,255,0.03);
  border-radius: 0 6px 6px 0;
  padding: 0.4rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  color: #666;
}

.forum-quote-author {
  font-weight: 700;
  color: var(--gold);
  opacity: 0.8;
  margin-right: 0.4rem;
}

/* Reactions */
.forum-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.forum-reaction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 0.8rem;
  color: #888;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
}

.forum-reaction:hover,
.forum-reaction.mine {
  background: rgba(212,175,55,0.1);
  border-color: rgba(212,175,55,0.3);
  color: var(--gold);
}

.forum-reaction .count { font-weight: 700; }

/* Actions (hover) */
.forum-msg-actions {
  position: absolute;
  top: -14px;
  right: 12px;
  display: flex;
  gap: 2px;
  background: #10141c;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 3px 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 5;
}

.forum-action-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #666;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  text-decoration: none;
}

.forum-action-btn:hover { background: rgba(255,255,255,0.06); color: #ccc; }
.forum-action-btn.danger:hover { background: rgba(248,113,113,0.1); color: #f87171; }
.forum-action-btn.pin:hover { background: rgba(212,175,55,0.1); color: var(--gold); }

/* Badges */
.forum-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 99px;
  vertical-align: middle;
}

/* Date separator */
.forum-date-sep {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #333;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 1.25rem 0 0.5rem;
}

.forum-date-sep::before,
.forum-date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.05);
}

/* Pin banner */
.forum-pin-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(212,175,55,0.05);
  border: 1px solid rgba(212,175,55,0.12);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0 0;
  font-size: 0.83rem;
  color: #888;
  line-height: 1.5;
}

.forum-pin-icon { color: var(--gold); font-size: 0.9rem; margin-top: 1px; }

/* ── Input area ──────────────────────────────────────────── */
.forum-input-wrap {
  position: sticky;
  bottom: 0;
  background: rgba(10,12,16,0.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 0.85rem 1.5rem 1.1rem;
}

.forum-quote-preview {
  background: rgba(212,175,55,0.06);
  border-left: 3px solid rgba(212,175,55,0.4);
  border-radius: 0 6px 6px 0;
  padding: 0.4rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: #666;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forum-textarea-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: #10141c;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  transition: border-color 0.2s;
}

.forum-textarea-row:focus-within {
  border-color: rgba(212,175,55,0.3);
}

.forum-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ccc;
  font-family: 'Raleway', sans-serif;
  font-size: 0.88rem;
  resize: none;
  min-height: 38px;
  max-height: 160px;
  line-height: 1.5;
  padding: 0.3rem 0;
}

.forum-textarea::placeholder { color: #3a3a3a; }

.forum-emoji-bar {
  display: flex;
  gap: 2px;
}

.forum-emoji-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.forum-emoji-btn:hover { background: rgba(255,255,255,0.06); }

.forum-send-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: var(--gold);
  color: #000;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.forum-send-btn:hover { background: var(--gold-light); transform: scale(1.05); }
.forum-send-btn:disabled { background: #222; color: #444; cursor: not-allowed; transform: none; }

/* Readonly notice */
.forum-readonly-notice {
  text-align: center;
  font-size: 0.82rem;
  color: #444;
  padding: 0.75rem;
}

/* ── Index page ──────────────────────────────────────────── */
.forum-index-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.forum-index-channel {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 0.5rem;
}

.forum-index-channel:hover {
  border-color: rgba(212,175,55,0.25);
  background: rgba(212,175,55,0.03);
}

.forum-index-icon {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.forum-index-info { flex: 1; min-width: 0; }

.forum-index-name {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #e0e0e0;
  margin-bottom: 0.15rem;
}

.forum-index-desc {
  font-size: 0.78rem;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forum-index-meta {
  text-align: right;
  font-size: 0.72rem;
  color: #444;
  flex-shrink: 0;
}

.forum-index-count {
  font-size: 1.1rem;
  font-weight: 700;
  color: #666;
  display: block;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .forum-sidebar { display: none; }
  .forum-channel-header { padding: 0.75rem 1rem; }
  .forum-messages { padding: 0.75rem 1rem 5rem; }
  .forum-input-wrap { padding: 0.65rem 1rem 0.85rem; }
}
