/* ===========================
   Mini Forum — Category Styles
   Filename: assets/forum-category.css
   =========================== */

/* --- This is the Start of forum-hub.css adapted Rules --- */
/* --- Forum — Category specific styles are after line 1792 --- */
/* --- CSS Variables (light) --- */


/* Explicit column placement for legacy columns to avoid accidental flow issues */
@media (min-width: 768px) {
  .thread-row > .col-status{ grid-column: 1 / 2; }
  .thread-row > .col-author{ grid-column: 2 / 3; }
  .thread-row > .col-thread{ grid-column: 3 / 4; }
  .thread-row > .col-category{ grid-column: 4 / 5; }
  .thread-row > .col-replies{ grid-column: 5 / 6; }
  .thread-row > .col-views{ grid-column: 6 / 7; }
  .thread-row > .col-lastpost{ grid-column: 7 / 8; }
  .thread-row > .col-actions{ grid-column: 8 / 9; }

  /* Ensure action column content is centered */
  .thread-row > .col-actions{ justify-content: center; }
}

/* ---------- Share button styles (copied from forum-hub) ---------- */
/* Ensure category pages style the action column and share button the same */
.col-actions{
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-share{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--forum-muted, #6b7280);
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease, transform .06s ease, box-shadow .12s ease;
}
.btn-share .material-icons, .btn-share .icon{
  width: 18px;
  height: 18px;
  display: block;
  font-size: 18px;
  line-height: 1;
}
.btn-share:hover{
  background: color-mix(in oklab, var(--forum-accent, #2563eb) 8%, var(--forum-surface, #fff));
  color: var(--forum-accent, #2563eb);
  transform: translateY(-1px);
}
.btn-share:active{ transform: translateY(0); }
.btn-share:focus-visible{
  outline: none;
  box-shadow: var(--forum-focus, 0 0 0 3px rgba(37, 99, 235, .35));
  border-color: transparent;
}

@media (max-width: 1023px){
  .btn-share{ width: 36px; height: 36px; }
}

/* small helper for screen-reader-only labels if not defined globally */
.sr-only{ position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

/* ---------- End share button styles ---------- */

/* --- Dark mode --- */
@media (prefers-color-scheme: dark){
  :root{
    --forum-bg: #0b0f14;
    --forum-surface: #0f172a;
    --forum-text: #e5e7eb;
    --forum-muted: #9ca3af;
    --forum-border: #1f2937;
    --forum-accent: #60a5fa;
    --forum-accent-2: #38bdf8;
    --forum-shadow: 0 10px 24px rgba(0,0,0,.45);
    --forum-shadow-sm: 0 6px 16px rgba(0,0,0,.35);
    --forum-focus: 0 0 0 3px rgba(96, 165, 250, .4);
  }
}

/* --- Base layout --- */
#forum-app.forum-container{
  font-family: var(--forum-font) !important;
  color: var(--forum-text);
  background: var(--forum-bg);
  min-height: 70vh;
  padding: clamp(14px, 2vw, 24px);
}

.forum-topbar{
  position: sticky;
  /* Keep base offset of 80px and add the WP admin bar height when present */
  top: calc(var(--wp-adminbar-height, 0px) + 50px);
  z-index: 5;
  background: color-mix(in oklab, var(--forum-bg) 85%, transparent);
  backdrop-filter: saturate(1.1) blur(6px);
  padding: 8px 0 12px 0;
  border-bottom: 0px solid var(--forum-border);
}

.forum-topbar h1{
  margin: 0 0 10px 0;
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 750;
  letter-spacing: -0.02em;
}

/* Desktop: align the filters container inline with the H1 */
@media (min-width: 768px) {
  .forum-topbar {
    align-items: center;
    gap: 18px;
    padding: 12px 0;
  }

  .forum-topbar h1{
    margin: 0;
    flex: 0 0 auto;
    font-size: clamp(22px, 1.4vw, 28px);
  }

  .forum-filters-container{
    margin: 0 0 0 auto; /* push filters to the right */
    max-width: 820px;
    width: 100%;
  }

  .forum-filters{
    margin: 0;
  }
}

/* --- Filters row --- */
.forum-filters-container {
  position: relative;
  max-width: 1200px;
  margin-bottom: 16px;
}

.forum-filters {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto auto;
  gap: 10px;
  align-items: center;
  /* background: var(--forum-surface);
  border: 1px solid var(--forum-border);
  border-radius: var(--forum-radius);
  padding: 6px 16px;
  margin-bottom: 16px;
  box-shadow: var(--forum-shadow-sm); */
}

.forum-filters.visible {
  display: grid;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.forum-filters select,
.forum-filters input[type="text"]{
  appearance: none;
  border: 1px solid var(--forum-border);
  background: var(--forum-surface);
  color: var(--forum-text);
  border-radius: var(--forum-radius-sm);
  padding: 10px 12px;
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease, background-color .15s ease;
  box-shadow: var(--forum-shadow-sm);
}

.forum-filters select:focus,
.forum-filters input[type="text"]:focus{
  border-color: var(--forum-accent);
  box-shadow: var(--forum-focus);
}

.forum-filters button#f-apply{
  border: 1px solid var(--forum-accent);
  background: var(--forum-accent);
  color: #fff;
  border-radius: var(--forum-radius-sm);
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--forum-shadow-sm);
  transition: transform .08s ease, opacity .15s ease, background-color .15s ease;
}
.forum-filters button#f-apply:hover{ opacity: .95; }
.forum-filters button#f-apply:active{ transform: translateY(1px); }

.forum-filters .btn-new-thread{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid var(--forum-border);
  background: var(--forum-surface);
  color: var(--forum-accent);
  border-radius: var(--forum-radius-sm);
  padding: 10px 14px;
  font-weight: 700;
  box-shadow: var(--forum-shadow-sm);
  transition: border-color .15s ease, color .15s ease, transform .08s ease;
  gap: 8px;
}
.forum-filters .btn-new-thread:hover{
  border-color: var(--forum-accent);
  color: var(--forum-accent-2);
}
.forum-filters .btn-new-thread:active{ transform: translateY(1px); }

/* --- Responsive Design --- */

/* Large Desktop (1200px+) - Default styles already optimized */

/* Desktop/Laptop (1024px - 1199px) */
@media (max-width: 1199px) {
  #forum-app.forum-container {
    padding: clamp(12px, 1.5vw, 20px);
  }
  
  .thread-author-section .avatar,
  .thread-author-section .avatar-placeholder {
    width: 34px;
    height: 34px;
  }
}

/* When the mobile bottom nav is present, hide the top filters to save vertical space */
@media (max-width: 767px) {
  body.has-forum-bottom-nav .forum-filters-container {
    display: none !important;
  }
}

/* Tablet Landscape (768px - 1023px) */
@media (max-width: 1023px) {
  .thread-row {
    padding: 12px 16px;
    gap: 8px;
  }
  
  .thread-card-title h3 {
    font-size: clamp(14px, 2vw, 17px);
  }
  
  .thread-author-section .avatar,
  .thread-author-section .avatar-placeholder {
    width: 32px;
    height: 32px;
  }
  
  .thread-author-name {
    font-size: 12px;
  }
  
  .thread-meta-info {
    font-size: 10px;
  }
  
  .thread-stat-item {
    font-size: 12px;
  }
  
  .thread-stat-icon {
    font-size: 15px;
  }
}

/* Tablet Portrait & Small Laptop (640px - 767px) */
@media (max-width: 767px) {
  /* Hide forum headers completely on mobile for cleaner card layout */
  .page article {
    padding: 0.6em 1.188em !important;
    font-family: "Lato", "Open Sans", Helvetica, Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
  }

  .forum-section {
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
  }

  .forum-headers {
    display: none !important;
  }
  
  /* Enable collapsible filters on mobile */
  .forum-filters {
    display: none;
    margin-top: 8px;
    margin-bottom: 8px;
    animation: slideDown 0.3s ease-out;
  }
  
  /* Switch to card layout on mobile */
  .thread-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    border-radius: var(--forum-radius);
    margin-bottom: 16px;
    box-shadow: var(--forum-shadow-sm);
    border: 1px solid var(--forum-border);
    background: var(--forum-surface);
    width: 100%;
  }
  
  .thread-row:hover {
    box-shadow: var(--forum-shadow);
    
  }
  
  .thread-row:last-child {
    border-bottom: 1px solid var(--forum-border);
  }

  .forum-threads {
    width: 100% !important;
    background: none !important;
    border-radius: var(--forum-radius);
    box-shadow: var(--forum-shadow);
    overflow: hidden;
    border: 0px solid var(--forum-border) !important;
  }

  
  /* Hide category and last post columns on mobile */
  .col-category, .col-lastpost {
    display: none !important;
  }
  
  /* Mobile thread row structure - prevent grid display */
  .thread-row {
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Ensure original column positions are hidden on mobile when moved */
  .thread-row > .col-views,
  .thread-row > .col-replies,
  .thread-row > .col-status {
    display: none !important;
  }
  
  /* Only show elements in mobile bottom container */
  .thread-mobile-bottom .col-views,
  .thread-mobile-bottom .col-replies,
  .thread-mobile-bottom .col-status {
    display: flex !important;
  }
  
  /* Thread title - Row 1 (prominent and at top) */
  .col-thread {
    display: block !important;
    order: 1;
    margin-bottom: 8px;
  }
  
  .col-thread .thread-main {
    width: 100%;
  }
  
  .col-thread .thread-title {
    margin: 12px 0;
    line-height: 1.3;
    font-size: clamp(24px, 5vw, 28px);
  }
  
  .col-thread .thread-title h3 {
    margin: 0;
    font-size: clamp(22px, 5vw, 24px);
    font-weight: 700;
    line-height: 1.3;
    color: var(--forum-text);
  }
  
  .col-thread .thread-title a {
    color: var(--forum-text);
    text-decoration: none;
    display: block;
  }
  
  .col-thread .thread-title a:hover {
    color: var(--forum-accent);
  }
  
  /* Thread image - Row 2 (below title) */
  .col-author {
    display: flex !important;
    order: 2;
    margin-bottom: 8px;
    justify-content: center;
    align-items: center;
  }
  
  /* Thread image display */
  .col-author .thread-image {
    width: 100%;
    max-width: 100%;
    max-height: 300px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--forum-border);
    background: #f5f5f5;
  }
  
  .col-author .thread-image a {
    display: block;
    width: 100%;
    height: 100%;
  }
  
  .col-author .thread-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  
  .col-author .thread-image-placeholder {
    display: none;
  }
  
  .col-author .placeholder-icon {
    display: none;
  }
  
  /* Legacy author-info styles (hidden on mobile since moved to thread-meta) */
  .col-author .author-info {
    display: none;
  }
  
  .col-author .avatar {
    display: none;
  }
  
  .col-author .username {
    display: none;
  }
  
  /* Time and status badges below title */
  .col-thread .thread-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 14px;
    color: var(--forum-muted);
    flex-wrap: wrap;
  }
  
  .col-thread .thread-meta time {
    font-weight: 500;
    font-size: 12px;
  }
  
  .col-thread .status-badge {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  /* Bottom stats row - Row 3 */
  .thread-mobile-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    order: 3;
    padding-top: 8px;
    border-top: 1px solid var(--forum-border);
    margin-top: 8px;
  }
  
  /* Vote section on the left */
  .col-status {
    display: flex !important;
    order: 1;
  }
  
  .thread-vote-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .vote-score-display {
    order: 2;
  }
  
  .vote-score-display .thread-vote-score {
    font-size: 18px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    background: color-mix(in oklab, var(--forum-border) 10%, var(--forum-surface));
    min-width: 40px;
    text-align: center;
  }
  
  .vote-actions {
    display: flex;
    gap: 6px;
    order: 1;
  }
  
  .thread-vote-like,
  .thread-vote-dislike {
    width: 36px !important;
    height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid var(--forum-border) !important;
    border-radius: 8px !important;
    background: var(--forum-surface) !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
  }
  
  .thread-vote-like:hover,
  .thread-vote-dislike:hover {
    border-color: var(--forum-accent) !important;
    background: color-mix(in oklab, var(--forum-accent) 5%, var(--forum-surface)) !important;
  }
  
  /* Stats section - now full width with vote actions on left */
  .thread-mobile-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
  }

  /* Right-side grouping for replies, views and mobile share action */
  .mobile-right-stats {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-share-action .btn-share {
    width: 36px;
    height: 36px;
  }
  
  /* Ensure explicit left-to-right ordering on the mobile bottom row.
     Guarantee the sequence: [mobile-vote-actions] (left),
     then [col-replies], [col-views], and finally [mobile-share-action] (right).
     Add rules with sufficient specificity to override any global "order" set
     on .col-views / .col-replies elsewhere in the stylesheet. */
  .thread-mobile-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  /* Left block: mobile vote actions */
  .thread-mobile-stats > .mobile-vote-actions {
    order: 1;
    flex: 0 0 auto;
    height: 30px;
  }

  /* Right block: replies / views / share grouped together */
  .thread-mobile-stats > .mobile-right-stats {
    order: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
  }

  /* Inside the right block, force the explicit left-to-right order */
  .thread-mobile-stats .mobile-right-stats .col-replies { order: 1; }
  .thread-mobile-stats .mobile-right-stats .col-views   { order: 2; }
  .thread-mobile-stats .mobile-right-stats .mobile-share-action { order: 3; }

  /* Defensive: override any earlier order declarations applied to these col-* classes */
  .thread-mobile-stats .col-replies, .thread-mobile-stats .col-views, .thread-mobile-stats .mobile-share-action {
    /* keep them inline and don't let them grow past content */
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
  }
  
  /* Mobile vote actions - horizontal layout [Like, Score, Dislike] */
  .mobile-vote-actions {
    display: inline-flex;
    align-items: center;
    gap: 0;
    order: 1;
    background: transparent;
    border: 1px solid var(--forum-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: none;
    max-width: 50%;
  }
  
  .mobile-vote-actions .mobile-vote-score-display {
    background: transparent;
    border: none;
    padding: 8px 16px;
    min-width: 60px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-left: 1px solid var(--forum-border);
    border-right: 1px solid var(--forum-border);
  }
  
  .mobile-vote-actions .mobile-thread-vote-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 16px;
    line-height: 1;
    border: none;
    background: transparent;
    min-width: 28px;
  }
  
  /* Score colors for mobile - using new mobile-specific classes */
  .mobile-vote-actions .mobile-thread-vote-score.positive {
    color: #16a34a; /* green-600 */
  }
  .mobile-vote-actions .mobile-thread-vote-score.negative {
    color: #dc2626; /* red-600 */
  }
  .mobile-vote-actions .mobile-thread-vote-score.neutral {
    color: #6b7280; /* gray-500 */
  }
  
  .mobile-vote-actions .mobile-thread-vote-like,
  .mobile-vote-actions .mobile-thread-vote-dislike {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 0;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
  }
  
  .mobile-vote-actions .mobile-thread-vote-like:active,
  .mobile-vote-actions .mobile-thread-vote-dislike:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
  }
  
  .mobile-vote-actions .mobile-thread-vote-like:focus-visible,
  .mobile-vote-actions .mobile-thread-vote-dislike:focus-visible {
    outline: 2px solid #3b82f6; /* blue-500 */
    outline-offset: 2px;
  }
  
  .mobile-vote-actions .mobile-thread-vote-like:hover {
    outline: 1px solid #3b82f6; /* blue-500 */
    background: rgba(59, 130, 246, 0.05);
  }
  
  .mobile-vote-actions .mobile-thread-vote-dislike:hover {
    outline: 1px solid #3b82f6; /* blue-500 */
    background: rgba(59, 130, 246, 0.05);
  }
  
  /* Voted states for mobile buttons - match desktop styling */
  .mobile-vote-actions .mobile-thread-vote-like.voted {
    background: rgba(22, 163, 74, 0.12);
  }
  
  .mobile-vote-actions .mobile-thread-vote-dislike.voted {
    background: rgba(220, 38, 38, 0.12);
  }
  
  /* Disabled states for mobile buttons */
  .mobile-vote-actions .mobile-thread-vote-like[disabled],
  .mobile-vote-actions .mobile-thread-vote-dislike[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.25);
    box-shadow: none;
    pointer-events: none;
  }
  
  .col-views,
  .col-replies {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--forum-muted);
    order: 2;
  }
  
  .col-views::before {
    content: "👁️";
    font-size: 14px;
  }
  
  .col-replies::before {
    content: "💬";
    font-size: 14px;
  }
  
  .col-views .count-number,
  .col-replies .count-number {
    font-weight: 600;
    color: var(--forum-text);
    font-size: 14px;
    background-color: transparent;
  }
  
  .forum-filters {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .forum-filters select,
  .forum-filters input[type="text"] {
    width: 100%;
  }
  
  .forum-filters button#f-apply,
  .forum-filters .btn-new-thread {
    width: 100%;
    text-align: center;
  }
  
  .thread-card-header {
    gap: 10px;
    margin-bottom: 6px;
  }
  
  .thread-card-title h3 {
    font-size: clamp(13px, 3vw, 16px);
    line-height: 1.2;
  }
  
  .thread-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .thread-stats-section {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
  
  .thread-vote-section {
    align-self: flex-start;
  }
}

/* Mobile Large (480px - 639px) */
@media (max-width: 639px) {
  #forum-app.forum-container {
    padding: clamp(8px, 2vw, 16px);
  }
  
  
  /* When the mobile bottom nav is present, hide the top filters to save vertical space */
  @media (max-width: 767px) {
    body.has-forum-bottom-nav .forum-filters-container {
      display: none !important;
    }
  }
  .forum-topbar {
    padding: 6px 0 10px 0;
    margin: -6px 0 12px 0;
  }
  
  .forum-topbar h1 {
    font-size: clamp(18px, 4vw, 24px);
    margin: 0 0 8px 0;
  }
  
  .thread-row {
    padding: 8px 12px;
    gap: 6px;
    margin-bottom: 8px;
  }
  
  .thread-card-title h3 {
    font-size: clamp(12px, 3.5vw, 15px);
  }
  
  .thread-author-section .avatar,
  .thread-author-section .avatar-placeholder {
    width: 28px;
    height: 28px;
  }
  
  .thread-vote-score {
    font-size: 14px;
    padding: 3px 6px;
    min-width: 36px;
  }
  
  .thread-vote-like,
  .thread-vote-dislike {
    width: 28px !important;
    height: 28px !important;
    font-size: 12px !important;
  }
  
  .thread-stat-item {
    font-size: 11px;
  }
  
  .thread-stat-icon {
    font-size: 14px;
  }
}

