/* ============================================================
   FORUM CSS — Collabv.Abril
   Completamente isolado: todos os selectores prefixados com
   .forum-* ou escopos específicos do fórum.
   ============================================================ */

/* ── Layout principal com sidebar ─────────────────────────────── */
.forum-layout {
  display: flex;
  gap: 2rem;
  min-height: calc(100vh - 120px);
  padding: 1.5rem;
  background: #f8f9fa;
  margin: -1rem;
  padding: 1.5rem;
}

.forum-sidebar {
  flex-shrink: 0;
  width: 280px;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  height: fit-content;
  position: sticky;
  top: 90px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.forum-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.forum-sidebar-header h3 {
  margin: 0;
  font-size: 1rem;
  flex: 1;
}

.forum-categories-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.forum-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: #f8f9fa;
  border-left: 3px solid transparent;
  border-radius: 0.375rem;
  color: #495057;
  text-decoration: none;
  transition: all 0.15s;
  font-size: 0.9rem;
  font-weight: 500;
}

.forum-nav-item:hover {
  background: #e9ecef;
  color: #212529;
}

.forum-nav-item.active {
  background: #e9f5ff;
  border-left-color: #0d6efd;
  color: #0d6efd;
}

.forum-nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.forum-category-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.forum-topics-section {
  margin-bottom: 1rem;
}

/* Breadcrumb compacto */
.breadcrumb-sm {
  padding: 0.5rem 0;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.breadcrumb-sm .breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  padding: 0 0.5rem;
}

/* ── Chips de categoria (filtro rápido, estilo feed dinâmico) ──── */
.forum-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.forum-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #dee2e6;
  color: #495057;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: all 0.15s ease;
}

.forum-chip:hover {
  border-color: #0d6efd;
  color: #0d6efd;
  background: #f0f5ff;
}

.forum-chip.active {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}

.forum-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.35rem;
  margin-left: 0.4rem;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  font-size: 0.72rem;
  font-weight: 600;
}

.forum-chip.active .forum-chip-count {
  background: rgba(255, 255, 255, 0.25);
}

.forum-home-header p {
  margin: 0.5rem 0 0 0;
  font-size: 0.95rem;
}

.forum-categories-detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.forum-category-detail-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.forum-category-detail-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  border-color: #0d6efd;
}

.forum-category-detail-card.premium-category {
  background: linear-gradient(90deg, #fffdf0 0%, #fff 100%);
  border-left: 4px solid #ffc107;
}

.category-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.category-detail-icon {
  width: 50px;
  height: 50px;
  border-radius: 0.5rem;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #0d6efd;
  flex-shrink: 0;
}

.category-detail-info {
  flex: 1;
  min-width: 0;
}

.category-detail-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #212529;
}

.category-detail-desc {
  margin: 0.4rem 0 0 0;
  font-size: 0.85rem;
  color: #6c757d;
}

.category-detail-stats {
  display: flex;
  gap: 2rem;
  padding: 1rem 0;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
}

.stat-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 100px;
}

.stat-num {
  font-weight: 700;
  font-size: 1.3rem;
  color: #212529;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-col.last-topic {
  flex: 1;
  min-width: 250px;
}

.stat-col.last-topic a {
  color: #0d6efd;
  font-size: 0.9rem;
  font-weight: 500;
}

.stat-col.last-topic a:hover {
  text-decoration: underline;
}

.category-detail-action {
  display: flex;
  justify-content: flex-end;
}

.forum-nav-stats {
  display: flex;
  gap: 0.3rem;
  margin-left: auto;
}

.forum-nav-stats .badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
}

/* ── Categorias (index) ─────────────────────────────────────── */
.forum-categories {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.forum-category-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s;
}

