/* ══════════════════════════════════════════════════════════
   Forum / Discussion Board Styles
   ══════════════════════════════════════════════════════════ */

/* ── Layout ─────────────────────────────────────────────── */
.forum-layout {
  display: flex;
  margin-top: 52px;
  min-height: calc(100vh - 52px);
}

/* ── Channel Sidebar ────────────────────────────────────── */
.forum-sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  overflow-y: auto;
  height: calc(100vh - 52px);
  position: sticky;
  top: 52px;
}

.forum-sidebar-header {
  padding: 0 16px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.forum-sidebar-group {
  margin-bottom: 16px;
}

.forum-sidebar-group-label {
  padding: 4px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.forum-channel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  transition: all 0.12s;
  text-decoration: none;
  border-radius: 0;
}

.forum-channel-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.forum-channel-item.active {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  font-weight: 600;
}

.forum-channel-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

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

.forum-channel-badge {
  background: var(--nissan-red);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ── Mobile sidebar toggle ──────────────────────────────── */
.forum-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-size: 18px;
}

.forum-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 149;
}

/* ── Main Content ───────────────────────────────────────── */
.forum-main {
  flex: 1;
  min-width: 0;
  padding: 24px;
  max-width: 960px;
}

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

.forum-content-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.forum-content-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-new-thread {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #1a7f37;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-new-thread:hover {
  background: #15692e;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #fff;
  color: var(--negative);
  border: 1px solid var(--negative);
  border-radius: var(--radius);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-danger:hover {
  background: #fef2f2;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #1a7f37;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-submit:hover {
  background: #15692e;
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Filter Bar ─────────────────────────────────────────── */
.forum-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.forum-filter-select {
  padding: 6px 28px 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%235a5e6a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.forum-filter-select:focus {
  outline: none;
  border-color: var(--border-light);
}

.forum-search-input {
  padding: 6px 10px 6px 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
  min-width: 180px;
  max-width: 300px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b8f9c' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 8px center;
}

.forum-search-input:focus {
  outline: none;
  border-color: var(--border-light);
}

/* ── Thread List ────────────────────────────────────────── */
.forum-thread-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  overflow: hidden;
}

.forum-thread-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  text-decoration: none;
  color: inherit;
}

.forum-thread-row:last-child {
  border-bottom: none;
}

.forum-thread-row:hover {
  background: var(--bg-card-hover);
}

.forum-thread-status {
  flex-shrink: 0;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.forum-thread-body {
  flex: 1;
  min-width: 0;
}

.forum-thread-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.forum-thread-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-thread-row:hover .forum-thread-title {
  color: #0969da;
}

.forum-thread-pin {
  color: var(--text-muted);
  flex-shrink: 0;
}

.forum-thread-lock {
  color: var(--text-muted);
  flex-shrink: 0;
}

.forum-thread-labels {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.forum-thread-excerpt {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-thread-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.forum-thread-replies {
  display: flex;
  align-items: center;
  gap: 4px;
}

.forum-thread-time {
  white-space: nowrap;
}

.forum-thread-author-avatar {
  flex-shrink: 0;
}

/* ── Labels / Pills ─────────────────────────────────────── */
.forum-label {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 18px;
}

/* ── Status Badges ──────────────────────────────────────── */
.status-icon {
  vertical-align: middle;
}

.forum-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.forum-status-badge.status-open { background: #dafbe1; color: #1a7f37; }
.forum-status-badge.status-in_progress { background: #fff3cd; color: #92400e; }
.forum-status-badge.status-resolved { background: #ede9fe; color: #6d28d9; }
.forum-status-badge.status-escalated { background: #fef2f2; color: #dc2626; }
.forum-status-badge.status-closed { background: #f3f4f6; color: #6b7280; }

/* ── Priority Badges ────────────────────────────────────── */
.forum-priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.forum-priority-badge.priority-urgent { background: #fef2f2; color: #dc2626; }
.forum-priority-badge.priority-high { background: #fff7ed; color: #ea580c; }
.forum-priority-badge.priority-normal { background: #f3f4f6; color: #6b7280; }
.forum-priority-badge.priority-low { background: #eff6ff; color: #2563eb; }

/* ── Pagination ─────────────────────────────────────────── */
.forum-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
}

.forum-page-btn {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.12s;
}

.forum-page-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

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

.forum-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Empty State ────────────────────────────────────────── */
.forum-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.forum-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.forum-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.forum-empty-text {
  font-size: 13px;
}

/* ── Loading Skeleton ───────────────────────────────────── */
.forum-skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--border);
}

.forum-skeleton-row:last-child {
  border-bottom: none;
}

.forum-skeleton-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.forum-skeleton-line {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ══════════════════════════════════════════════════════════
   Thread Detail Page
   ══════════════════════════════════════════════════════════ */

/* ── Breadcrumb ─────────────────────────────────────────── */
.forum-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.forum-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.forum-breadcrumb a:hover {
  color: #0969da;
  text-decoration: underline;
}

.forum-breadcrumb-sep {
  color: var(--border-light);
}

/* ── Thread Header ──────────────────────────────────────── */
.forum-thread-detail-layout {
  display: flex;
  gap: 24px;
}

.forum-thread-detail-main {
  flex: 1;
  min-width: 0;
}

.forum-thread-detail-sidebar {
  width: 220px;
  flex-shrink: 0;
}

.forum-thread-header {
  margin-bottom: 24px;
}

.forum-thread-header-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 8px;
}

.forum-thread-header-title .forum-thread-pin,
.forum-thread-header-title .forum-thread-lock {
  vertical-align: middle;
  margin-left: 6px;
}

.forum-thread-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.forum-thread-header-meta .forum-avatar {
  vertical-align: middle;
}

.forum-thread-header-tags {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.forum-thread-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ── Upvote Button ──────────────────────────────────────── */
.forum-upvote-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.forum-upvote-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.forum-upvote-btn.upvoted {
  border-color: #1a7f37;
  color: #1a7f37;
  background: #f0fdf4;
}

.forum-upvote-btn svg {
  width: 14px;
  height: 14px;
}

/* ── Metadata Sidebar ───────────────────────────────────── */
.forum-meta-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  padding: 16px;
}

.forum-meta-item {
  margin-bottom: 14px;
}

.forum-meta-item:last-child {
  margin-bottom: 0;
}

.forum-meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.forum-meta-value {
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Timeline ───────────────────────────────────────────── */
.forum-timeline {
  position: relative;
  padding-left: 56px;
}

.forum-timeline::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.forum-timeline-item {
  position: relative;
  margin-bottom: 16px;
}

.forum-timeline-item:last-child {
  margin-bottom: 0;
}

.forum-timeline-avatar {
  position: absolute;
  left: -56px;
  top: 0;
  z-index: 1;
}

.forum-avatar {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  vertical-align: middle;
  object-fit: cover;
}

.forum-avatar-initials {
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  line-height: 1;
}

.forum-comment-card {
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  overflow: hidden;
}

.forum-comment-card.is-op {
  border-color: var(--border-light);
}

.forum-comment-card.is-solution {
  border-left: 3px solid #1a7f37;
}

.forum-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f6f8fa;
  border-bottom: 0.5px solid var(--border);
  font-size: 13px;
}

.forum-comment-card.is-solution .forum-comment-header {
  background: #f0fdf4;
}

.forum-comment-author {
  font-weight: 600;
  color: var(--text-primary);
}

.forum-comment-time {
  color: var(--text-muted);
  font-size: 12px;
}

.forum-comment-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.forum-comment-badge.op-badge {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}

.forum-comment-badge.solution-badge {
  background: rgba(26, 127, 55, 0.1);
  color: #1a7f37;
}

.forum-comment-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.forum-comment-action-btn {
  padding: 2px 6px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  font-family: 'Outfit', sans-serif;
  transition: all 0.12s;
}

.forum-comment-action-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.forum-comment-body {
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}

.forum-comment-body p {
  margin-bottom: 8px;
}

.forum-comment-body p:last-child {
  margin-bottom: 0;
}

.forum-comment-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  background: #f3f4f6;
  padding: 2px 5px;
  border-radius: 4px;
}

.forum-comment-body pre {
  background: #f6f8fa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  overflow-x: auto;
  margin: 8px 0;
}

.forum-comment-body pre code {
  background: none;
  padding: 0;
}

.forum-comment-body blockquote {
  border-left: 3px solid var(--border);
  padding-left: 12px;
  color: var(--text-secondary);
  margin: 8px 0;
}

.forum-comment-body img {
  max-width: 100%;
  border-radius: var(--radius);
}

.forum-comment-body ul,
.forum-comment-body ol {
  padding-left: 20px;
  margin: 8px 0;
}

.forum-comment-deleted {
  padding: 16px 12px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 13px;
}

/* ── Nested replies ─────────────────────────────────────── */
.forum-timeline-nested {
  margin-left: 24px;
  margin-top: 12px;
  position: relative;
  padding-left: 44px;
}

.forum-timeline-nested::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.forum-timeline-nested .forum-timeline-avatar {
  left: -44px;
}

/* ── Inline Reply Composer ──────────────────────────────── */
.forum-inline-reply {
  margin-top: 8px;
  margin-left: 24px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
}

/* ── Reply Composer ─────────────────────────────────────── */
.forum-composer {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  overflow: hidden;
}

.forum-composer-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.forum-composer-tab {
  padding: 8px 16px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.12s;
}

.forum-composer-tab:hover {
  color: var(--text-primary);
}

.forum-composer-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

.forum-composer-body {
  padding: 12px;
}

.forum-composer-textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  resize: vertical;
  line-height: 1.5;
}

.forum-composer-textarea:focus {
  outline: none;
  border-color: var(--border-light);
}

.forum-composer-preview {
  min-height: 120px;
  padding: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  display: none;
}

.forum-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: #f6f8fa;
}

.forum-composer-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.forum-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.12s;
}

.forum-attach-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.forum-markdown-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════
   Modal
   ══════════════════════════════════════════════════════════ */
.forum-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 500;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 16px;
  overflow-y: auto;
}

.forum-modal-overlay.open {
  display: flex;
}

.forum-modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  overflow: hidden;
}

.forum-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.forum-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.forum-modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  font-size: 18px;
}

.forum-modal-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.forum-modal-body {
  padding: 20px;
}

.forum-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: #f6f8fa;
}

/* ── Form Fields ────────────────────────────────────────── */
.forum-form-group {
  margin-bottom: 16px;
}

.forum-form-group:last-child {
  margin-bottom: 0;
}

.forum-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.forum-form-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
}

.forum-form-input:focus {
  outline: none;
  border-color: var(--border-light);
}

.forum-tag-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.forum-tag-checkbox {
  display: none;
}

.forum-tag-checkbox-label {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
}

.forum-tag-checkbox-label:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.forum-tag-checkbox:checked + .forum-tag-checkbox-label {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}

.forum-file-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.forum-file-upload:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

/* ══════════════════════════════════════════════════════════
   Toast
   ══════════════════════════════════════════════════════════ */
#toastContainer {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--text-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  animation: toast-in 0.25s ease-out;
}

