/* Forum styles */
.forum-wrap { max-width: 1100px; margin: 30px auto; padding: 0 20px; color: #e9f2ff; }

/* Hero */
.forum-hero {
  background: linear-gradient(135deg, rgba(255,121,242,0.12), rgba(107,247,255,0.10));
  border: 1px solid rgba(107,247,255,0.25);
  border-radius: 22px;
  padding: 26px 28px;
  margin-bottom: 28px;
  box-shadow: 0 16px 50px rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.forum-hero-inner h2 {
  font-family: 'Montserrat', sans-serif;
  color: #ff79f2;
  letter-spacing: 0.06em;
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}
.forum-hero-inner p { color: #c5d4ee; margin: 0; line-height: 1.5; }
.forum-cta-btn {
  background: linear-gradient(135deg, #ff79f2, #6bf7ff);
  color: #1a0a30;
  border: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s;
}
.forum-cta-btn:hover { transform: translateY(-2px); }
.forum-cta-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Categories */
.forum-categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 36px; }
.category-card {
  display: flex; align-items: center; gap: 14px;
  background: rgba(13,18,34,0.92);
  border: 1px solid rgba(107,247,255,0.18);
  border-radius: 16px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.category-card:hover { transform: translateY(-2px); border-color: rgba(255,121,242,0.4); box-shadow: 0 10px 32px rgba(255,121,242,0.15); }
.cat-icon { font-size: 2rem; flex-shrink: 0; }
.cat-meta { flex: 1; min-width: 0; }
.cat-name { font-weight: 800; color: #e9f2ff; font-size: 1.05rem; }
.cat-desc { color: #c5d4ee; font-size: 0.88rem; margin: 4px 0 6px; line-height: 1.4; }
.cat-last { font-size: 0.82rem; color: #93a3c4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-last .dim { color: #6b7799; }
.cat-stat { text-align: center; flex-shrink: 0; }
.cat-stat b { display: block; color: #6bf7ff; font-size: 1.4rem; font-weight: 800; line-height: 1; }
.cat-stat span { color: #93a3c4; font-size: 0.78rem; }

/* Recent threads */
.recent-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.recent-header h3 { font-family: 'Montserrat', sans-serif; color: #6bf7ff; margin: 0; letter-spacing: 0.05em; font-size: 1.3rem; }
.sort-tabs { display: flex; flex-direction: row; gap: 8px; flex-wrap: wrap; align-items: center; }
.sort-tabs button {
  display: inline-flex; align-items: center;
  width: auto !important;
  flex: 0 0 auto;
  background: transparent; color: #c5d4ee;
  border: 1px solid rgba(107,247,255,0.3);
  padding: 6px 14px; border-radius: 999px;
  font-size: 0.88rem; cursor: pointer; font-weight: 600;
  transition: all .15s; white-space: nowrap;
}
.sort-tabs button:hover { border-color: #6bf7ff; }
.sort-tabs button.is-active { background: linear-gradient(135deg, #ff79f2, #6bf7ff); color: #1a0a30; border-color: transparent; font-weight: 800; }

.thread-row {
  display: flex; align-items: center; gap: 14px;
  background: rgba(13,18,34,0.85);
  border: 1px solid rgba(107,247,255,0.15);
  border-radius: 12px;
  padding: 14px 18px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 10px;
  transition: border-color .15s, background .15s;
}
.thread-row:hover { border-color: rgba(255,121,242,0.4); background: rgba(13,18,34,0.95); }
.thread-row-main { flex: 1; min-width: 0; }
.thread-row-title { font-weight: 700; color: #e9f2ff; font-size: 1rem; margin-bottom: 4px; }
.thread-row-meta { color: #93a3c4; font-size: 0.85rem; }
.thread-row-meta b { color: #6bf7ff; font-weight: 700; }
.thread-row-meta em { color: #ff79f2; font-style: normal; }
.thread-row-stats { display: flex; gap: 14px; color: #c5d4ee; font-size: 0.88rem; flex-shrink: 0; }
.thread-row-stats .stat { white-space: nowrap; }
.thread-row-stats .dim { color: #6b7799; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 0.72rem; font-weight: 700; margin-left: 6px; vertical-align: middle; }
.badge.pin { background: rgba(255,121,242,0.18); color: #ff79f2; }
.badge.lock { background: rgba(150,150,150,0.18); color: #c5d4ee; }
.badge.ann { background: rgba(255,215,0,0.18); color: #ffd700; }
.badge.poll { background: rgba(107,247,255,0.18); color: #6bf7ff; }

.loader, .empty-state { text-align: center; padding: 36px 20px; color: #93a3c4; font-style: italic; }

/* Modal */
.forum-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.forum-modal[hidden] { display: none; }
.forum-modal-card {
  background: #14182b;
  border: 1px solid rgba(107,247,255,0.3);
  border-radius: 20px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.forum-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid rgba(107,247,255,0.15); }
.forum-modal-header h3 { margin: 0; color: #ff79f2; font-family: 'Montserrat', sans-serif; }
.forum-modal-close { background: none; border: none; color: #e9f2ff; font-size: 1.8rem; cursor: pointer; line-height: 1; padding: 0 6px; }
.forum-modal-close:hover { color: #ff79f2; }
.forum-modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 4px; }
.forum-label { color: #c5d4ee; font-weight: 600; font-size: 0.92rem; margin: 10px 0 4px; }
.forum-input {
  width: 100%; box-sizing: border-box;
  background: rgba(8,12,26,0.7);
  color: #e9f2ff;
  border: 1.5px solid rgba(107,247,255,0.3);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  font-family: inherit;
  transition: border-color .15s;
  margin-bottom: 6px;
}
.forum-input:focus { border-color: #6bf7ff; }
.forum-textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.forum-poll-section { margin-top: 12px; background: rgba(107,247,255,0.05); border: 1px dashed rgba(107,247,255,0.25); border-radius: 12px; padding: 12px 14px; }
.forum-poll-section summary { cursor: pointer; color: #6bf7ff; font-weight: 700; }
.forum-mini-btn { background: transparent; border: 1.5px solid rgba(107,247,255,0.4); color: #6bf7ff; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 0.85rem; }
.forum-mini-btn:hover { background: rgba(107,247,255,0.1); }
.forum-modal-footer { padding: 16px 22px 20px; display: flex; justify-content: flex-end; }

/* Thread view */
.thread-wrap { max-width: 900px; margin: 30px auto; padding: 0 20px; color: #e9f2ff; }
.thread-head {
  background: rgba(13,18,34,0.92);
  border: 1px solid rgba(107,247,255,0.25);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
}
.thread-title {
  font-family: 'Montserrat', sans-serif;
  color: #e9f2ff;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  margin: 0 0 10px;
}
.thread-author-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 0.92rem; color: #93a3c4; }
.thread-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #ff79f2, #6bf7ff); color: #1a0a30; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.9rem; overflow: hidden; flex-shrink: 0; }
.thread-avatar img { width: 100%; height: 100%; object-fit: cover; }
.thread-author-row a { color: #6bf7ff; font-weight: 700; text-decoration: none; }
.thread-body { color: #e9f2ff; line-height: 1.7; white-space: pre-wrap; word-wrap: break-word; }
.thread-actions { margin-top: 16px; display: flex; flex-direction: row; gap: 10px; flex-wrap: wrap; align-items: center; }
.thread-like-btn, .thread-share-btn, .thread-admin-btn, .thread-delete-btn {
  display: inline-flex; align-items: center;
  width: auto !important;
  flex: 0 0 auto;
  background: transparent; color: #c5d4ee;
  border: 1.5px solid rgba(107,247,255,0.3);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.thread-like-btn.is-liked, .thread-like-btn:hover { border-color: #ff79f2; color: #ff79f2; }
.thread-share-btn:hover { border-color: #6bf7ff; color: #6bf7ff; }
.thread-admin-btn:hover { border-color: #ffd700; color: #ffd700; }
.thread-delete-btn:hover { border-color: #ff6b6b; color: #ff6b6b; }

/* Poll inside thread */
.poll-box {
  margin-top: 16px;
  background: rgba(107,247,255,0.08);
  border: 1px solid rgba(107,247,255,0.3);
  border-radius: 14px;
  padding: 16px;
}
.poll-question { font-weight: 800; color: #6bf7ff; margin-bottom: 12px; }
.poll-option {
  display: block; width: 100%; box-sizing: border-box;
  background: rgba(13,18,34,0.6);
  border: 1.5px solid rgba(107,247,255,0.25);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  color: #e9f2ff;
  position: relative;
  overflow: hidden;
  text-align: left;
  font-family: inherit;
}
.poll-option:hover { border-color: #ff79f2; }
.poll-option.is-voted { border-color: #ff79f2; color: #ff79f2; font-weight: 700; }
.poll-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,121,242,0.18); border-radius: 12px; transition: width .35s ease-out; }
.poll-text { position: relative; display: flex; justify-content: space-between; gap: 10px; z-index: 1; }
.poll-count { color: #93a3c4; font-weight: 700; }
.poll-total { color: #93a3c4; font-size: 0.85rem; text-align: right; margin-top: 6px; }

/* Replies */
.replies-section h3 { font-family: 'Montserrat', sans-serif; color: #6bf7ff; margin: 20px 0 14px; letter-spacing: 0.04em; }
.reply-card {
  background: rgba(13,18,34,0.85);
  border: 1px solid rgba(107,247,255,0.15);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 10px;
}
.reply-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 0.88rem; color: #93a3c4; }
.reply-body { color: #e9f2ff; line-height: 1.65; white-space: pre-wrap; word-wrap: break-word; }
.reply-actions { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.reply-like-btn, .reply-delete-btn {
  background: transparent; color: #c5d4ee;
  border: 1px solid rgba(107,247,255,0.25);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
}
.reply-like-btn.is-liked, .reply-like-btn:hover { border-color: #ff79f2; color: #ff79f2; }
.reply-delete-btn:hover { border-color: #ff6b6b; color: #ff6b6b; }

.reply-compose { margin-top: 22px; }
.reply-compose textarea {
  width: 100%; box-sizing: border-box;
  background: rgba(8,12,26,0.7);
  color: #e9f2ff;
  border: 1.5px solid rgba(107,247,255,0.3);
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  min-height: 90px;
  outline: none;
}
.reply-compose textarea:focus { border-color: #6bf7ff; }
.reply-compose .compose-row { display: flex; justify-content: flex-end; margin-top: 8px; }

.thread-locked-notice {
  background: rgba(150,150,150,0.1);
  border: 1px solid rgba(150,150,150,0.25);
  color: #c5d4ee;
  padding: 14px;
  border-radius: 12px;
  text-align: center;
  font-style: italic;
}

@media (max-width: 720px) {
  .forum-hero { flex-direction: column; align-items: stretch; text-align: left; }
  .thread-row-stats { font-size: 0.78rem; gap: 8px; }
}