.forum-category-card:last-child { border-bottom: none; }
.forum-category-card:hover      { background: #f8f9ff; }

.forum-category-card.premium-category {
  background: linear-gradient(90deg, #fffdf0 0%, #fff 100%);
  border-left: 3px solid #ffc107;
}

.forum-category-icon {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #0d6efd;
  flex-shrink: 0;
}

.premium-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.6rem;
  color: #ffc107;
}

.forum-category-title {
  font-weight: 600;
  font-size: 1rem;
  color: #212529;
  text-decoration: none;
}
.forum-category-title:hover { color: #0d6efd; }

.forum-category-desc {
  font-size: 0.82rem;
  color: #6c757d;
  margin: 0;
}

.forum-last-activity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
  margin-top: 0.3rem;
}

.forum-last-topic-link {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

.forum-category-stats {
  display: flex;
  gap: 1.5rem;
  flex-shrink: 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 55px;
}
.stat-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: #212529;
}
.stat-label {
  font-size: 0.72rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.forum-category-arrow { flex-shrink: 0; }

/* ── Ícone grande da categoria ──────────────────────────────── */
.forum-cat-icon-lg {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #0d6efd;
  flex-shrink: 0;
}

/* ── Lista de tópicos Discourse Style ─────────────────────── */
.discourse-topic-list {
  display: flex;
  flex-direction: column;
  background: #fff;
}

/* ── Topic Row Discourse style (category listing) ─────────────── */
.discourse-topic-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  transition: background 0.15s;
  color: inherit;
}

.discourse-topic-row:last-child {
  border-bottom: none;
}

.discourse-topic-row:hover {
  background: #f8f9ff;
}

.discourse-topic-row.pinned {
  background: linear-gradient(90deg, #fffef0 0%, #fff 100%);
}

/* Status column esquerda (pin icon) */
.topic-status-column {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  flex-shrink: 0;
  color: #ffc107;
  font-size: 0.9rem;
}

.topic-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Coluna principal (título + meta) */
.topic-main-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.topic-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.topic-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #212529;
  word-break: break-word;
  line-height: 1.3;
}

.discourse-topic-row:hover .topic-title {
  color: #0d6efd;
}

.topic-status-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topic-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.4rem;
  background: #e9ecef;
  border-radius: 10px;
  font-size: 0.6rem;
  font-weight: 600;
  white-space: nowrap;
}

.topic-status-badge.solved {
  background: #d1e7dd;
  color: #156534;
}

.topic-status-badge.locked {
  background: #e2e3e5;
  color: #495057;
}

.topic-meta-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: #6c757d;
}

.small-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d6efd, #0b5ed7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.6rem;
  flex-shrink: 0;
}

.author-name {
  font-weight: 500;
  color: #495057;
  font-size: 0.75rem;
}

.separator {
  color: #dee2e6;
  font-size: 0.65rem;
}

.author-date {
  color: #adb5bd;
  font-size: 0.75rem;
}

/* Coluna de estatísticas */
.topic-stats-column {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 55px;
}

.stat-value {
  font-weight: 700;
  font-size: 0.85rem;
  color: #212529;
  line-height: 1;
}

.stat-label {
  font-size: 0.6rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-top: 0.1rem;
}

/* Coluna de atividade recente */
.topic-activity-column {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  min-width: 100px;
  flex-shrink: 0;
  text-align: right;
}

.activity-user {
  font-size: 0.75rem;
  font-weight: 500;
  color: #495057;
}

.activity-time {
  font-size: 0.65rem;
  color: #adb5bd;
}