.toast-success { background: #059669; }
.toast-error { background: #dc2626; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .forum-sidebar {
    position: fixed;
    left: -260px;
    top: 52px;
    z-index: 150;
    width: 240px;
    height: calc(100vh - 52px);
    transition: left 0.25s ease;
  }

  .forum-sidebar.open {
    left: 0;
  }

  .forum-sidebar-toggle {
    display: flex;
  }

  .forum-sidebar-overlay.open {
    display: block;
  }

  .forum-main {
    padding: 16px;
  }

  .forum-thread-detail-layout {
    flex-direction: column-reverse;
  }

  .forum-thread-detail-sidebar {
    width: 100%;
  }

  .forum-thread-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .forum-content-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .forum-timeline {
    padding-left: 44px;
  }

  .forum-timeline::before {
    left: 13px;
  }

  .forum-timeline-avatar {
    left: -44px;
  }

  .forum-thread-header-title {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .forum-main {
    padding: 12px;
  }

  .forum-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .forum-filter-select,
  .forum-search-input {
    width: 100%;
    max-width: none;
  }

  .forum-thread-row {
    padding: 10px 12px;
  }

  .forum-thread-meta {
    display: none;
  }

  .forum-thread-title {
    font-size: 13px;
  }

  .forum-timeline {
    padding-left: 36px;
  }

  .forum-timeline::before {
    left: 11px;
  }

  .forum-timeline-avatar {
    left: -36px;
  }

  .forum-comment-body {
    font-size: 13px;
    padding: 10px;
  }

  .forum-composer-textarea {
    min-height: 80px;
  }

  .forum-modal {
    margin: 0;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .forum-modal-overlay {
    padding: 40px 0 0;
    align-items: flex-end;
  }
}

/* ── Attachments ─────────────────────────────────────── */
.forum-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 4px;
  border-top: 0.5px solid var(--border);
  margin-top: 8px;
}

.forum-attachment-image {
  display: inline-block;
  max-width: 280px;
}

.forum-attachment-image img {
  display: block;
  transition: opacity 0.15s;
}

.forum-attachment-image:hover img {
  opacity: 0.85;
}

.forum-attachment-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s;
}

