/* ════════════════════════════════
   COMMUNITY FEED — Facebook Style
════════════════════════════════ */

/* Compact nav: feed sticky sidebar adjusts */
body.compact-nav .feed-left { top: 78px; }

.feed-layout {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 1.5rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem;
  align-items: start;
}

/* ── LEFT SIDEBAR ── */
.feed-left {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.feed-user-card {
  background: var(--bg3);
  border: 1px solid var(--b1);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: 0.2s;
}
.feed-user-card:hover { border-color: var(--b2); }
.feed-av {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: #fff; flex-shrink: 0;
}
.feed-uname { font-weight: 700; font-size: 0.92rem; }
.feed-urole { font-size: 0.72rem; color: var(--purple); }
.feed-sidebar-nav { list-style: none; background: var(--bg3); border: 1px solid var(--b1); border-radius: var(--radius-lg); overflow: hidden; }
.feed-sidebar-nav li a {
  display: flex; align-items: center; gap: 10px;
  padding: 0.75rem 1.1rem;
  font-size: 0.86rem; font-weight: 500; color: var(--t2);
  text-decoration: none; cursor: pointer; transition: 0.2s;
  border-bottom: 1px solid var(--b1);
}
.feed-sidebar-nav li:last-child a { border-bottom: none; }
.feed-sidebar-nav li a:hover,
.feed-sidebar-nav li a.active { color: var(--blue); background: var(--ab); }
.feed-sidebar-nav li a span { font-size: 1.1rem; width: 22px; text-align: center; }

/* ── CENTER FEED ── */
.feed-center { display: flex; flex-direction: column; gap: 1.25rem; }

/* Create Post Box */
.create-post-box {
  background: var(--bg3);
  border: 1px solid var(--b1);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
}
.create-post-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.75rem;
}
.create-post-input {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--b1);
  border-radius: 24px;
  padding: 0.68rem 1.1rem;
  color: var(--t2);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: 0.2s;
}
.create-post-input:hover { border-color: var(--b2); color: var(--t1); }
.create-post-actions {
  display: flex;
  border-top: 1px solid var(--b1);
  padding-top: 0.75rem;
  gap: 0;
}
.post-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--t2);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: 0.2s;
}
.post-action-btn:hover { background: var(--ab); color: var(--blue); }
.post-action-btn .icon { font-size: 1.1rem; }

/* Post Composer Modal */
.post-composer {
  display: none;
  background: var(--bg3);
  border: 1px solid var(--b1);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 0.75rem;
}
.post-composer.open { display: block; animation: pageIn 0.25s ease; }
.post-type-tabs {
  display: flex; gap: 4px; margin-bottom: 1rem;
  background: var(--bg2); border: 1px solid var(--b1);
  border-radius: 8px; padding: 3px;
}
.post-type-tab {
  flex: 1; padding: 0.45rem; border: none;
  border-radius: 6px; font-family: var(--font-body); font-size: 0.82rem;
  font-weight: 600; cursor: pointer; background: transparent; color: var(--t3); transition: 0.2s;
}
.post-type-tab.active { background: linear-gradient(135deg, var(--violet), var(--blue)); color: #fff; }
.post-textarea {
  width: 100%; background: var(--bg2); border: 1px solid var(--b1);
  border-radius: 10px; padding: 0.85rem 1rem; color: var(--t1);
  font-family: var(--font-body); font-size: 0.93rem; outline: none;
  resize: vertical; min-height: 100px; transition: 0.2s;
}
.post-textarea:focus { border-color: var(--b2); }
.post-media-preview {
  display: none;
  background: var(--bg2);
  border: 1px dashed var(--b2);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  margin-top: 0.75rem;
  cursor: pointer;
  transition: 0.2s;
}
.post-media-preview:hover { background: var(--ab); }
.post-media-preview.has-media { border-style: solid; }
.post-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.85rem; }
.post-media-btns { display: flex; gap: 6px; }
.media-btn {
  background: transparent; border: 1px solid var(--b1);
  border-radius: 8px; padding: 0.38rem 0.75rem;
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 600;
  color: var(--t2); cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 5px;
}
.media-btn:hover { border-color: var(--b2); color: var(--blue); }
.hidden-file-input { display: none; }