/* Mobile Small (320px - 479px) */
@media (max-width: 479px) {
  #forum-app.forum-container {
    padding: 4px;
  }
  
  .thread-row {
    padding: 6px 10px;
    gap: 4px;
    margin-bottom: 6px;
  }
  
  .thread-card-header {
    gap: 8px;
    margin-bottom: 4px;
  }
  
  .thread-card-title h3 {
    font-size: clamp(11px, 4vw, 14px);
    line-height: 1.1;
  }
  
  .thread-author-section .avatar,
  .thread-author-section .avatar-placeholder {
    width: 24px;
    height: 24px;
  }
  
  .thread-author-name {
    font-size: 11px;
  }
  
  .thread-meta-info {
    font-size: 9px;
  }
  
  .thread-vote-score {
    font-size: 12px;
    padding: 2px 4px;
    min-width: 32px;
  }
  
  .thread-vote-like,
  .thread-vote-dislike {
    width: 24px !important;
    height: 24px !important;
    font-size: 11px !important;
  }
  
  .thread-stats-section {
    gap: 12px;
  }
  
  .thread-stat-item {
    font-size: 10px;
  }
  
  .thread-stat-icon {
    font-size: 13px;
  }
  
  /* Hide some elements on very small screens */
  .thread-meta-info {
    display: none;
  }
}

