body {
  font-family: Arial, sans-serif;
  background: #f4f4f4;
  padding: 40px;
}

    body {
      font-family: Arial, sans-serif;
      background: #f4f4f4;
      padding: 40px;
    }

    .container {
      max-width: 800px;
      margin: auto;
      background: white;
      padding: 30px;
      border-radius: 12px;
      box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    h2 {
      margin-bottom: 10px;
      color: #007BFF;
    }

    .meta {
      color: #777;
      font-size: 0.9em;
      margin-bottom: 30px;
    }

    .content {
      font-size: 1.1em;
      margin-bottom: 40px;
      white-space: pre-wrap;
    }

    .reply-form textarea {
      width: 100%;
      padding: 10px;
      border-radius: 5px;
      border: 1px solid #ccc;
      resize: vertical;
      font-family: inherit;
      font-size: 1em;
      margin-bottom: 12px;
    }

    .reply-form button {
      padding: 12px 24px;
      background: #007BFF;
      color: white;
      border: none;
      border-radius: 8px;
      font-size: 1em;
      cursor: pointer;
    }

    .reply-form button:hover {
      background: #005dc1;
    }

    .reply {
      background: #fff;
      border-left: 4px solid #007BFF;
      padding: 15px 20px;
      border-radius: 10px;
      margin-bottom: 20px;
      box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
      animation: fadeInUp 0.3s ease forwards;
    }

    @keyframes fadeInUp {
      0% {
        opacity: 0;
        transform: translateY(10px);
      }
      100% {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .reply-header-with-icon {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .profile-icon {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background-color: #007bff;
      color: white;
      font-weight: bold;
      font-size: 1rem;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 0 2px rgba(0,0,0,0.2);
    }

    .reply-meta {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .username-badge {
      font-weight: bold;
      color: #007BFF;
    }

    .timestamp {
      font-style: italic;
      color: #999;
    }

    .reply-text {
      font-size: 1.05em;
      line-height: 1.5;
      white-space: pre-wrap;
    }

    .role-badge {
      font-size: 0.75rem;
      padding: 2px 6px;
      margin-left: 0px;
      border-radius: 6px;
      font-weight: 600;
      background-color: #ddd;
      color: #333;
      display: inline-block;
    }

    .role-badge.Member {
      background-color: #e2e8f0;
      color: #1a202c;
    }

    .role-badge.Admin {
      background-color: #dc2626;
      color: white;
      box-shadow: 0 0 4px #dc2626;
    }

    .role-badge.Moderator {
      background-color: #2563eb;
      color: white;
    }

    .role-badge.Founder {
      background-color: #9333ea;
      color: white;
      box-shadow: 0 0 4px #9333ea;
    }

    @media (max-width: 600px) {
      .container {
        padding: 15px;
      }
    }
    .user-tooltip {
      position: absolute;
      z-index: 9999;
      background-color: #fff;
      color: #333;
      border: 1px solid #ccc;
      padding: 8px 12px;
      border-radius: 6px;
      box-shadow: 0 4px 8px rgba(0,0,0,0.15);
      max-width: 250px;
      font-size: 0.85rem;
      pointer-events: none;
      transition: opacity 0.15s ease;
    }

    .user-tooltip.hidden {
      opacity: 0;
      visibility: hidden;
    }

    .user-tooltip.visible {
      opacity: 1;
      visibility: visible;
    }
  
    /* Category Cards Grid */
.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Individual Card Styling */
.category-card {
  background-color: white;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 0 10px rgba(0,0,0,0.06);
  transition: background-color 0.2s ease;
  display: block;
  text-decoration: none;
  color: inherit;
}

.category-card:hover {
  background-color: #f3f4f6; /* tailwind's gray-100 */
}

.category-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

.category-card p {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Login CTA Section */
.login-reminder {
  text-align: center;
  margin-top: 2.5rem;
  font-size: 0.95rem;
}

/* Optional emoji margin */
.login-reminder .emoji {
  margin-right: 0.25rem;
}

/* Styled Login Button */
.login-btn {
  display: inline-block;
  background-color: #2563eb; /* Tailwind blue-600 */
  color: white;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  border-radius: 0.5rem;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.login-btn:hover {
  background-color: #1d4ed8; /* Tailwind blue-700 */
  color: white; /* Ensure white text stays on hover */
  transform: translateY(-1px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.08);
}


.start-thread-button {
  display: inline-block;
  margin-bottom: 2rem;
  background-color: #0087ff;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.2s ease;
}
.start-thread-button:hover {
  background-color: #005fcc;
}

.start-thread-container {
  text-align: center;
  margin-top: 1rem;
}


.reaction-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px 0;
}
.reaction-bar .react-btn {
  border: 1px solid #ddd; padding: 4px 8px; border-radius: 8px; cursor: pointer;
  background: #fff; font-size: 14px;
}
.reaction-bar .react-btn.active {
  border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}
.reaction-bar .react-btn:disabled { opacity: .5; cursor: not-allowed; }
.reaction-bar .count { margin-left: 4px; font-weight: 600; }


/* === Phase 13: Reactions UI polish === */
.reaction-bar{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:6px 0 12px 0;
  align-items:center;
}

.reaction-bar .react-btn{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:4px 8px;
  border:1px solid #e5e7eb;          /* light gray */
  background:#fff;
  border-radius:10px;
  font-size:14px;
  line-height:1;
  cursor:pointer;
  transition:transform .02s ease, box-shadow .12s ease, border-color .12s ease;
}

.reaction-bar .react-btn:hover:not(:disabled){
  transform:translateY(-1px);
  box-shadow:0 1px 6px rgba(0,0,0,.06);
}

.reaction-bar .react-btn:disabled{
  opacity:.55;
  cursor:not-allowed;
}

.reaction-bar .react-btn.active{
  border-color:#3b82f6;               /* blue-500 */
  box-shadow:0 0 0 2px rgba(59,130,246,.15);
  font-weight:600;
}

.reaction-bar .count{
  margin-left:2px;
  font-weight:600;
  min-width:0;                         /* avoid layout jumps */
}

/* Hide the count span when empty (we already set empty text in JS) */
.reaction-bar .count:empty{
  display:none;
}

/* Thread header spacing tweak on small screens */
@media (max-width:600px){
  #thread-reactions-mount{ margin-top:6px; }
  .reaction-bar .react-btn{ padding:4px 7px; font-size:13px; }
}


/* === Category list: compact reaction counts === */
.reaction-counts{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:6px;
  align-items:center;
}

.reaction-counts .rc-pill{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:2px 6px;
  border:1px solid #e5e7eb;
  background:#fff;
  border-radius:999px;
  font-size:13px;
  line-height:1;
  pointer-events:none; /* read-only; no clicks */
}

.reaction-counts .rc-pill .n{
  font-weight:600;
}


.live-chat-button{
  display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:999px;
  font-weight:600;background:#fff;border:1px solid #e7e8f3;text-decoration:none;color:#111827;
  box-shadow:0 1px 2px rgba(16,24,40,.06);transition:transform .15s, box-shadow .15s;
  margin-left:8px;
}
.live-chat-button:hover{ transform:translateY(-1px); box-shadow:0 8px 24px rgba(99,102,241,.18); }

/* ===== Forum Quick Actions (CTAs) ===== */
.forum-actions{
  max-width:1100px;
  margin:16px auto 14px;
  padding:0 12px;
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:flex-end;            /* right on desktop */
}
@media (max-width: 640px){
  .forum-actions{ justify-content:center; }  /* center on mobile */
}

/* CTA button base */
.cta{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 14px;
  border-radius:999px;
  font-weight:600;
  text-decoration:none;
  line-height:1;
  border:1px solid #e5e7eb;
  background:#ffffff;
  color:#0f172a;
  box-shadow:0 2px 10px rgba(0,0,0,.06);
  transition:transform .06s ease, box-shadow .12s ease, background-color .12s ease;
}
.cta:hover{ transform:translateY(-1px); box-shadow:0 6px 18px rgba(0,0,0,.10); }
.cta:active{ transform:translateY(0); box-shadow:0 2px 10px rgba(0,0,0,.06); }
.cta:focus-visible{ outline:3px solid #93c5fd; outline-offset:2px; }

.cta--primary{
  background:#0f172a;                  /* dark pill for prominence */
  color:#fff;
  border-color:#0f172a;
}
.cta--primary:hover{ background:#111827; }

.cta--ghost{
  background:#f8fafc;                  /* subtle pill */
  color:#0f172a;
  border-color:#e5e7eb;
}
.cta--ghost:hover{ background:#f1f5f9; }

.cta__icon{ width:18px; height:18px; display:block; }

/* Mobile floating action button (chat) */
.chat-fab{
  display:none;
  position:fixed;
  right:16px;
  bottom:16px;
  width:56px;
  height:56px;
  border-radius:999px;
  background:#0f172a;
  color:#fff;
  font-size:26px;
  line-height:56px;
  text-align:center;
  box-shadow:0 12px 28px rgba(0,0,0,.22);
  z-index:999;
}
.chat-fab:focus-visible{ outline:3px solid #93c5fd; outline-offset:2px; }
@media (max-width: 640px){
  .chat-fab{ display:inline-block; }
}

/* (Optional) Once this ships everywhere, you can delete old .live-chat-button styles */


/* Tighter spacing + wrap on narrow screens */
.forum-actions{
  gap:10px;
  flex-wrap:wrap;
  margin:12px auto 8px;
}

/* Slightly crisper pills */
.cta{ padding:10px 16px; }
.cta__icon{ width:18px; height:18px; }

/* Icon-only pills on very small phones */
@media (max-width: 420px){
  .cta__label{ display:none; }
  .cta{ padding:10px; }
}

/* Optional: make the actions bar stick under the header.
   Add class 'sticky' to the <nav class="forum-actions sticky"> in HTML if you want this. */
.forum-actions.sticky{
  position: sticky;
  top: 72px;              /* adjust if your header height changes */
  z-index: 40;
  justify-content: center;
  background: rgba(248,250,252,.85);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 8px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(0,0,0,.08);
}

/* ===== Quick Actions: Side Rail (unobtrusive) ===== */
.forum-rail{
  position: fixed;
  right: 14px;
  top: 50vh;                 /* vertically centered */
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 60;
  pointer-events: none;      /* only buttons catch clicks */
}
.forum-rail .rail-btn{
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  max-width: 44px;           /* compact bubble by default */
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
  overflow: hidden;
  white-space: nowrap;
  transition: max-width .18s ease, background-color .12s ease, box-shadow .12s ease, transform .06s ease;
}
.forum-rail .rail-btn:hover{
  max-width: 220px;          /* expand to reveal label */
  transform: translateX(-2px);
}
.forum-rail .rail-ico{
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 20px;
}
.forum-rail .rail-label{
  opacity: 0;
  width: 0;
  margin-left: 0;
  transition: opacity .12s ease .05s, width .12s ease .05s, margin-left .12s ease .05s;
}
.forum-rail .rail-btn:hover .rail-label{
  opacity: 1;
  width: auto;
  margin-left: 6px;
}

/* Variants */
.rail-btn--primary{
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}
.rail-btn--primary:hover{ background:#111827; }
.rail-btn--ghost{
  background: #ffffff;
  color: #0f172a;
  border-color: #e5e7eb;
}
.rail-btn--ghost:hover{ background:#f8fafc; }

/* Don’t show the rail on small screens; use your chat-fab there */
@media (max-width: 768px){
  .forum-rail{ display: none; }
}

/* Motion-safe fallback */
@media (prefers-reduced-motion: reduce){
  .forum-rail .rail-btn{ transition: none; }
  .forum-rail .rail-label{ display: none; }
}

/* --- FIX: ensure white text inside the dark rail pill --- */
.forum-rail .rail-btn--primary,
.forum-rail .rail-btn--primary .rail-label,
.forum-rail .rail-btn--primary .rail-ico { 
  color: #fff !important;               /* beat global link styles */
}

/* keep icons white even if an SVG has its own fill */
.forum-rail .rail-btn--primary svg { fill: currentColor !important; }

/* visited links must stay white too */
.forum-rail .rail-btn--primary:visited { color: #fff !important; }