/* Responsividade */
@media (max-width: 1024px) {
  .discourse-topic-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .topic-stats-column {
    width: 100%;
    gap: 1rem;
  }

  .topic-activity-column {
    width: 100%;
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .discourse-topic-row {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .topic-stats-column {
    gap: 0.75rem;
  }

  .topic-activity-column {
    display: none;
  }

  .stat-item {
    min-width: auto;
  }
}

/* ── Posts Discourse Style (topic.html) ─────────────────────── */
.topic-header {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ── Container de posts Discourse ─────────────────────────── */
.forum-posts-discourse {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* ── Post individual Discourse style ──────────────────────── */
.discourse-post {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 0.6rem;
  display: flex;
  gap: 0.6rem;
  transition: all 0.2s ease;
  scroll-margin-top: 80px;
}

.discourse-post:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* Estados do post */
.discourse-post.first-post {
  border: 2px solid #0d6efd;
  background: #f8fbff;
}

.discourse-post.solution-post {
  border-left: 4px solid #198754;
  background: #f8fff9;
}

.discourse-post.my-post {
  border-left: 4px solid #ffc107;
}

/* ── Sidebar esquerda (autor info) ────────────────────────── */
.discourse-sidebar {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.6rem;
  min-width: auto;
  flex-shrink: 0;
}

.discourse-avatar-link {
  text-decoration: none;
  flex-shrink: 0;
}

.discourse-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d6efd, #0b5ed7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.discourse-avatar-link:hover .discourse-avatar {
  transform: scale(1.08);
}

/* Cartão de utilizador */
.discourse-user-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  flex: 1;
}

.discourse-user-name {
  font-weight: 600;
  font-size: 0.8rem;
  color: #212529;
  text-decoration: none;
  transition: color 0.2s;
  line-height: 1.2;
}

.discourse-user-name:hover {
  color: #0d6efd;
}

/* Badges */
.discourse-badge {
  display: inline-block;
  padding: 0.15rem 0.35rem;
  background: #e9ecef;
  border-radius: 8px;
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-right: 0.3rem;
}

.discourse-badge.author-badge {
  background: #0d6efd;
  color: #fff;
}

.discourse-badge.level-badge {
  background: #e9ecef;
  color: #495057;
}

.discourse-badge.level-badge.expert {
  background: #fff3cd;
  color: #856404;
}

.discourse-badge.level-badge.collaborator {
  background: #d1e7dd;
  color: #156534;
}

.discourse-badge.level-badge.participant {
  background: #cfe2ff;
  color: #084298;
}

/* Estatísticas */
.discourse-stats {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.2rem;
  width: 100%;
  flex-wrap: wrap;
}

.discourse-stats .stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-direction: row;
  font-size: 0.7rem;
}

.stat-value {
  font-weight: 700;
  color: #212529;
  line-height: 1;
}

.stat-name {
  font-size: 0.65rem;
  color: #6c757d;
}

/* ── Área de conteúdo (direita) ──────────────────────────── */
.discourse-content-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* Header do post */
.discourse-post-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.7rem;
  color: #6c757d;
}

.post-number-badge {
  display: inline-block;
  padding: 0.12rem 0.3rem;
  background: #f0f0f0;
  border-radius: 3px;
  font-weight: 600;
  color: #495057;
  font-size: 0.65rem;
  min-width: 28px;
  text-align: center;
}

.post-date {
  color: #6c757d;
  font-size: 0.65rem;
}

.post-edited {
  color: #adb5bd;
  font-size: 0.65rem;
  font-style: italic;
}

.solution-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem 0.35rem;
  background: #d1e7dd;
  color: #156534;
  border-radius: 8px;
  font-size: 0.6rem;
  font-weight: 600;
  margin-left: auto;
}

/* Corpo do post */
.discourse-post-body {
  line-height: 1.4;
  font-size: 0.9rem;
  color: #212529;
  word-break: break-word;
  margin: 0.25rem 0;
}

.discourse-post-body p { margin-bottom: 0.2rem; }
.discourse-post-body ul, .discourse-post-body ol {
  margin-bottom: 0.2rem;
  padding-left: 1.25rem;
}
.discourse-post-body li { margin-bottom: 0.1rem; }
.discourse-post-body blockquote {
  border-left: 4px solid #dee2e6;
  padding-left: 1rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  color: #6c757d;
  font-style: italic;
  margin: 0.5rem 0;
  background: #f8f9fa;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
}
.discourse-post-body code {
  background: #f8f9fa;
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-size: 0.88em;
  color: #d63384;
  font-family: monospace;
}
.discourse-post-body pre {
  background: #f8f9fa;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  font-size: 0.85em;
  margin-bottom: 0.5rem;
}
.discourse-post-body pre code {
  background: none;
  color: #495057;
  padding: 0;
}