/* Responsive filters */
@media (max-width: 900px) {
  .forum-filters {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .forum-filters #f-sort {
    grid-column: span 1;
  }
  
  .forum-filters #f-apply {
    grid-column: span 1;
  }
  
  .forum-filters .btn-new-thread {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .forum-filters {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  .forum-filters select#f-cat {
    grid-column: span 1;
  }
  
  .forum-filters .btn-new-thread {
    order: 10;
  }
}



/* Card Header - Author Info Row */
.thread-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.thread-author-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.thread-author-section .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--forum-border);
}

.thread-author-section .avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--forum-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--forum-muted);
  font-weight: bold;
  font-size: 14px;
}

.thread-author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thread-author-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--forum-text);
  line-height: 1.2;
}

.thread-meta-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--forum-muted);
}

.thread-status-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Card Title - Prominent Thread Title */
.thread-card-title {
  margin: 0 0 12px 0;
}

.thread-card-title h3 {
  margin: 0;
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--forum-text);
}

.thread-card-title a {
  color: var(--forum-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.thread-card-title a:hover {
  color: var(--forum-accent);
}

/* Card Footer - Actions Row */
.thread-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--forum-border);
}

.thread-vote-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.thread-stats-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.thread-stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--forum-muted);
  font-weight: 500;
}

