/* ── Forum Base ── */
.content-area { min-height: 60vh; padding: 2rem 0; }
.page-header { text-align: center; padding: 2rem 1rem 2.5rem; position: relative; }
.page-header::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 60px; height: 2px; background: linear-gradient(90deg,transparent,#6c5ce7,transparent); }
.gradient-text { background: linear-gradient(135deg,#00e5ff,#a855f7,#ff6b6b); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.text-muted { color: #888; max-width: 500px; margin: 0.5rem auto 0; font-size: 0.9rem; }

/* ── Category List ── */
.forum-categories { max-width: 900px; margin: 0 auto; padding: 0 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.cat-row {
  background: rgba(20,20,40,0.6); backdrop-filter: blur(6px); border: 1px solid rgba(108,92,231,0.2); border-radius: 16px; padding: 1rem 1.2rem;
  display: flex; align-items: center; gap: 1rem; cursor: pointer; transition: all 0.25s;
}
.cat-row:hover { border-color: #6c5ce7; box-shadow: 0 6px 20px rgba(108,92,231,0.18); transform: translateY(-2px); }
.cat-icon { font-size: 1.5rem; flex-shrink: 0; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: rgba(108,92,231,0.1); border-radius: 12px; }
.cat-info { flex: 1; min-width: 0; }
.cat-info h4 { margin: 0 0 0.2rem; color: #a0eaff; font-size: 0.95rem; }
.cat-meta { color: #888; font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-stats { display: flex; gap: 0.4rem; font-size: 0.72rem; color: #888; flex-shrink: 0; }
.cat-stats span { background: rgba(108,92,231,0.06); padding: 0.2rem 0.6rem; border-radius: 20px; white-space: nowrap; }

/* ── Topics Page ── */
.topics-header { text-align: center; margin-bottom: 1.5rem; }
.topics-header h1 { font-size: 1.4rem; margin: 0; }
.topics-header p { color: #888; font-size: 0.85rem; margin: 0.3rem 0 0; }
.filter-bar { display: flex; gap: 0.8rem; margin-bottom: 1.5rem; align-items: center; flex-wrap: wrap; max-width: 900px; margin-left: auto; margin-right: auto; padding: 0 1rem; }
.filter-bar .form-control { background: rgba(20,20,40,0.75); border: 1px solid rgba(108,92,231,0.3); color: #e0e0e0; border-radius: 60px; padding: 0.65rem 1rem; flex: 1; min-width: 150px; transition: all 0.2s; }
.filter-bar .form-control:focus { border-color: #6c5ce7; box-shadow: 0 0 12px rgba(108,92,231,0.3); outline: none; }
#topics-list { max-width: 900px; margin: 0 auto; padding: 0 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.topic-row {
  background: rgba(20,20,40,0.6); backdrop-filter: blur(6px); border: 1px solid rgba(108,92,231,0.2); border-radius: 16px; padding: 1rem 1.2rem;
  display: flex; align-items: center; gap: 1rem; cursor: pointer; transition: all 0.25s;
}
.topic-row:hover { border-color: #6c5ce7; box-shadow: 0 6px 20px rgba(108,92,231,0.18); transform: translateY(-2px); }
.topic-row.pinned { border-color: rgba(243,156,18,0.4); background: rgba(243,156,18,0.05); }
.topic-icon { font-size: 1.3rem; flex-shrink: 0; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: rgba(108,92,231,0.1); border-radius: 12px; }
.topic-info { flex: 1; min-width: 0; }
.topic-info h4 { margin: 0 0 0.25rem; color: #fff; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-meta { display: flex; gap: 0.8rem; font-size: 0.75rem; color: #888; flex-wrap: wrap; }
.topic-meta span { display: flex; align-items: center; gap: 0.2rem; }
.topic-stats { display: flex; gap: 0.4rem; font-size: 0.72rem; color: #888; flex-shrink: 0; }
.topic-stats span { background: rgba(108,92,231,0.06); padding: 0.2rem 0.6rem; border-radius: 20px; white-space: nowrap; }

/* ── Topic Detail ── */
#topic-container { max-width: 900px; margin: 0 auto; padding: 0 1rem; }
.topic-header { margin-bottom: 1.5rem; }
.topic-header h1 { margin: 0.8rem 0; font-size: 1.4rem; color: #fff; }
.topic-meta-bar { display: flex; gap: 1.2rem; color: #999; font-size: 0.82rem; flex-wrap: wrap; align-items: center; }
.topic-meta-bar span { display: flex; align-items: center; gap: 0.3rem; }

/* ── Post badges (Question / Answer) ── */
.post-badge { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.8rem; border-radius: 20px; margin-bottom: 0.8rem; width: fit-content; }
.post-badge-q { background: linear-gradient(135deg,rgba(108,92,231,0.2),rgba(108,92,231,0.08)); color: #c8bfff; border: 1px solid rgba(108,92,231,0.4); font-size: 0.78rem; padding: 0.25rem 1rem; }

/* ── First post (question) ── */
.topic-first-post {
  background: linear-gradient(135deg,rgba(108,92,231,0.08),rgba(20,20,40,0.7)); backdrop-filter: blur(6px);
  border: 1px solid rgba(108,92,231,0.4); border-radius: 16px; padding: 1.4rem; margin-bottom: 1rem;
  border-left: 5px solid #6c5ce7; box-shadow: 0 0 30px rgba(108,92,231,0.08);
  transition: border-color 0.2s;
}

/* ── Reply posts ── */
.forum-post {
  background: rgba(20,20,40,0.45); backdrop-filter: blur(6px); border: 1px solid rgba(108,92,231,0.12); border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 0.7rem;
  border-left: 3px solid rgba(108,92,231,0.15); transition: all 0.2s;
}
.forum-post:hover { border-color: rgba(108,92,231,0.25); }
.forum-post .post-badge { background: rgba(0,229,255,0.08); color: #00e5ff; border: 1px solid rgba(0,229,255,0.2); }

/* ── Admin reply ── */
.post-admin { background: linear-gradient(135deg,rgba(243,156,18,0.06),rgba(20,20,40,0.6)); border-color: rgba(243,156,18,0.25); border-left-color: #f39c12; }
.post-admin:hover { border-color: rgba(243,156,18,0.4); }
.post-admin .post-badge { background: rgba(243,156,18,0.1); color: #f39c12; border-color: rgba(243,156,18,0.25); }

.post-author { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.8rem; padding-bottom: 0.8rem; border-bottom: 1px solid rgba(108,92,231,0.1); }
.post-avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #2d2d44; display: flex; align-items: center; justify-content: center; }
.post-avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-avatar-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.admin-badge { background: linear-gradient(135deg,#f39c12,#e67e22); color: #fff; font-size: 0.62rem; padding: 0.15rem 0.5rem; border-radius: 4px; margin-left: 0.4rem; vertical-align: middle; font-weight: 600; }
.post-content { color: #ccc; line-height: 1.9; font-size: 0.88rem; }
.topic-posts { margin-top: 1.5rem; }
.topic-posts h3 { color: #a0eaff; margin-bottom: 1rem; font-size: 1rem; display: flex; align-items: center; gap: 0.4rem; }

/* ── Reply Form ── */
.reply-form { max-width: 900px; margin: 1.5rem auto; padding: 0 1rem; }
.reply-form h3 { color: #a0eaff; margin-bottom: 0.8rem; font-size: 1rem; }
.reply-form textarea { background: rgba(20,20,40,0.7); border: 1px solid rgba(108,92,231,0.3); color: #e0e0e0; border-radius: 16px; padding: 0.8rem; resize: vertical; width: 100%; margin-bottom: 0.8rem; min-height: 100px; font-family: inherit; transition: border-color 0.2s; }
.reply-form textarea:focus { border-color: #6c5ce7; box-shadow: 0 0 12px rgba(108,92,231,0.2); outline: none; }
.reply-form textarea::placeholder { color: #666; }

/* ── New Topic Modal ── */
.modal, .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.75); backdrop-filter: blur(8px); z-index: 10000; display: none; justify-content: center; align-items: center; padding: 1rem; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-content, .modal-box { background: #1a1a2e; border-radius: 24px; width: 100%; max-width: 520px; padding: 1.8rem; border: 1px solid rgba(108,92,231,0.3); box-shadow: 0 30px 50px rgba(0,0,0,0.4); max-height: 90vh; overflow-y: auto; animation: slideUp 0.25s ease; }
.modal-box h2, .modal-content h2 { color: #a0eaff; margin: 0 0 1.2rem; text-align: center; font-size: 1.1rem; }
.close-modal, .close-btn { float: right; font-size: 1.5rem; cursor: pointer; color: #666; background: none; border: none; line-height: 1; transition: color 0.2s; padding: 0; }
.close-modal:hover, .close-btn:hover { color: #fff; }
.modal-content .form-group { margin-bottom: 1rem; }
.modal-content .form-group label { display: block; font-size: 0.82rem; color: #999; margin-bottom: 0.3rem; }
.modal-content .form-control { background: rgba(255,255,255,0.05); border: 1px solid rgba(108,92,231,0.3); border-radius: 12px; padding: 0.7rem 1rem; color: #eee; width: 100%; transition: border-color 0.2s; font-family: inherit; }
.modal-content .form-control:focus { outline: none; border-color: #a29bfe; box-shadow: 0 0 10px rgba(108,92,231,0.15); }
.modal-content .form-control::placeholder { color: #555; }
.modal-actions { display: flex; gap: 0.8rem; justify-content: flex-end; margin-top: 1.2rem; }

/* ── Empty / Loading state ── */
.empty-state { text-align: center; padding: 4rem 1rem; color: #666; }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state p { font-size: 0.9rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .page-header { padding: 1.5rem 1rem; }
  .cat-row, .topic-row { padding: 0.8rem 1rem; flex-wrap: wrap; }
  .cat-stats, .topic-stats { gap: 0.3rem; }
  .filter-bar { flex-direction: column; }
  .filter-bar .form-control { width: 100%; }
  .post-author { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .cat-icon { width: 38px; height: 38px; font-size: 1.2rem; }
  .topic-icon { width: 34px; height: 34px; font-size: 1rem; }
  .modal-content, .modal-box { padding: 1.2rem; }
  .topic-header h1 { font-size: 1.15rem; }
}
