/* SOSANA Premium Community Sidebar & Layout Styles */
:root {
  --bg-main: #f9f9fb;
  --bg-sidebar: #fdfdfd;
  --bg-header: #ffffff;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --sidebar-item-color: #545861;
  --border-color: #e5e7eb;
  --accent-color: #506cf0;
  --accent-light: #f0f3f5;
  --hover-bg: #f3f4f6;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
}

body.logged-in {
  background-color: var(--bg-main) !important;
  color: var(--text-primary);
  font-family: InterVariable, system-ui, "Apple Color Emoji", "Segoe UI Emoji",
  "Segoe UI Symbol", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  overflow-x: hidden;
}

/* ── HEADER OVERRIDES (Logged In) ── */
body.logged-in #main-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: none;
}

body.logged-in #main-nav .nav-logo img {
  height: 28px !important;
}

body.logged-in .nav-links {
  display: flex !important;
  gap: 2px;
  margin: 0 auto;
}

body.logged-in .nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 99px;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

body.logged-in .nav-links a:hover,
body.logged-in .nav-links a.active {
  background: var(--hover-bg);
  color: var(--text-primary);
}

body.logged-in .nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-icon {
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
}
.nav-icon:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.avatar-top {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #2544e9;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
}

/* ── SEARCH BAR ── */
.nav-search {
  display: flex;
  align-items: center;
  background: var(--hover-bg);
  border-radius: 99px;
  padding: 5px 10px;
}
.nav-search input {
  background: none;
  border: none;
  outline: none;
  padding-left: 6px;
  font-size: 12px;
  width: 120px;
  color: var(--text-primary);
}

/* ── LAYOUT SHELL ── */
.community-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: calc(100vh - 56px);
  width: 100%;
}

/* ── SIDEBAR ── */
.community-sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 24px 21px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  /* thin scrollbar — visible on hover/scroll */
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

/* Webkit thin scrollbar */
.community-sidebar::-webkit-scrollbar {
  width: 4px;
}
.community-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.community-sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 4px;
  transition: background 0.2s;
}
.community-sidebar:hover::-webkit-scrollbar-thumb {
  background: #d1d5db;
}

.sidebar-group {
  margin-bottom: 24px;
  gap: 6px;
  display: flex;
  flex-direction: column;
}
.sidebar-group-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding-left: 10px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  color: var(--sidebar-item-color);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.15s;
  margin-bottom: 1px;
  line-height: 1.3;
}
.sidebar-item:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}
.sidebar-item.active {
  background: var(--accent-light);
  /* color: var(--accent-color); */
}
.sidebar-icon {
  width: 16px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  font-size: 13px;
  color: inherit;
}

/* ── MAIN CONTENT ── */
.community-main {
  background: var(--bg-main);
  overflow-y: auto;
  flex: 1;
}

.community-main-inner {
  /* max-width: 860px; */
  margin: 0 auto;
  /* padding: 24px 24px; */
}

/* ── FEED CARDS ── */
.card-feed {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ddd;
  flex-shrink: 0;
}
.post-author {
  font-weight: 600;
  font-size: 13px;
}
.post-badge {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 6px;
}
.post-time {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 6px;
}
.post-space {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
  margin-top: 1px;
}

.post-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}
.post-content {
  font-size: 13px;
  color: #374151;
  line-height: 1.6;
}

.post-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}
.post-action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.post-action-btn:hover {
  color: var(--accent-color);
}
.chat-messages{
  background: url("https://staging.community.sosana.io/assets/imgs/SOSANA Custom Background - Blue - Light Doodle.png");
  background-repeat: no-repeat;
  background-size: cover;
}
.space-send-btn{
  background: none;
  color: var(--text-secondary);
  border: none;
}

/* ── POST CARD (shared component) ───────────────────────── */
.post-card {
  background: white;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s;
}
.post-card:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,0.06);
}

/* Text truncation */
.pc-text.pc-truncated {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Icon buttons in post header / footer */
.pc-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  padding: 5px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pc-icon-btn:hover { background: #f3f4f6; color: #111827; }

.pc-foot-btn {
  transition: background 0.15s, color 0.15s;
  border-radius: 8px;
}
.pc-foot-btn:hover { background: #f3f4f6; color: #111827; }
.pc-like-btn:hover { color: #ef4444 !important; }

/* Dropdown */
.pc-dropdown.hidden { display: none !important; }

/* ── POST COMPOSER enhancements ─────────────────────────── */
.pm-action-btn {
  background: none;
  border: none;
  font-size: 17px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s;
  outline: none;
}
.pm-action-btn:hover { background: var(--hover-bg); color: var(--text-primary); }
.pm-action-btn.active { color: var(--accent-color); background: rgba(80,108,240,0.08); }

/* ── 3-dot dropdown menu items ──────────────────────────────────── */
.pc-menu-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 9px 16px;
    background: none; border: none; cursor: pointer;
    font-size: 14px; font-weight: 500; color: #374151;
    text-align: left; transition: background 0.12s;
    white-space: nowrap;
}
.pc-menu-item:hover { background: #f9fafb; }
.pc-menu-item i { width: 16px; text-align: center; color: #6b7280; font-size: 14px; }
.pc-menu-item.danger { color: #dc2626; }
.pc-menu-item.danger i { color: #dc2626; }
.pc-menu-divider { border: none; border-top: 1px solid #f3f4f6; margin: 4px 0; }

/* ── Toggle switch (for pin/hide flags) ─────────────────────────── */
.pc-menu-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 9px 16px;
    background: none; border: none; cursor: pointer;
    font-size: 14px; font-weight: 500; color: #374151;
    transition: background 0.12s;
}
.pc-menu-toggle:hover { background: #f9fafb; }
.pc-menu-toggle span:first-child { display: flex; align-items: center; gap: 10px; }
.pc-menu-toggle i { width: 16px; text-align: center; color: #6b7280; font-size: 14px; }

.toggle-sw {
    width: 34px; height: 20px; border-radius: 100px;
    background: #d1d5db; flex-shrink: 0; position: relative;
    transition: background 0.2s;
}
.toggle-sw::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 14px; height: 14px; border-radius: 50%; background: white;
    transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-sw.on { background: #2544e9; }
.toggle-sw.on::after { transform: translateX(14px); }

/* ── Comment modal spinner ──────────────────────────────────────── */
.cm-loading { display: flex; align-items: center; gap: 12px; padding: 40px 20px; color: #9ca3af; font-size: 14px; }
.cm-spinner {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid #e5e7eb; border-top-color: #2544e9;
    animation: cm-spin 0.7s linear infinite; flex-shrink: 0;
}
@keyframes cm-spin { to { transform: rotate(360deg); } }

/* ── GIF picker loading spinner ─────────────────────────────────── */
#gif-results .cm-spinner { margin: auto; }