.thread-stat-icon {
  font-size: 16px;
  color: var(--forum-accent);
}

.thread-stat-number {
  font-weight: 600;
  color: var(--forum-text);
}

/* Legacy column classes - Visible on desktop, hidden on mobile */
.col-status, .col-author, .col-thread, .col-category, 
.col-replies, .col-views, .col-lastpost, .col-actions {
  display: flex; /* Show on desktop by default */
}

/* Status column */
.col-status{
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Inner block: no border, no extra background */
.col-status .thread-vote-buttons{
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,.1) 60%);
  background-size: 200% 200%;
  background-position: 0% 0%;
  transition: background-position .2s ease;
  transition: transform .15s ease, box-shadow .2s ease, backdrop-filter .2s ease;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.25);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%); /* Safari */
  border-radius: 12px;
  padding: 0;
  color: #1f2937; /* slate-800 */  
}

@keyframes bgDrift{
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 0%; }
  100% { background-position: 0% 0%; }
}
.col-status .thread-vote-buttons:hover,
.col-status .thread-vote-buttons:focus-visible{
  animation: bgDrift 2.2s ease-in-out infinite;
  border-color: rgba(255,255,255,.55);
  box-shadow:
    0 14px 36px rgba(0,0,0,.16),
    inset 0 1px 0 rgba(255,255,255,.45);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  outline: none;                 /* reset default */
}



/* Keyboard focus ring (keeps glass vibe) */
.col-status .thread-vote-buttons:focus-visible{
  box-shadow:
    0 16px 38px rgba(0,0,0,.18),
    inset 0 1px 0 rgba(255,255,255,.5),
    0 0 0 2px rgba(56,189,248,.6); /* cyan ring */
}

/* Active press: reduce lift/shadow slightly */
.col-status .thread-vote-buttons:active{
  transform: translateY(-1px);
  box-shadow:
    0 10px 26px rgba(0,0,0,.14),
    inset 0 1px 0 rgba(255,255,255,.4);
}

/* Big score pill — no border */
.col-status .vote-score-display .thread-vote-score{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.25rem, 2vw + .6rem, 2.0rem);
  line-height: 1;
  min-width: 100%;
  padding: .6rem .6rem;
  border: none;
  background: transparent;
}

.col-status .vote-score-display {
  width: 100%; 
  border-radius: 12px 12px 0 0;
  background: linear-gradient(to bottom, #bcdeee 0%, #ffffff 30%);
  background-size: 200% 200%;
  background-position: 0% 0%;
  transition: background-position .2s ease;
  transition: background-position .2s ease;
  transition: transform .15s ease, box-shadow .2s ease, backdrop-filter .2s ease;
}

.col-status .vote-score-display:hover {
  animation: bgDrift 2.2s ease-in-out infinite;
}

/* Score colors (still borderless) */
.col-status .thread-vote-score.positive{
  color: #16a34a; /* green-600 */
  border-radius: 12px 12px 0 0;
}
.col-status .thread-vote-score.negative{
  color: #dc2626; /* red-600 */
  border-radius: 12px 12px 0 0;
}
.col-status .thread-vote-score.neutral{
  color: #6b7280; /* gray-500 */
  border-radius: 12px 12px 0 0;
}

/* Score colors (still borderless) */
.col-status .thread-vote-like:hover{
  outline: 1px solid transparent;          /* keep focus semantics */
  outline-offset: 1px;
  box-shadow:
    0 0 0 1px rgba(128, 246, 59, 0.85),        /* crisp ring */
    0 0 14px 6px rgba(128, 246, 59, 0.45);     /* blurry glow */
  border-radius: 0 0 0 12px;
}
.col-status .thread-vote-dislike:hover{
  outline: 1px solid transparent;          /* keep focus semantics */
  outline-offset: 1px;
  box-shadow:
    0 0 0 1px rgba(246, 59, 59, 0.85),        /* crisp ring */
    0 0 14px 6px rgba(246, 59, 59, 0.45);     /* blurry glow */
  border-radius: 0 0 12px 0;
}

/* Buttons row */
.col-status .vote-actions{
  display: flex;
}

/* Buttons — borderless by default */
.col-status .vote-actions button{
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: none;                 /* no border by default */
  background: transparent;          /* slate-50 */
  border-radius: 0 0 12px 0;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
}
.col-status .vote-actions button:active{
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.col-status .vote-actions button:focus-visible{
  outline: 2px solid #3b82f6; /* blue-500 */
  outline-offset: 2px;
}

/* Only voted (non-neutral) buttons get a real border */
.col-status .thread-vote-like.voted{
  background: rgba(22, 163, 74, 0.12);
  border-radius: 0 0 0 12px;
}
.col-status .thread-vote-dislike.voted{
  background: rgba(220, 38, 38, 0.12);
  border-radius: 0 0 12px 0;
}

/* Disabled buttons stay borderless */
.col-status .vote-actions button[disabled]{
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(.25);
  box-shadow: none;
}

/* Optional: dark mode */
@media (prefers-color-scheme: dark){
  .col-status{
    background: #0b0f14;
    border-color: #141a22;
  }
  .col-status .thread-vote-buttons{
    color: #e5e7eb; /* slate-200 */
  }
  .col-status .vote-actions button{
    background: #0f141b;
  }
  .col-status .thread-vote-score.positive{ background: rgba(22, 163, 74, 0.20); }
  .col-status .thread-vote-score.negative{ background: rgba(220, 38, 38, 0.20); }
  .col-status .thread-vote-score.neutral{  background: rgba(148, 163, 184, 0.18); } /* slate-400 */
}


/* Author column - Desktop layout (vertical) */
@media (min-width: 768px) {
  .col-author{
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    padding: 8px;
  }

  /* Thread image in desktop view */
  .col-author .thread-image {
    width: 100%;
    max-width: 120px;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid var(--forum-border);
    background: #f5f5f5;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  
  .col-author .thread-image:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
  
  .col-author .thread-image a {
    display: block;
    width: 100%;
    height: 100%;
  }
  
  .col-author .thread-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  
  .col-author .thread-image-placeholder {
    width: 100%;
    max-width: 120px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 8px;
    border: 2px solid var(--forum-border);
  }
  
  .col-author .placeholder-icon {
    font-size: 40px;
    opacity: 0.25;
  }

  /* Legacy author-info styles kept for backward compatibility */
  .author-info{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }

  .author-info .avatar{
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--forum-border);
  }

  .author-info .username{
    font-size: 12px;
    font-weight: 600;
    color: var(--forum-text);
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
    max-width: 100px;
  }
}

.avatar-placeholder{
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--forum-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--forum-muted);
  font-weight: bold;
}

/* Category column */
.col-category{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
}

.category-info{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 60px; /* Ensure consistent height even without product tags */
  justify-content: center;
}

.category-icon{
  font-size: 24px;
  margin-bottom: 2px;
}

.category-name{
  font-size: 11px;
  font-weight: 600;
  color: var(--forum-text);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.product-tags{
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.brand-tag, .model-tag{
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 6px;
  font-weight: 600;
}

.brand-tag{
  background: color-mix(in oklab, var(--forum-success) 15%, var(--forum-surface));
  color: var(--forum-success);
}

.model-tag{
  background: color-mix(in oklab, var(--forum-warn) 15%, var(--forum-surface));
  color: var(--forum-warn);
}

/* Replies and Views columns */
.col-replies, .col-views{
  display: flex;
  justify-content: center;
  align-items: center;
}

.count-number{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  background: var(--forum-accent);
  text-align: center;
}

/* Last post column */
.col-lastpost{
  display: flex;
  align-items: center;
  justify-content: center;
}

.lastpost-info{
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.lastpost-info .avatar-sm{
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--forum-border);
}

.lastpost-details{
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lastpost-username{
  font-size: 12px;
  font-weight: 600;
  color: var(--forum-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lastpost-details time{
  font-size: 11px;
  color: var(--forum-muted);
}

/* No threads message */
.no-threads{
  text-align: center;
  padding: 60px 20px;
  color: var(--forum-muted);
  font-size: 16px;
}

.no-threads a{
  color: var(--forum-accent);
  text-decoration: none;
  font-weight: 600;
}

.no-threads a:hover{
  text-decoration: underline;
}

/* Badges (optional classes you can add later) */
.badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .02em;
  border: 1px solid var(--forum-border);
  background: color-mix(in oklab, var(--forum-accent) 10%, var(--forum-surface));
  color: var(--forum-accent);
}
.badge.sticky{
  background: color-mix(in oklab, var(--forum-warn) 10%, var(--forum-surface));
  color: var(--forum-warn);
  border-color: color-mix(in oklab, var(--forum-warn) 35%, var(--forum-border));
}
.badge.locked{
  background: color-mix(in oklab, var(--forum-muted) 10%, var(--forum-surface));
  color: var(--forum-muted);
}

/* Excerpt */
#forum-threads .thread .excerpt{
  margin: 10px 0 2px 0;
  color: var(--forum-text);
  opacity: .92;
  line-height: 1.55;
}

/* Pager */
#forum-pager{
  display: flex;
  justify-content: center;
  margin: 20px 0 8px 0;
}
#forum-pager button{
  border: 1px solid var(--forum-border);
  background: var(--forum-surface);
  color: var(--forum-text);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--forum-shadow-sm);
  transition: border-color .15s ease, transform .08s ease, color .15s ease;
}
#forum-pager button:hover{
  border-color: var(--forum-accent);
  color: var(--forum-accent);
}
#forum-pager button:active{ transform: translateY(1px); }

