/* ===========================
   Mini Forum — Hub Styles
   Filename: assets/forum-hub.css
   =========================== */

/* Shared variables, color-scheme and other base rules were moved to
   css/forum-common.css to reduce duplication across forum pages. */

/* Base layout (container, topbar) moved to css/forum-common.css; keep
   page-specific overrides below (for example responsive tweaks). */

/* Desktop: align the filters container inline with the H1 */
@media (min-width: 768px) {
  .forum-topbar {
    display: flex;
    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 layout is now centrally defined in css/forum-common.css.
   Keep only hub-specific filter overrides in this file. */

.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, last post and actions columns on mobile */
  .col-category, .col-lastpost, .col-actions {
      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: 2px;
  }
  
  /* 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;
  }
  
  /* Author info moved to thread-main */
  .thread-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }
  
  .thread-meta.avatar-sm {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--forum-border);
    flex-shrink: 0;
  }
  
  .thread-author-info .avatar-placeholder-sm {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #888;
    flex-shrink: 0;
  }
  
  .thread-author-info .username {
    font-size: 12px;
    font-weight: 500;
    color: var(--forum-text-muted, #666);
    text-decoration: none;
  }
  
  .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: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--forum-muted);
    flex-wrap: wrap;
  }
  
  .col-thread .thread-meta .avatar-sm {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--forum-border);
    flex-shrink: 0;
  }
  
  .col-thread .thread-meta .avatar-placeholder-sm {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #888;
    flex-shrink: 0;
  }
  
  .col-thread .thread-meta .username {
    font-size: 12px;
    font-weight: 500;
    color: var(--forum-text-muted, #666);
    text-decoration: none;
  }
  
  .col-thread .thread-meta .username:hover {
    color: var(--forum-accent);
  }
  
  .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;
  }
  
  /* 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).
     These rules are scoped to .thread-mobile-stats to avoid affecting desktop grid.
  */
  .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: ensure they behave as non-flexible inline items on mobile */
  .thread-mobile-stats .col-replies,
  .thread-mobile-stats .col-views,
  .thread-mobile-stats .mobile-share-action {
    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;
  }
}

/* --- Threads list --- */
/* Threads container styling handled in css/forum-common.css. */

/* Column headers - Visible on desktop, hidden on mobile */
/* Header grid is shared; moved to css/forum-common.css. */

/* Desktop thread grid/layout rules are defined in css/forum-common.css. */

/* Box-sizing and header alignment moved to css/forum-common.css. */

/* Column placement for the grid is shared in css/forum-common.css. */

/* 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: row;
  align-items: center;
  gap: 8px;
}

.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 */
}

/* Actions column styling */
.col-actions{
  display: flex;
  align-items: center;
  justify-content: center;
}

/* .btn-share styling was moved to css/forum-common.css; keep hub-specific
   visual tweaks here only if needed. */

/* 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;
  }
  
  /* Author info in thread-main for desktop */
  .thread-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--forum-border-light, #e5e5e5);
  }
  
  .thread-author-info .avatar-sm {
    width: 24px;
    height: 24px;
  }
  
  .thread-author-info .username {
    font-size: 13px;
  }
}

.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;
}

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

/* count-number is a shared utility; rule moved to css/forum-common.css. */

/* Last post column */

/* Ensure last post column aligns properly in grid */
@media (min-width: 768px) {
  .thread-row > .col-lastpost{
    display: flex;
    justify-content: center;
    align-items: 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; }
}

/* --- 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; }
}

/* --- 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;
}

/* Update existing #forum-threads to work with new class-based sections */
.forum-threads {
  margin: 16px 0 18px 0;
  background: var(--forum-surface);
  border-radius: var(--forum-radius);
  box-shadow: var(--forum-shadow);
  overflow: hidden;
  border: 1px solid var(--forum-border);
}

/* 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;
  }
}

