/* ===== TOPICS PUBLIC PAGE ===== */

.topics-page { background: #f1f5f9; }

/* Banner */
.topics-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
  padding: 48px 0 40px;
  color: #fff;
}
.topics-banner-inner {
  display: flex; align-items: center;
  justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.topics-banner-title {
  font-size: 32px; font-weight: 800; margin: 0 0 6px;
  letter-spacing: -.02em;
}
.topics-banner-sub { margin: 0; font-size: 15px; opacity: .75; }

.topics-banner-stats {
  display: flex; align-items: center; gap: 0;
  background: rgba(255,255,255,.1); border-radius: 14px;
  padding: 16px 24px; backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.15);
}
.banner-stat { text-align: center; padding: 0 20px; }
.banner-stat-num { display: block; font-size: 26px; font-weight: 800; line-height: 1; }
.banner-stat-label { display: block; font-size: 12px; opacity: .7; margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.banner-stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,.2); }

/* Main */
.topics-main { padding: 32px 0 80px; }

/* Toolbar */
.topics-toolbar { margin-bottom: 20px; }
.topics-search-form { display: flex; gap: 10px; align-items: center; }
.search-input-wrap {
  position: relative; flex: 1; max-width: 480px;
  display: flex; align-items: center;
}
.search-icon { position: absolute; left: 14px; font-size: 15px; pointer-events: none; }
.search-input {
  width: 100%; padding: 10px 40px 10px 40px;
  border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff;
  transition: border-color .2s;
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,78,216,.1); }
.search-clear {
  position: absolute; right: 12px; color: var(--muted);
  font-size: 14px; text-decoration: none; line-height: 1;
}
.search-result-info { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* Topics card */
.topics-card {
  background: #fff; border-radius: 16px;
  border: 1.5px solid var(--line);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
}

/* Table head */
.topics-table-head {
  display: grid;
  grid-template-columns: 1fr 140px 80px 80px 100px;
  padding: 10px 20px 10px 52px;
  background: #f8fafc;
  border-bottom: 1.5px solid var(--line);
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}

/* Topic row */
.topic-row-link { display: block; text-decoration: none; color: inherit; }
.topic-row {
  display: grid;
  grid-template-columns: 32px 1fr 140px 80px 80px 100px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s;
  gap: 0;
}
.topic-row-link:last-child .topic-row { border-bottom: none; }
.topic-row:hover { background: #f8faff; }

/* Status dot */
.topic-status { display: flex; justify-content: center; padding-right: 12px; }
.status-dot {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.status-dot.answered { background: #16a34a; }
.status-dot.pending  { background: #e2e8f0; border: 2px solid #cbd5e1; }

/* Topic content */
.tcol-topic { padding-right: 16px; min-width: 0; }
.topic-name {
  font-weight: 700; font-size: 15px; color: var(--text);
  line-height: 1.4; margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topic-row:hover .topic-name { color: var(--primary); }
.topic-excerpt {
  font-size: 13px; color: var(--muted); line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 6px;
}
.topic-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.topic-tag {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 20px; background: #f1f5f9; color: var(--muted);
}
.topic-tag.tag-answered { background: #dcfce7; color: #15803d; }
.topic-tag.tag-pending  { background: #fef9c3; color: #92400e; }

/* User col */
.tcol-meta { padding: 0 8px; }
.topic-user { display: flex; align-items: center; gap: 8px; }
.topic-username { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }

/* Avatar */
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 13px;
  flex-shrink: 0; user-select: none;
}
.avatar-lg { width: 48px; height: 48px; font-size: 20px; }

/* Replies */
.tcol-replies { text-align: center; }
.replies-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; border-radius: 8px;
  font-size: 13px; font-weight: 700;
  background: #f1f5f9; color: var(--muted);
}
.replies-badge.replied { background: #dbeafe; color: var(--primary); }

/* Views */
.tcol-views { text-align: center; }
.views-num { font-size: 13px; color: var(--muted); font-weight: 600; }

/* Activity */
.tcol-activity { text-align: right; }
.activity-ago { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }

/* ===== PUBLIC QUESTION DETAIL ===== */
.pq-main { padding: 32px 0 80px; max-width: 860px; }

.pq-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); margin-bottom: 24px;
}
.pq-breadcrumb a { color: var(--primary); text-decoration: none; }
.pq-breadcrumb a:hover { text-decoration: underline; }

.pq-thread {
  border: 1.5px solid var(--line); border-radius: 16px;
  overflow: hidden; background: var(--card);
  box-shadow: 0 2px 12px rgba(0,0,0,.04);
}

.pq-post {
  display: flex; gap: 0; border-bottom: 1px solid var(--line);
}
.pq-post:last-child { border-bottom: none; }
.pq-answer { background: #f8faff; }

.pq-avatar-col {
  width: 120px; flex-shrink: 0; padding: 24px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border-right: 1px solid var(--line); background: rgba(0,0,0,.015);
}
.pq-username  { font-size: 13px; font-weight: 700; text-align: center; word-break: break-all; }
.pq-role-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.admin-label  { color: var(--primary); }

.pq-content-col { flex: 1; padding: 24px; min-width: 0; }

.pq-title { font-size: 22px; font-weight: 800; margin: 0 0 10px; line-height: 1.3; }
.pq-meta  {
  display: flex; gap: 16px; font-size: 13px; color: var(--muted);
  margin-bottom: 16px; flex-wrap: wrap;
}
.pq-body  { font-size: 15px; line-height: 1.75; }
.pq-body p { margin: 0 0 10px; }
.pq-body p:last-child { margin-bottom: 0; }
.pq-answer-meta { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* Thumbnails */
.pq-thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.pq-thumb {
  width: 160px; height: 120px; object-fit: cover;
  border-radius: 10px; cursor: zoom-in;
  border: 1.5px solid var(--line);
  transition: transform .2s, box-shadow .2s;
}
.pq-thumb:hover { transform: scale(1.04); box-shadow: 0 4px 16px rgba(0,0,0,.15); }

.pq-answers-label {
  padding: 12px 20px; font-size: 13px; font-weight: 700;
  color: var(--muted); background: var(--bg);
  border-bottom: 1px solid var(--line); border-top: 2px solid var(--line);
}
.pq-no-answer {
  padding: 24px 20px; color: var(--muted); font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.pq-cta {
  margin-top: 20px; padding: 16px 20px;
  background: var(--primary-soft); border-radius: 12px;
  font-size: 14px; text-align: center;
}
.pq-cta a { color: var(--primary); font-weight: 700; }

/* Lightbox */
.lightbox-close {
  position: fixed; top: 20px; right: 24px;
  background: rgba(255,255,255,.15); border: none; color: #fff;
  font-size: 22px; width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 1001;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }

/* Responsive */
@media (max-width: 768px) {
  .topics-table-head { display: none; }
  .topic-row {
    grid-template-columns: 28px 1fr;
    grid-template-rows: auto auto;
    gap: 4px;
  }
  .tcol-meta, .tcol-replies, .tcol-views, .tcol-activity { display: none; }
  .topics-banner-stats { display: none; }
  .pq-avatar-col { width: 72px; padding: 16px 10px; }
  .pq-content-col { padding: 16px; }
  .pq-title { font-size: 18px; }
}