/* Empty state (optional – use when no items) */
.forum-empty{
  background: var(--forum-surface);
  border: 1px dashed var(--forum-border);
  border-radius: var(--forum-radius);
  padding: 28px;
  text-align: center;
  color: var(--forum-muted);
  box-shadow: var(--forum-shadow-sm);
}

/* Skeleton loader (optional) */
.skel{
  position: relative; overflow: hidden; border-radius: 8px; background: var(--forum-border);
}
.skel::after{
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  transform: translateX(-100%);
  animation: forum-scan 1.1s infinite;
}
@keyframes forum-scan{ to { transform: translateX(100%); } }

/* Links inside content */
#forum-threads .thread a{
  color: var(--forum-accent);
}
#forum-threads .thread a:hover{
  color: var(--forum-accent-2);
}

/* Forms (general) */
button, .btn, .btn-new-thread {
  outline: none;
}
:where(button, .btn, input, select):focus-visible{
  box-shadow: var(--forum-focus);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; animation: none !important; }
}

/* Max width container (optional wrapper if you add one later) */
.forum-container{
  max-width: 1200px;
  margin-inline: auto;
}

/* Compact mode helper (optional class you can toggle) */
.forum-compact #forum-threads .thread{
  padding: 12px 14px;
}
.forum-compact .forum-filters{
  gap: 8px;
}

/* Utility: clamp long titles gracefully */
#forum-threads .thread h3 a{
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

/* Small screens spacing */
@media (max-width: 480px){
  #forum-threads .thread .meta{ gap: 6px 10px; }
  #forum-threads .thread{ padding: 12px; }
}

/* --- Multi-section Layout Styles --- */

/* Section styling */
.forum-section {
  margin-bottom: 40px;
}

.forum-section h2 {
  margin: 0 0 16px 0;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  color: var(--forum-text);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--forum-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Category footer with "View All" link */
.category-footer {
  margin-top: 12px;
  text-align: center;
  padding: 8px 0;
}

.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--forum-accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border: 1px solid var(--forum-border);
  border-radius: var(--forum-radius-sm);
  background: var(--forum-surface);
  box-shadow: var(--forum-shadow-sm);
  transition: all .15s ease;
}

.view-all-link:hover {
  color: var(--forum-accent-2);
  border-color: var(--forum-accent);
  background: color-mix(in oklab, var(--forum-accent) 5%, var(--forum-surface));
  transform: translateY(-1px);
}

/* Update forum filters to work with simplified layout */
.forum-filters {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

/* Responsive adjustments for multiple sections */
@media (max-width: 768px) {
  .forum-section {
    margin-bottom: 32px;
  }
  
  .forum-section h2 {
    font-size: 18px;
  }
  
  .view-all-link {
    font-size: 13px;
    padding: 6px 12px;
  }
}

@media (max-width: 480px) {
  .forum-section {
    margin-bottom: 24px;
  }
  
  .category-footer {
    margin-top: 8px;
  }
}
/* --- This is the End of forum-hub.css adapted Rules --- */

/* --- Enhanced Message System --- */
.forum-message {
  position: relative;
  margin: 16px 0;
  border-radius: var(--forum-radius);
  box-shadow: var(--forum-shadow);
  overflow: hidden;
  z-index: 100;
}

.forum-message-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
}

.forum-message-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.forum-message-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.forum-message-close:hover {
  opacity: 1;
}

/* Message Types */
.forum-message-info {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
  color: #1976d2;
}

.forum-message-success {
  background: #e8f5e8;
  border-left: 4px solid #4caf50;
  color: #388e3c;
}

.forum-message-warning {
  background: #fff3e0;
  border-left: 4px solid #ff9800;
  color: #f57c00;
}

.forum-message-error {
  background: #ffebee;
  border-left: 4px solid #f44336;
  color: #d32f2f;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .forum-message-info {
    background: #0d47a1;
    color: #bbdefb;
  }
  
  .forum-message-success {
    background: #1b5e20;
    color: #c8e6c9;
  }
  
  .forum-message-warning {
    background: #e65100;
    color: #ffcc02;
  }
  
  .forum-message-error {
    background: #b71c1c;
    color: #ffcdd2;
  }
}

/* Animation for messages */
.forum-message {
  animation: slideInFromTop 0.3s ease-out;
}

@keyframes slideInFromTop {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* --- Enhanced Loading States --- */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--forum-muted);
}