/* Post Card */
.post-card {
  background: var(--bg3);
  border: 1px solid var(--b1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: 0.2s;
}
.post-card:hover { border-color: var(--b2); }
.post-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 1.1rem 1.1rem 0;
}
.post-author-av {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.88rem; color: #fff;
  flex-shrink: 0;
}
.post-author-name {
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.post-author-name:hover { color: var(--blue); }
.post-author-role { font-size: 0.7rem; color: var(--purple); }
.post-time { font-size: 0.68rem; color: var(--t3); }
.post-more {
  margin-left: auto;
  background: transparent; border: none;
  color: var(--t3); cursor: pointer; font-size: 1.2rem;
  padding: 0.2rem 0.4rem; border-radius: 4px; transition: 0.2s;
}
.post-more:hover { color: var(--t1); background: var(--bg2); }

/* Admin badge on post */
.admin-post-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  color: #fff; font-size: 0.62rem; font-weight: 700;
  padding: 2px 8px; border-radius: 2rem; letter-spacing: 0.5px;
  margin-left: 6px;
}
/* User earned badges on posts */
.user-badge-pill {
  display: inline-flex; align-items: center;
  font-size: 0.62rem; font-weight: 700;
  padding: 2px 8px; border-radius: 2rem;
  margin-left: 4px; letter-spacing: 0.3px;
}
/* Post text character counter */
.post-char-counter {
  font-size: 0.72rem; color: var(--t3); text-align: right;
  padding: 0 0.25rem 0.35rem;
}
.post-char-counter.warn { color: var(--gold); }
.post-char-counter.over { color: var(--red); font-weight: 700; }

.post-text {
  padding: 0.85rem 1.1rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--t1);
}
.post-media { width: 100%; }
.post-media img,
.post-media video {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  display: block;
}
.post-media-placeholder {
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  flex-direction: column;
  gap: 0.5rem;
}
.post-media-placeholder span { font-size: 0.82rem; color: var(--t2); font-size: 0.78rem; }

/* Reactions row */
.post-reactions-bar {
  display: flex;
  align-items: center;
  padding: 0.5rem 1.1rem;
  gap: 8px;
  border-bottom: 1px solid var(--b1);
}
.reaction-summary {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--t3);
  flex: 1;
}
.reaction-icons { display: flex; gap: -4px; }
.reaction-icon { font-size: 1rem; }
.comment-count { font-size: 0.78rem; color: var(--t3); cursor: pointer; }
.comment-count:hover { color: var(--blue); }

/* Action buttons */
.post-actions {
  display: flex;
  border-bottom: 1px solid var(--b1);
}
.post-act-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: transparent; border: none;
  color: var(--t2); font-family: var(--font-body); font-size: 0.83rem; font-weight: 600;
  cursor: pointer; padding: 0.65rem; border-radius: 0; transition: 0.2s;
}
.post-act-btn:hover { background: var(--ab); color: var(--blue); }
.post-act-btn.liked { color: var(--pink); }
.post-act-btn .act-icon { font-size: 1.1rem; }

/* Reaction picker */
.reaction-picker {
  display: none;
  position: absolute;
  background: var(--bg3);
  border: 1px solid var(--b1);
  border-radius: 2rem;
  padding: 0.4rem 0.75rem;
  gap: 8px;
  box-shadow: var(--shadow);
  bottom: 50px; left: 0;
  z-index: 10;
  flex-wrap: nowrap;
}
.reaction-picker.show { display: flex; animation: pageIn 0.2s ease; }
.reaction-opt {
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: 0.15s;
  line-height: 1;
}
.reaction-opt:hover { transform: scale(1.35); }
.post-act-wrap { position: relative; flex: 1; }

/* Comments Section */
.comments-section { display: none; padding: 0.85rem 1.1rem; }
.comments-section.open { display: block; }
.comment-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1rem;
}
.comment-input-wrap { flex: 1; position: relative; }
.comment-input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--b1);
  border-radius: 20px;
  padding: 0.55rem 2.5rem 0.55rem 1rem;
  color: var(--t1);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  transition: 0.2s;
}
.comment-input:focus { border-color: var(--b2); }
.comment-send-btn {
  position: absolute; right: 8px; top: 50%;
  transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer;
  color: var(--blue); font-size: 0.95rem; padding: 0;
}
.comment {
  display: flex;
  gap: 8px;
  margin-bottom: 0.85rem;
}
.comment-av {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.78rem; color: #fff; flex-shrink: 0;
}
.comment-bubble {
  background: var(--bg2);
  border: 1px solid var(--b1);
  border-radius: 4px 14px 14px 14px;
  padding: 0.6rem 0.85rem;
  flex: 1;
}
.comment-author { font-weight: 700; font-size: 0.82rem; margin-bottom: 0.2rem; }