/* Reações */
.discourse-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.reaction-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.4rem;
  background: #f0f0f0;
  border: 1px solid #dee2e6;
  border-radius: 14px;
  font-size: 0.65rem;
  color: #495057;
  font-weight: 500;
}

/* Footer com ações */
.discourse-post-footer {
  margin-top: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px solid #f0f0f0;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.4rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 3px;
  color: #495057;
  font-size: 0.65rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.action-btn:hover {
  background: #e9ecef;
  border-color: #adb5bd;
  color: #212529;
}

.action-btn.active {
  background: #e9f5ff;
  border-color: #0d6efd;
  color: #0d6efd;
}

.action-btn.danger {
  color: #dc3545;
}

.action-btn.danger:hover {
  background: #f8d7da;
  border-color: #f5c2c7;
  color: #bb2d3b;
}

/* ── Formulário de resposta ──────────────────────────────── */
.reply-form-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.forum-toolbar {
  display: flex;
  gap: 0.25rem;
  padding: 0.35rem 0.5rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-bottom: none;
  border-radius: 0.375rem 0.375rem 0 0;
}

.toolbar-btn {
  padding: 0.25rem 0.5rem;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #495057;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.1s;
}
.toolbar-btn:hover {
  background: #e9ecef;
  border-color: #ced4da;
}

.forum-textarea {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  resize: vertical;
  font-family: inherit;
  font-size: 0.93rem;
  line-height: 1.6;
}

/* ── Notificações ────────────────────────────────────────── */
.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.notif-reply       { background: #cfe2ff; color: #0d6efd; }
.notif-accepted    { background: #d1e7dd; color: #198754; }
.notif-reaction    { background: #f8d7da; color: #dc3545; }

/* ── Perfil de utilizador ────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}
.stat-name {
  font-size: 0.78rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

/* ── Responsividade Layout Home ─────────────────────────────── */
@media (max-width: 1400px) {
  .forum-home-layout {
    gap: 1.5rem;
    padding: 1rem;
  }

  .forum-sidebar-home {
    width: 280px;
    padding: 1rem;
  }

  .forum-home-header {
    padding: 1.5rem;
  }

  .forum-home-header h2 {
    font-size: 1.5rem;
  }

  .category-detail-stats {
    gap: 1.5rem;
  }
}

/* ── Responsividade Layout Sidebar ────────────────────────── */
@media (max-width: 1200px) {
  .forum-layout {
    gap: 1rem;
  }

  .forum-sidebar {
    width: 240px;
    padding: 1rem;
  }

  .forum-nav-item {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
  }

  .forum-home-layout {
    flex-direction: column;
    gap: 1rem;
    height: auto;
  }

  .forum-sidebar-home {
    width: 100%;
    position: static;
    height: auto;
  }

  .forum-sidebar-home .forum-categories-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
  }

  .forum-nav-item {
    flex-direction: row;
    align-items: center;
    padding: 0.6rem 0.8rem;
  }

  .forum-main-content-home {
    height: auto;
  }
}

@media (max-width: 1024px) {
  .forum-layout {
    flex-direction: column;
    gap: 1rem;
  }

  .forum-sidebar {
    width: 100%;
    position: static;
    height: auto;
  }

  .forum-categories-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .forum-nav-item {
    padding: 0.5rem;
    gap: 0.35rem;
  }

  .forum-nav-label {
    font-size: 0.8rem;
  }

  .discourse-post {
    flex-direction: column;
    gap: 1rem;
  }

  .discourse-sidebar {
    width: 100%;
    flex-direction: row;
    align-items: flex-start;
    min-width: auto;
    gap: 0.75rem;
  }

  .discourse-avatar {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .discourse-user-card {
    align-items: flex-start;
    text-align: left;
    width: 100%;
    gap: 0.25rem;
  }

  .discourse-stats {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .discourse-post {
    padding: 1rem;
    gap: 0.75rem;
  }

  .discourse-sidebar {
    flex-direction: row;
    width: 100%;
    min-width: auto;
  }

  .discourse-avatar {
    width: 45px;
    height: 45px;
    font-size: 1rem;
  }

  .post-number-badge {
    min-width: 30px;
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
  }

  .solution-badge {
    margin-left: 0;
  }

  .discourse-post-footer {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
  }

  .post-actions {
    gap: 0.35rem;
  }

  .action-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 575px) {
  .discourse-post {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .discourse-sidebar {
    gap: 0.5rem;
  }

  .discourse-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .discourse-user-name {
    font-size: 0.85rem;
  }

  .discourse-stats {
    width: 100%;
    gap: 0.75rem;
  }

  .stat-value {
    font-size: 0.9rem;
  }

  .stat-name {
    font-size: 0.6rem;
  }

  .discourse-post-body {
    font-size: 0.9rem;
  }

  .post-actions {
    flex-wrap: wrap;
  }

  .action-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
  }

  /* Topic row responsiveness */
  .topic-status-column {
    width: 20px;
  }

  .topic-stats-column {
    gap: 1rem;
  }

  .topic-activity-column {
    display: none;
  }
}

@media (max-width: 920px) {
  .category-detail-stats {
    flex-direction: column;
    gap: 1rem;
  }

  .stat-col.last-topic {
    min-width: auto;
  }

  .forum-home-header {
    padding: 1.25rem;
  }

  .forum-home-header h2 {
    font-size: 1.3rem;
  }

  .forum-category-detail-card {
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  .forum-sidebar {
    width: 100%;
    position: static;
  }

  .forum-sidebar-home {
    margin-bottom: 1rem;
    padding: 1rem;
  }

  .forum-sidebar-home .forum-categories-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.4rem;
  }

  .forum-nav-item {
    padding: 0.5rem;
    gap: 0.35rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    font-size: 0.8rem;
  }

  .forum-nav-label {
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .forum-nav-item i:first-child {
    order: -1;
    font-size: 1rem;
  }

  .forum-nav-item .fa-crown {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.8rem;
  }

  .forum-nav-stats {
    display: none;
  }

  .forum-category-detail-card {
    padding: 1rem;
  }

  .category-detail-header {
    gap: 0.75rem;
  }

  .category-detail-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .category-detail-title {
    font-size: 1rem;
  }

  .category-detail-desc {
    font-size: 0.8rem;
  }

  .category-detail-stats {
    gap: 1rem;
    padding: 0.75rem 0;
  }

  .stat-num {
    font-size: 1.1rem;
  }

  .forum-category-stats { display: none; }
  .forum-category-arrow .btn { padding: 0.25rem 0.6rem; font-size: 0.8rem; }
}

@media (max-width: 575px) {
  .forum-home-layout {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .forum-sidebar {
    padding: 0.75rem;
  }

  .forum-sidebar-home {
    padding: 0.75rem;
  }

  .forum-sidebar-home .forum-categories-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .forum-nav-item {
    padding: 0.4rem;
    font-size: 0.75rem;
    gap: 0.25rem;
  }

  .forum-home-header {
    padding: 1rem;
  }

  .forum-home-header h2 {
    font-size: 1.2rem;
  }

  .forum-home-header p {
    font-size: 0.8rem;
  }

  .forum-category-detail-card {
    padding: 0.75rem;
  }

  .category-detail-icon {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .category-detail-title {
    font-size: 0.9rem;
  }

  .category-detail-desc {
    font-size: 0.75rem;
  }

  .stat-num {
    font-size: 1rem;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  .category-detail-action {
    justify-content: center;
  }

  .category-detail-action .btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
  }

  .post-author-sidebar { width: 50px; }
  .user-avatar { width: 36px; height: 36px; font-size: 1rem; }
  .author-name { font-size: 0.65rem; }
}

@media (max-width: 767px) {
  .forum-post { flex-direction: column; }
  .post-author-sidebar {
    flex-direction: row;
    width: auto;
    align-items: center;
    gap: 0.5rem;
  }
}