.loading-indicator .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--forum-border);
  border-top: 3px solid var(--forum-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

.loading-indicator span {
  font-size: 14px;
  font-weight: 500;
}

/* --- Enhanced Error States --- */
.forum-error {
  text-align: center;
  padding: 60px 20px;
  color: var(--forum-muted);
  border: 2px dashed var(--forum-border);
  border-radius: var(--forum-radius);
  background: var(--forum-surface);
}

.forum-error p {
  margin: 0 0 20px 0;
  font-size: 16px;
  color: var(--forum-text);
}

.forum-error button {
  background: var(--forum-accent);
  color: white;
  border: none;
  border-radius: var(--forum-radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.forum-error button:hover {
  background: var(--forum-accent-2);
}

/* ===========================
   /* Base forum styles continue below */

/* --- Category-specific Header --- */
.category-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 20px;
  width: 100%;
}

.category-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;

}

.category-icon {
  font-size: 32px;
  line-height: 1;
  margin-top: 4px;
}

.category-text h1 {
  margin: 0 0 6px 0;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  color: var(--forum-text);
  line-height: 1.2;
}

.category-description {
  margin: 0;
  color: var(--forum-muted);
  font-size: 14px;
  line-height: 1.4;
  max-width: 768px;
}

/* Collapsible Category Actions */
.category-actions {
  position: relative;
}

.category-actions-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--forum-surface);
  border: 1px solid var(--forum-border);
  border-radius: var(--forum-radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--forum-text);
  cursor: pointer;
  box-shadow: var(--forum-shadow-sm);
  transition: all 0.15s ease;
}

.category-actions-toggle:hover {
  border-color: var(--forum-accent);
  background: color-mix(in oklab, var(--forum-accent) 5%, var(--forum-surface));
}

.category-actions-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--forum-surface);
  border: 1px solid var(--forum-border);
  border-radius: var(--forum-radius);
  box-shadow: var(--forum-shadow);
  padding: 8px;
  margin-top: 4px;
  display: none;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  z-index: 10;
}

.category-actions-menu.visible {
  display: flex;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--forum-border);
  background: var(--forum-surface);
  color: var(--forum-muted);
  border-radius: var(--forum-radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--forum-shadow-sm);
  transition: all .15s ease;
  width: 100%;
}

.btn-back:hover {
  color: var(--forum-text);
  border-color: var(--forum-accent);
  background: color-mix(in oklab, var(--forum-accent) 3%, var(--forum-surface));
}

.btn-new-thread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid var(--forum-border);
  background: var(--forum-surface);
  color: var(--forum-accent);
  border-radius: var(--forum-radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--forum-shadow-sm);
  transition: border-color .15s ease, color .15s ease, transform .08s ease;
  width: 100%;
}

.btn-new-thread:hover {
  border-color: var(--forum-accent);
  color: var(--forum-accent-2);
  text-decoration: none;
}

.btn-new-thread:active {
  transform: translateY(1px);
}

/* --- Enhanced Filter Controls --- */
.forum-filters-container {
  position: relative;
  margin-bottom: 20px;
}

.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--forum-surface);
  border: 1px solid var(--forum-border);
  border-radius: var(--forum-radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--forum-text);
  cursor: pointer;
  box-shadow: var(--forum-shadow-sm);
  transition: all 0.15s ease;
}

.filter-toggle-btn:hover {
  border-color: var(--forum-accent);
  background: color-mix(in oklab, var(--forum-accent) 5%, var(--forum-surface));
}

.filter-toggle-icon {
  font-size: 14px;
  transition: transform 0.2s ease;
}

.filter-toggle-btn.active .filter-toggle-icon {
  transform: rotate(180deg);
}

.forum-filters {
  display: none; /* Hidden by default */
  background: var(--forum-surface);
  border: 1px solid var(--forum-border);
  border-radius: var(--forum-radius);
  padding: 16px 20px;
  box-shadow: var(--forum-shadow-sm);
  margin-bottom: 20px;
  animation: slideDown 0.3s ease-out;
}

.forum-filters.visible {
  display: block; /* Show when toggle button is clicked */
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-row {
  display: grid;
  grid-template-columns: 180px 1fr 1fr auto auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.filter-control {
  appearance: none;
  border: 1px solid var(--forum-border);
  background: var(--forum-bg);
  color: var(--forum-text);
  border-radius: var(--forum-radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.filter-control:focus {
  border-color: var(--forum-accent);
  box-shadow: var(--forum-focus);
}

.filter-control::placeholder {
  color: var(--forum-muted);
}

.btn-apply,
.btn-clear {
  border: 1px solid;
  border-radius: var(--forum-radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--forum-shadow-sm);
  transition: all .15s ease;
}

.btn-apply {
  border-color: var(--forum-accent);
  background: var(--forum-accent);
  color: #fff;
}

.btn-apply:hover {
  background: var(--forum-accent-2);
  border-color: var(--forum-accent-2);
}

.btn-clear {
  border-color: var(--forum-border);
  background: var(--forum-surface);
  color: var(--forum-muted);
}

.btn-clear:hover {
  color: var(--forum-text);
  border-color: var(--forum-muted);
}

.filter-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--forum-muted);
  border-top: 1px solid var(--forum-border);
  padding-top: 12px;
  margin-top: 4px;
}

#thread-count {
  font-weight: 600;
}

#active-filters {
  font-style: italic;
}

/* --- Loading Indicator --- */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--forum-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--forum-border);
  border-top: 3px solid var(--forum-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-indicator span {
  font-size: 14px;
  font-weight: 500;
}

/* --- No Threads State --- */
.no-threads {
  text-align: center;
  padding: 60px 20px;
  color: var(--forum-muted);
}

.no-threads h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: var(--forum-text);
}

.no-threads p {
  margin: 0 0 20px 0;
  font-size: 14px;
  line-height: 1.5;
}

.no-threads .btn-new-thread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid var(--forum-accent);
  background: var(--forum-accent);
  color: #fff;
  border-radius: var(--forum-radius-sm);
  padding: 12px 20px;
  font-weight: 600;
  box-shadow: var(--forum-shadow-sm);
  transition: all .15s ease;
}

.no-threads .btn-new-thread:hover {
  background: var(--forum-accent-2);
  border-color: var(--forum-accent-2);
  transform: translateY(-1px);
}

/* --- Pagination --- */
.pagination-container {
  margin: 24px 0;
  display: flex;
  justify-content: center;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--forum-surface);
  border: 1px solid var(--forum-border);
  border-radius: var(--forum-radius);
  padding: 8px 12px;
  box-shadow: var(--forum-shadow-sm);
}