.forum-attachment-file:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ── Contributors ────────────────────────────────────── */
.forum-contributors {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.forum-contributors .forum-avatar,
.forum-contributors .forum-avatar-initials {
  border-radius: 50%;
  cursor: default;
}

.forum-contributors span {
  transition: transform 0.1s;
}

.forum-contributors span:hover {
  transform: scale(1.15);
  z-index: 1;
}

/* ── Typing Indicator ────────────────────────────────── */
.forum-typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.typing-dots {
  display: flex;
  gap: 3px;
  align-items: center;
}

.typing-dots span {
  width: 5px;
  height: 5px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* ── Notification Bell Dropdown ──────────────────────── */
.notif-dropdown {
  position: absolute;
  top: 44px;
  right: 0;
  width: 340px;
  max-height: 420px;
  background: var(--bg-secondary);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  overflow-y: auto;
  z-index: 200;
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text-primary);
  border-bottom: 0.5px solid var(--border);
  transition: background 0.1s;
}

.notif-item:hover {
  background: var(--bg-card-hover);
}

.notif-item.notif-unread {
  background: rgba(37, 99, 235, 0.04);
}

.notif-item-avatar {
  flex-shrink: 0;
}

.notif-item-content {
  flex: 1;
  min-width: 0;
}

.notif-item-title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-item-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.notif-footer {
  padding: 8px 14px;
  text-align: center;
  border-top: 0.5px solid var(--border);
}

.notif-mark-all {
  border: none;
  background: none;
  color: #0969da;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.notif-mark-all:hover {
  background: rgba(9, 105, 218, 0.08);
}

/* ── @Mentions in rendered content ────────────────────── */
.mention,
.forum-comment-body .mention {
  color: #0969da;
  font-weight: 500;
  background: rgba(9, 105, 218, 0.08);
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}

/* ── @Mention Autocomplete ───────────────────────────── */
.mention-dropdown {
  position: fixed;
  width: 280px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  z-index: 999;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 0.5px solid var(--border);
}

.mention-item:last-child {
  border-bottom: none;
}

.mention-item:hover,
.mention-item.active {
  background: #dbeafe;
}

.mention-item .forum-avatar,
.mention-item .forum-avatar-initials {
  width: 24px !important;
  height: 24px !important;
  font-size: 10px !important;
  flex-shrink: 0;
  border-radius: 50%;
}

.mention-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.mention-name {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mention-email {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