/* Admin comment highlight */
.comment-bubble.admin-comment {
  background: rgba(139,92,246,.08);
  border-color: rgba(139,92,246,.25);
}
.comment-text { font-size: 0.84rem; color: var(--t2); line-height: 1.55; }
.comment-actions { display: flex; gap: 10px; margin-top: 0.35rem; }
.comment-act { background: transparent; border: none; font-size: 0.72rem; color: var(--t3); cursor: pointer; font-family: var(--font-body); transition: 0.15s; }
.comment-act:hover { color: var(--blue); }

/* ── RIGHT SIDEBAR ── */
.feed-right {
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-widget {
  background: var(--bg3);
  border: 1px solid var(--b1);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
}
.widget-title {
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 0.85rem;
}
.active-users-list { display: flex; flex-direction: column; gap: 0.65rem; }
.active-user {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; transition: 0.2s; padding: 0.35rem 0.5rem; border-radius: 8px;
}
.active-user:hover { background: var(--ab); }
.active-user-av {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.78rem; color: #fff; flex-shrink: 0;
  position: relative;
}
.active-user-dot {
  position: absolute; bottom: 0; right: 0;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green); border: 2px solid var(--bg3);
}
.active-user-name { font-size: 0.82rem; font-weight: 600; }
.active-user-status { font-size: 0.7rem; color: var(--t3); }

/* Trending posts */
.trending-item { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 0.75rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--b1); }
.trending-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.trending-num { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; color: var(--t3); min-width: 20px; margin-top: 2px; }
.trending-text { font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: 0.15s; }
.trending-text:hover { color: var(--blue); }
.trending-count { font-size: 0.7rem; color: var(--t3); margin-top: 2px; }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .feed-layout { grid-template-columns: 240px 1fr; }
  .feed-right { display: none; }
}
@media (max-width: 768px) {
  .feed-layout { grid-template-columns: 1fr; padding: 1rem; gap: 1rem; }
  .feed-left { position: static; }
  .feed-user-card { padding: 0.8rem; }
  .feed-sidebar-nav { padding: 0.5rem; }
  .feed-sidebar-nav li a { padding: 0.5rem 0.75rem; font-size: 0.85rem; }
  .create-post-box { padding: 0.9rem; }
  .post-card { padding: 0.85rem; }
  .post-author-name { font-size: 0.9rem; }
}
@media (max-width: 480px) {
  .feed-layout { padding: 0.75rem; gap: 0.75rem; }
  .feed-left { display: none; }
  .post-action-btn span.icon { display: none; }
}

/* ── LIGHT THEME FEED OVERRIDES ── */
body.light-theme .post-card     { background: #fff; border-color: rgba(0,0,150,.1); }
body.light-theme .create-post-box { background: #fff; border-color: rgba(0,0,150,.1); }
body.light-theme .feed-user-card  { background: var(--bg2); }
body.light-theme .feed-sidebar-nav { background: #fff; border-color: rgba(0,0,150,.1); }
body.light-theme .feed-sidebar-nav li a { color: var(--t2); }
body.light-theme .feed-sidebar-nav li a:hover,
body.light-theme .feed-sidebar-nav li a.active { background: var(--bg2); color: var(--t1); }
body.light-theme .sidebar-widget { background: #fff; border-color: rgba(0,0,150,.1); }
body.light-theme .comment-bubble { background: var(--bg2); }
body.light-theme .comment-input  { background: var(--bg2); color: var(--t1); border-color: var(--b1); }
body.light-theme .post-textarea  { background: var(--bg2); color: var(--t1); }
body.light-theme .post-char-counter { color: var(--t3); }
body.light-theme .post-char-counter.warn { color: #d97706; }
body.light-theme .post-char-counter.over { color: #dc2626; }
body.light-theme .post-composer  { background: #fff; border-color: rgba(0,0,150,.1); }
body.light-theme .media-btn      { background: var(--bg2); color: var(--t2); }
body.light-theme .create-post-input { background: var(--bg2); color: var(--t2); border-color: var(--b1); }
body.light-theme .post-act-btn   { color: var(--t2); }
body.light-theme .post-act-btn:hover { background: var(--bg2); }