.page-btn {
  border: 1px solid var(--forum-border);
  background: var(--forum-surface);
  color: var(--forum-text);
  border-radius: var(--forum-radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  min-width: 32px;
  transition: all .15s ease;
}

.page-btn:hover {
  border-color: var(--forum-accent);
  background: color-mix(in oklab, var(--forum-accent) 8%, var(--forum-surface));
}

.page-btn.active {
  border-color: var(--forum-accent);
  background: var(--forum-accent);
  color: #fff;
}

.page-dots {
  color: var(--forum-muted);
  font-weight: 500;
  padding: 0 4px;
}

/* --- Responsive Design --- */

/* Large Desktop (1200px+) - Default styles already optimized */

/* Desktop/Laptop (1024px - 1199px) */
@media (max-width: 1199px) {
  .forum-container {
    padding: clamp(12px, 1.5vw, 20px);
  }
  
  .category-header {
    margin-bottom: 20px;
    gap: 16px;
  }
  
  .filter-row {
    grid-template-columns: 160px 1fr 1fr auto auto;
    gap: 10px;
  }
}

/* Tablet Landscape (768px - 1023px) */
@media (max-width: 1023px) {
  .category-header {
    gap: 14px;
  }
  
  .category-title .category-icon {
    font-size: 28px;
  }
  
  .category-text h1 {
    font-size: clamp(20px, 2.5vw, 28px);
  }
  
  .filter-row {
    grid-template-columns: 1fr 1fr auto auto;
    gap: 8px;
  }
  
  .filter-control {
    padding: 7px 10px;
    font-size: 12px;
  }
  
  .btn-apply,
  .btn-clear {
    padding: 7px 12px;
    font-size: 12px;
  }

  /* Reduce spacing for filters on tablet */
  .forum-filters-container {
    margin-bottom: 0px;
  }
}

/* Tablet Portrait & Small Laptop (640px - 767px) */
@media (max-width: 767px) {
  /* Hide forum headers completely on mobile for cleaner card layout */
  .page article {
    padding: 0.6em 1.188em !important;
    font-family: "Lato", "Open Sans", Helvetica, Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
  }

  .forum-section {
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
  }

  .forum-headers {
    display: none !important;
  }
  
  /* Switch to card layout on mobile */
  .thread-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-radius: var(--forum-radius);
    margin-bottom: 8px;
    box-shadow: var(--forum-shadow-sm);
    border: 1px solid var(--forum-border);
    background: var(--forum-surface);
    width: 99%;
  }
  
  .thread-row:hover {
    box-shadow: var(--forum-shadow);
  }
  
  .thread-row:last-child {
    border-bottom: 1px solid var(--forum-border);
  }

  .forum-threads {
    width: 100% !important;
    background: none !important;
    border-radius: var(--forum-radius);
    box-shadow: var(--forum-shadow);
    overflow: hidden;
    border: 0px solid var(--forum-border) !important;
  }

  /* Hide category and last post columns on mobile */
  .col-category, .col-lastpost {
    display: none !important;
  }
  
  /* Mobile thread row structure - prevent grid display */
  .thread-row {
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Ensure original column positions are hidden on mobile when moved */
  .thread-row > .col-views,
  .thread-row > .col-replies,
  .thread-row > .col-status {
    display: none !important;
  }
  
  /* Only show elements in mobile bottom container */
  .thread-mobile-bottom .col-views,
  .thread-mobile-bottom .col-replies,
  .thread-mobile-bottom .col-status {
    display: flex !important;
  }
  
  /* Author info at top - Row 1 */
  .col-author {
    display: flex !important;
    order: 2;
    margin-bottom: 8px;
  }
  
  .col-author .author-info {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    flex-direction: row; /* Ensure horizontal layout */
  }
  
  .col-author .avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--forum-border);
    flex-shrink: 0;
  }
  
  .col-author .username {
    font-size: 14px;
    font-weight: 600;
    color: var(--forum-text);
    text-decoration: none;
    flex: 1;
  }
  
  .col-author .username:hover {
    color: var(--forum-accent);
  }
  
  /* Thread title - Row 2 (prominent and centered) */
  .col-thread {
    display: block !important;
    order: 1;
    margin-bottom: 2px;
  }
  
  .col-thread .thread-main {
    width: 100%;
  }
  
  .col-thread .thread-title {
    margin: 0 0 4px 0;
    line-height: 1.3;
    font-size: clamp(16px, 5vw, 20px);
  }
  
  .col-thread .thread-title h3 {
    margin: 0;
    font-size: clamp(16px, 5vw, 20px);
    font-weight: 700;
    line-height: 1.3;
    color: var(--forum-text);
  }
  
  .col-thread .thread-title a {
    color: var(--forum-text);
    text-decoration: none;
    display: block;
  }
  
  .col-thread .thread-title a:hover {
    color: var(--forum-accent);
  }
  
  /* Time and status badges below title */
  .col-thread .thread-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 14px;
    color: var(--forum-muted);
    flex-wrap: wrap;
  }
  
  .col-thread .thread-meta time {
    font-weight: 500;
    font-size: 12px;
  }
  
  .col-thread .status-badge {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  /* Bottom stats row - Row 3 */
  .thread-mobile-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    order: 3;
    padding-top: 8px;
    border-top: 1px solid var(--forum-border);
    margin-top: 8px;
  }
  
  /* Vote section on the left */
  .col-status {
    display: flex !important;
    order: 1;
  }
  
  .thread-vote-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .vote-score-display {
    order: 2;
  }
  
  .vote-score-display .thread-vote-score {
    font-size: 18px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    background: color-mix(in oklab, var(--forum-border) 10%, var(--forum-surface));
    min-width: 40px;
    text-align: center;
  }
  
  .vote-actions {
    display: flex;
    gap: 6px;
    order: 1;
  }
  
  .thread-vote-like,
  .thread-vote-dislike {
    width: 36px !important;
    height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid var(--forum-border) !important;
    border-radius: 8px !important;
    background: var(--forum-surface) !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
  }
  
  .thread-vote-like:hover,
  .thread-vote-dislike:hover {
    border-color: var(--forum-accent) !important;
    background: color-mix(in oklab, var(--forum-accent) 5%, var(--forum-surface)) !important;
  }
  
  /* Stats section - now full width with vote actions on left */
  .thread-mobile-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
  }
  
  /* Mobile vote actions - horizontal layout [Like, Score, Dislike] */
  .mobile-vote-actions {
    display: inline-flex;
    align-items: center;
    gap: 0;
    order: 1;
    background: transparent;
    border: 1px solid var(--forum-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: none;
    max-width: 50%;
  }
  
  .mobile-vote-actions .mobile-vote-score-display {
    background: transparent;
    border: none;
    padding: 8px 16px;
    min-width: 60px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-left: 1px solid var(--forum-border);
    border-right: 1px solid var(--forum-border);
  }
  
  .mobile-vote-actions .mobile-thread-vote-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 16px;
    line-height: 1;
    border: none;
    background: transparent;
    min-width: 28px;
  }
  
  /* Score colors for mobile - using new mobile-specific classes */
  .mobile-vote-actions .mobile-thread-vote-score.positive {
    color: #16a34a; /* green-600 */
  }
  .mobile-vote-actions .mobile-thread-vote-score.negative {
    color: #dc2626; /* red-600 */
  }
  .mobile-vote-actions .mobile-thread-vote-score.neutral {
    color: var(--forum-muted);
  }
  
  /* Stats on the right - replies and views */
  .thread-mobile-stats-right {
    display: flex;
    align-items: center;
    gap: 16px;
    order: 2;
    flex-shrink: 0;
  }
  
  .col-replies, .col-views {
    display: flex !important;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--forum-muted);
  }
  
  .col-replies .count-number, .col-views .count-number {
    font-weight: 600;
    color: var(--forum-text);
  }
  
  /* Enable collapsible filters on mobile */
  .forum-filters {
    display: none;
    margin-top: 8px;
    animation: slideDown 0.3s ease-out;
  }
  
  .category-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .category-actions-toggle {
    align-self: flex-end;
  }
  
  .category-actions-menu {
    position: static;
    margin-top: 8px;
    width: 100%;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
    gap: 8px;
  }
  
  .category-actions-menu.visible {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
  }
  
  .btn-back,
  .btn-new-thread {
    flex: 1;
    text-align: center;
    justify-content: center;
  }
  
  .forum-filters {
    padding: 14px 16px;
  }
  
  .filter-row {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }
  
  .filter-control {
    width: 100%;
  }
  
  .btn-apply,
  .btn-clear {
    width: 100%;
    justify-self: stretch;
  }

  /* Remove extra bottom spacing for filters on smaller screens */
  .forum-filters-container {
    margin-bottom: 0px;
  }
  
  .filter-info {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    text-align: left;
  }
  
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }
  
  .page-btn {
    min-width: 36px;
    padding: 6px 8px;
  }
}

