/* ===== Community Page ===== */
.community-page { min-height: 100vh; background: var(--bg); }

.nav-active { color: var(--text) !important; font-weight: 600; }

.community-main { padding-top: 72px; }

.community-hero {
  background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,92,246,0.08));
  border-bottom: 1px solid var(--border);
  padding: 40px 0 32px;
  text-align: center;
}

.community-hero h1 {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 900;
  margin-bottom: 8px;
}

.community-hero p { color: var(--text-muted); font-size: 15px; }
.community-hero .hero-hindi {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 14px;
  color: #c4b5fd;
  margin-top: 8px;
}

/* Layout */
.community-layout {
  display: grid;
  grid-template-columns: 240px 1fr 260px;
  gap: 24px;
  padding: 32px 24px 60px;
  align-items: start;
}

.comm-sidebar { position: sticky; top: 88px; }

.sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.sidebar-box h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
}

/* Category Filters */
.cat-filters { display: flex; flex-direction: column; gap: 6px; }

.cat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.2s;
}

.cat-btn:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.cat-btn.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
}

.join-cta-box p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.btn-sm { padding: 8px 16px; font-size: 13px; }

/* User Bar */
.user-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
}

.user-bar.hidden { display: none; }

.user-avatar, .create-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.create-avatar { width: 40px; height: 40px; font-size: 14px; }

.user-info { flex: 1; }
.user-info strong { display: block; font-size: 14px; }
.user-info span { font-size: 12px; color: var(--text-muted); }

/* Create Post */
.create-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 24px;
  transition: border-color 0.3s;
}

.create-post-card:focus-within { border-color: rgba(139, 92, 246, 0.4); }

.create-post-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.create-trigger {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 12px 18px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.create-trigger:hover {
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--text);
}

.create-form.hidden, .guest-prompt.hidden { display: none; }

.create-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.create-form .form-group {
  margin-bottom: 12px;
}

.create-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.create-form select {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}

.create-form textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 100px;
  margin-bottom: 12px;
}

.create-form textarea:focus, .create-form select:focus {
  outline: none;
  border-color: var(--purple);
}

.create-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.char-count { font-size: 12px; color: var(--text-muted); }

.guest-prompt {
  margin-top: 14px;
  padding: 12px;
  background: rgba(139, 92, 246, 0.08);
  border-radius: 8px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.guest-prompt a { color: #a78bfa; font-weight: 600; text-decoration: none; }
.guest-prompt a:hover { text-decoration: underline; }

/* Feed Header */
.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.feed-header h2 { font-size: 18px; font-weight: 800; }

.sort-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

/* Post Card */
.posts-feed { display: flex; flex-direction: column; gap: 16px; }

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.3s ease;
  animation: postIn 0.4s ease;
}

@keyframes postIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-card:hover {
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.post-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
}

.post-meta { flex: 1; min-width: 0; }
.post-meta strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}
.post-meta span {
  font-size: 12px;
  color: var(--text-muted);
}

.post-cat-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  white-space: nowrap;
}

.post-cat-badge.career { background: rgba(59,130,246,0.15); color: #93c5fd; }
.post-cat-badge.study { background: rgba(34,197,94,0.15); color: #86efac; }
.post-cat-badge.mental { background: rgba(168,85,247,0.15); color: #d8b4fe; }
.post-cat-badge.success { background: rgba(234,179,8,0.15); color: #fde047; }
.post-cat-badge.ask { background: rgba(249,115,22,0.15); color: #fdba74; }
.post-cat-badge.startup { background: rgba(20,184,166,0.15); color: #5eead4; }

.post-body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.action-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.action-btn.liked {
  color: #f472b6;
}

.action-btn.liked span:first-child { animation: heartPop 0.3s ease; }

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.empty-feed {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-feed.hidden { display: none; }
.empty-feed span { font-size: 48px; display: block; margin-bottom: 12px; }

/* Right Sidebar */
.stats-box {
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.comm-stat strong {
  display: block;
  font-size: 18px;
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.comm-stat span { font-size: 10px; color: var(--text-muted); }

.trending-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trending-tags .tag {
  font-size: 11px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.trending-tags .tag:hover {
  border-color: var(--purple);
  color: #c4b5fd;
}

.active-users {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.active-users li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.active-users .au-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.active-users .au-name { flex: 1; font-weight: 500; }
.active-users .au-posts { font-size: 11px; color: var(--text-muted); }

.quote-box {
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.06);
}

.quote-box p {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 13px;
  color: #f0abfc;
  font-weight: 600;
  line-height: 1.6;
}

/* Comment Modal */
.comment-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  padding: 20px;
}

.comment-modal.active { display: flex; }

.comment-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.comment-modal-content h3 {
  font-size: 18px;
  margin-bottom: 16px;
}

.modal-post-preview {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
  border-left: 3px solid var(--purple);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  max-height: 240px;
  overflow-y: auto;
}

.comment-item {
  display: flex;
  gap: 10px;
  font-size: 13px;
}

.comment-item .c-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.comment-item .c-body strong { display: block; font-size: 12px; margin-bottom: 2px; }
.comment-item .c-body p { color: var(--text-muted); line-height: 1.4; }

.add-comment {
  display: flex;
  gap: 8px;
}

.add-comment input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}

.add-comment input:focus {
  outline: none;
  border-color: var(--purple);
}

/* Homepage Community Preview */
.community-preview {
  padding: 80px 0;
  background: rgba(99, 102, 241, 0.04);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.community-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
}

.preview-post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.3s;
}

.preview-post:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.3);
}

.preview-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.preview-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}

.preview-post-header strong { font-size: 13px; }
.preview-post-header span { font-size: 11px; color: var(--text-muted); display: block; }

.preview-post p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.preview-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.community-cta {
  text-align: center;
  margin-top: 32px;
}

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 1100px) {
  .community-layout {
    grid-template-columns: 1fr;
  }
  .left-sidebar { order: 2; }
  .right-sidebar { order: 3; }
  .feed-column { order: 1; }
  .comm-sidebar { position: static; }
  .cat-filters { flex-direction: row; flex-wrap: wrap; }
  .community-preview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .post-actions { flex-wrap: wrap; }
  .community-hero { padding: 28px 0 24px; }
}