/* Mobile Large (480px - 639px) */
@media (max-width: 639px) {
  .page article {
    padding: 0.6em 1.188em !important;
    font-family: "Lato", "Open Sans", Helvetica, Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
  }
  
  .forum-section {
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
  }
  
  .forum-container {
    padding: clamp(8px, 2vw, 16px);
  }
  
  .category-header {
    margin-bottom: 14px;
  }
  
  .category-title {
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 0px;
  }
  
  .category-icon {
    font-size: 24px;
  }
  
  .category-text h1 {
    font-size: clamp(18px, 4vw, 24px);
  }
  
  .category-description {
    font-size: 13px;
    line-height: 1.3;
  }
  
  .category-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .btn-back,
  .btn-new-thread {
    width: 100%;
  }
  
  .forum-filters {
    padding: 12px 14px;
    margin-bottom: 16px;
  }
  
  .filter-control {
    padding: 8px 10px;
    font-size: 13px;
  }
  
  .pagination-container {
    margin: 20px 0;
  }
  
  .pagination {
    padding: 6px 8px;
  }
  
  .forum-threads {
    margin: 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }
  
  .col-thread .thread-title h3 {
    font-size: 18px;
  }
  
  .thread-mobile-stats {
    align-items: stretch;
    gap: 12px;
  }
  
  .mobile-vote-actions {
    align-self: center;
    max-width: 200px;
  }
  
  .thread-mobile-stats-right {
    justify-content: center;
    gap: 24px;
  }
  
  .pagination {
    gap: 3px;
  }
  
  .page-btn {
    font-size: 12px;
    padding: 5px 7px;
    min-width: 32px;
  }
  
  .no-threads {
    padding: 40px 16px;
  }
  
  .no-threads h3 {
    font-size: 16px;
  }
  
  .no-threads p {
    font-size: 13px;
  }
}

/* Mobile Small (320px - 479px) */
@media (max-width: 479px) {
  .page article {
    padding: 0.6em 1.188em !important;
    font-family: "Lato", "Open Sans", Helvetica, Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
  }
  
  .forum-section {
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
  }
  
  .forum-container {
    padding: 8px;
  }
  
  .category-header {
    margin-bottom: 12px;
  }
  
  .category-text h1 {
    font-size: clamp(16px, 5vw, 20px);
    line-height: 1.1;
  }
  
  .category-description {
    font-size: 12px;
  }
  
  .category-actions-toggle {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .category-actions-menu.visible {
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
  }
  
  .btn-back,
  .btn-new-thread {
    width: 100%;
    flex: none;
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .forum-filters {
    padding: 10px 12px;
  }
  
  .filter-control {
    padding: 6px 8px;
    font-size: 12px;
  }
  
  .btn-apply,
  .btn-clear {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .filter-info {
    font-size: 11px;
    padding-top: 8px;
    margin-top: 2px;
  }
  
  .forum-threads {
    margin: 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }
  
  .col-thread .thread-title h3 {
    font-size: 16px;
    line-height: 1.2;
  }
  
  .col-author .username {
    font-size: 13px;
  }
  
  .col-author .avatar {
    width: 20px;
    height: 20px;
  }
  
  .thread-mobile-stats {
    gap: 10px;
  }
  
  .mobile-vote-actions {
    align-self: center;
    max-width: 180px;
  }
  
  .mobile-vote-actions .mobile-vote-score-display {
    padding: 6px 12px;
    min-width: 50px;
  }
  
  .mobile-vote-actions .mobile-thread-vote-score {
    font-size: 14px;
  }
  
  .thread-mobile-stats-right {
    justify-content: center;
    gap: 20px;
  }
  
  .col-replies, .col-views {
    font-size: 13px;
  }
  
  .loading-indicator {
    padding: 40px 12px;
  }
  
  .loading-indicator span {
    font-size: 13px;
  }
  
  .spinner {
    width: 28px;
    height: 28px;
    border-width: 2px;
    margin-bottom: 10px;
  }
  
  .pagination {
    padding: 4px 6px;
    gap: 2px;
  }
  
  .page-btn {
    font-size: 11px;
    padding: 4px 6px;
    min-width: 28px;
  }
  
  .page-dots {
    font-size: 11px;
    padding: 0 2px;
  }
  
  .no-threads {
    padding: 30px 12px;
  }
  
  .no-threads h3 {
    font-size: 15px;
  }
  
  .no-threads p {
    font-size: 12px;
  }
  
  .no-threads .btn-new-thread {
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* --- Status Badge Styles (Override/Extend) --- */
.status-badge.solved {
  background: color-mix(in oklab, var(--forum-success) 15%, var(--forum-surface));
  color: var(--forum-success);
}

.status-badge.closed {
  background: color-mix(in oklab, var(--forum-danger) 15%, var(--forum-surface));
  color: var(--forum-danger);
}

/* --- Mobile bottom navigation (icons + labels) --- */
.forum-bottom-nav{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  box-shadow: 0 -4px 18px rgba(0,0,0,0.08);
  background: var(--forum-surface);
}
.forum-bottom-nav .bottom-nav-container{
  display: flex;
  justify-content: space-around;
  padding: 8px 6px;
  border-top: 1px solid rgba(0,0,0,0.06);
  gap: 6px;
}
.forum-bottom-nav .bottom-nav-item{
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: inherit;
  padding: 6px 8px;
  font: inherit;
}
.forum-bottom-nav .bottom-nav-item svg{ display: block; }
.forum-bottom-nav .bottom-nav-label{
  display: block;
  font-size: 10px;
  line-height: 1;
  margin-top: 4px;
  color: var(--forum-muted);
}
.forum-bottom-nav .bottom-nav-item.active .bottom-nav-label{ font-weight: 600; color: var(--forum-accent); }
.forum-bottom-nav .category-shortcuts-overlay{ z-index: 9999; }

/* Ensure the bottom nav is only visible on mobile -> JS also checks viewport */
@media (min-width: 768px){
  .forum-bottom-nav{ display: none !important; }
}

