/**
 * yam.tf - Forum Stylesheet (Team Fortress 2 Theme)
 * Integrates directly with TF2 / Mann Co design tokens
 */

/* ==========================================================================
   Forum Main Container & Navigation
   ========================================================================== */

.forum-section {
  padding: 2.25rem 0 3.5rem;
  border-top: 2px solid var(--color-border);
  background-color: var(--color-bg-main);
  scroll-margin-top: 76px;
}

#forum-spa-mount {
  min-height: 420px;
  scroll-margin-top: 76px;
}

.forum-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  scroll-margin-top: 76px;
}

.forum-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.forum-breadcrumbs a {
  color: var(--color-tf-gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.forum-breadcrumbs a:hover {
  color: var(--color-text-white);
  text-decoration: underline;
}

.forum-breadcrumbs .crumb-sep {
  color: var(--color-border);
}

.forum-breadcrumbs .current-crumb {
  color: var(--color-text-primary);
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* User Auth Bar in Header */
.auth-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
}

.auth-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  border: 1px solid var(--color-border);
}

.auth-user-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-primary);
}

.btn-steam-login {
  background-color: #171a21;
  border-color: #2a475e;
  color: #c7d5e0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-steam-login:hover {
  background-color: #222b35;
  border-color: #66c0f4;
  color: #ffffff;
}

/* ==========================================================================
   Category & Board Overview
   ========================================================================== */

.forum-categories-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.category-card {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.category-header {
  background-color: var(--color-bg-header);
  border-bottom: 2px solid var(--color-border);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.category-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.boards-table {
  width: 100%;
  border-collapse: collapse;
}

.boards-table th {
  background-color: var(--color-bg-elevated);
  padding: 0.5rem 1rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.boards-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--color-border-subtle);
  vertical-align: middle;
}

.boards-table tr:last-child td {
  border-bottom: none;
}

.boards-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

.board-info-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.board-title-link {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-text-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color var(--transition-fast);
}

.board-title-link:hover {
  color: var(--color-tf-gold);
  text-decoration: none;
}

.board-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.35;
}

.board-stats-cell {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
  width: 140px;
}

.board-stats-cell .stat-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--color-text-primary);
}

.board-last-post-cell {
  width: 280px;
  font-size: 0.85rem;
}

.last-post-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.last-post-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.last-post-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.last-post-title {
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.last-post-title:hover {
  color: var(--color-tf-gold);
}

.last-post-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 1px;
}

/* ==========================================================================
   Board Thread List View
   ========================================================================== */

.board-header-box {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  scroll-margin-top: 76px;
}

.board-header-info h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-white);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.board-header-info p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 0 0;
}

.threads-table-wrap {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  overflow-x: auto;
}

.threads-table {
  width: 100%;
  border-collapse: collapse;
}

.threads-table th {
  background-color: var(--color-bg-header);
  padding: 0.65rem 1rem;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  text-align: left;
  border-bottom: 2px solid var(--color-border);
}

.threads-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--color-border-subtle);
  vertical-align: middle;
}

.threads-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

.threads-table tr.pinned-row {
  background-color: rgba(77, 122, 151, 0.08);
}

.threads-table tr.pinned-row:hover td {
  background-color: rgba(77, 122, 151, 0.14);
}

.thread-title-link {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.thread-title-link:hover {
  color: var(--color-tf-gold);
}

.thread-creator-line {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==========================================================================
   Thread View & Posts Stream
   ========================================================================== */

.thread-header-card {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  scroll-margin-top: 76px;
}

.thread-header-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--color-text-white);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.posts-stream {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.post-card {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  display: grid;
  grid-template-columns: 200px 1fr;
  transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  position: relative;
  scroll-margin-top: 76px;
}

@keyframes postHighlightPulse {
  0% {
    border-color: var(--color-tf-gold);
    background-color: rgba(216, 150, 53, 0.28);
    box-shadow: 0 0 0 2px rgba(216, 150, 53, 0.45), 0 0 24px rgba(216, 150, 53, 0.35);
  }
  40% {
    border-color: var(--color-tf-gold);
    background-color: rgba(216, 150, 53, 0.18);
    box-shadow: 0 0 0 2px rgba(216, 150, 53, 0.3), 0 0 16px rgba(216, 150, 53, 0.2);
  }
  100% {
    border-color: var(--color-border);
    background-color: var(--color-bg-card);
    box-shadow: none;
  }
}

.post-card.highlight-flash {
  animation: postHighlightPulse 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.post-author-sidebar {
  background-color: var(--color-bg-header);
  border-right: 1px solid var(--color-border);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.post-author-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  border: 2px solid var(--color-border);
}

.post-author-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-text-white);
  word-break: break-word;
}

.post-content-wrap {
  display: flex;
  flex-direction: column;
}

.post-header-meta {
  padding: 0.6rem 1rem;
  background-color: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.post-meta-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-number-badge {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.post-meta-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.post-body {
  padding: 1.25rem;
  color: var(--color-text-primary);
  font-size: 0.95rem;
  line-height: 1.6;
  word-break: break-word;
  min-height: 80px;
}

.post-body p {
  margin: 0 0 0.85rem 0;
}

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

.post-body blockquote {
  border-left: 3px solid var(--color-tf-gold);
  padding: 0.4rem 0.8rem;
  margin: 0.6rem 0;
  background-color: rgba(231, 181, 59, 0.08);
  color: var(--color-text-secondary);
}

.post-body code {
  font-family: var(--font-mono);
  background-color: var(--color-bg-main);
  border: 1px solid var(--color-border-subtle);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-xs);
  font-size: 0.88em;
  color: #e6a87c;
}

.post-body pre {
  background-color: var(--color-bg-main);
  border: 1px solid var(--color-border);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-xs);
  overflow-x: auto;
  margin: 0.6rem 0;
}

.post-body pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--color-text-primary);
}

.post-body a {
  color: var(--color-tf-gold);
  text-decoration: underline;
}

.post-body a:hover {
  color: var(--color-text-white);
}

/* ==========================================================================
   4chan / Textboard Style Quote References & Backlinks
   ========================================================================== */

.post-quote-ref {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.9em;
  color: var(--color-tf-gold) !important;
  text-decoration: none !important;
  background-color: rgba(216, 150, 53, 0.12);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(216, 150, 53, 0.3);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.post-quote-ref:hover {
  background-color: rgba(216, 150, 53, 0.25);
  border-color: var(--color-tf-gold);
  color: #ffc97a !important;
}

.post-backlinks-bar {
  padding: 0.4rem 1rem;
  background-color: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--color-border-subtle);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.post-backlink {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.85em;
  color: var(--color-tf-gold);
  text-decoration: none;
  cursor: pointer;
}

.post-backlink:hover {
  color: var(--color-text-white);
  text-decoration: underline;
}

/* Floating Quote Hover Preview Popover */
.quote-hover-popover {
  position: fixed;
  z-index: 3000;
  max-width: 440px;
  background-color: var(--color-bg-card);
  border: 2px solid var(--color-tf-gold);
  border-radius: var(--radius-xs);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85);
  padding: 0.85rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quote-hover-popover.visible {
  opacity: 1;
}

.popover-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.4rem;
}

.popover-avatar {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
}

.popover-body {
  font-size: 0.88rem;
  color: var(--color-text-primary);
  max-height: 180px;
  overflow: hidden;
  line-height: 1.4;
}

/* ==========================================================================
   Markdown WYSIWYG Editor
   ========================================================================== */

.forum-editor-box {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  overflow: hidden;
  margin-top: 1.5rem;
}

.editor-header-bar {
  background-color: var(--color-bg-header);
  border-bottom: 1px solid var(--color-border);
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.editor-tool-btn {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  border-radius: var(--radius-xs);
  padding: 0.3rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  transition: all var(--transition-fast);
}

.editor-tool-btn:hover {
  background-color: var(--color-bg-elevated);
  border-color: var(--color-tf-gold);
  color: var(--color-text-white);
}

.editor-tool-btn.active {
  background-color: var(--color-tf-blu-dark);
  border-color: var(--color-tf-blu);
  color: var(--color-text-white);
}

.editor-tabs {
  display: inline-flex;
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.editor-tab-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
}

.editor-tab-btn.active {
  background-color: var(--color-bg-card);
  color: var(--color-tf-gold);
}

.editor-textarea {
  width: 100%;
  min-height: 160px;
  background-color: var(--color-bg-card);
  border: none;
  outline: none;
  padding: 1rem;
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
}

.editor-preview-pane {
  min-height: 160px;
  padding: 1rem;
  background-color: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--color-border-subtle);
  overflow-y: auto;
}

.editor-footer-bar {
  background-color: var(--color-bg-header);
  border-top: 1px solid var(--color-border);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.char-counter {
  font-family: 'JetBrains Mono', monospace;
}

.char-counter.limit-near {
  color: var(--color-tf-gold);
}

.char-counter.limit-exceeded {
  color: var(--color-tf-red);
}

/* ==========================================================================
   Admin Management Panel & Controls
   ========================================================================== */

.admin-panel {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.admin-section-box {
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-section-box h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-tf-gold);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-ban-evasion-box {
  border-left: 4px solid var(--color-tf-red);
  background: linear-gradient(180deg, rgba(184, 56, 50, 0.08) 0%, var(--color-bg-elevated) 100%);
  margin-bottom: 1.5rem;
}

.pulsing-alert-dot {
  width: 10px;
  height: 10px;
  background-color: var(--color-tf-red);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--color-tf-red);
  animation: pulse-red 1.8s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px var(--color-tf-red); }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.ban-evasion-card {
  background-color: var(--color-bg-main);
  border: 1px solid rgba(184, 56, 50, 0.4);
  border-radius: var(--radius-xs);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color var(--transition-fast);
}

.ban-evasion-card:hover {
  border-color: var(--color-tf-red);
}

.ban-evasion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: 0.5rem;
}

.ban-evasion-columns {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.ban-evasion-side {
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ban-evasion-link-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  color: var(--color-tf-red);
  font-weight: 700;
  font-size: 0.8rem;
}

.ban-evasion-empty {
  background-color: var(--color-bg-main);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xs);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-online);
  font-size: 0.9rem;
}

.ip-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: var(--color-tf-gold);
}

@media (max-width: 768px) {
  .ban-evasion-columns {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 768px) {
  .post-card {
    grid-template-columns: 1fr;
  }

  .post-author-sidebar {
    flex-direction: row;
    justify-content: flex-start;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding: 0.6rem 0.85rem;
  }

  .post-author-avatar {
    width: 38px;
    height: 38px;
  }

  .boards-table th:nth-child(2),
  .boards-table td:nth-child(2),
  .boards-table th:nth-child(3),
  .boards-table td:nth-child(3) {
    display: none;
  }

  .threads-table th:nth-child(3),
  .threads-table td:nth-child(3),
  .threads-table th:nth-child(4),
  .threads-table td:nth-child(4) {
    display: none;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Attached Images & Thumbnails
   ========================================================================== */

.post-image-attachment {
  margin: 0.75rem 0;
  display: inline-block;
  max-width: 100%;
}

.post-img-link {
  display: inline-block;
  cursor: zoom-in;
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-elevated);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  line-height: 0;
}

.post-img-link:hover {
  transform: scale(1.01);
  border-color: var(--color-tf-gold);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.post-thumbnail-img {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  display: block;
}

.post-body img:not(.post-thumbnail-img) {
  max-width: 100%;
  max-height: 500px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-border);
  margin: 0.5rem 0;
  cursor: zoom-in;
  display: block;
}

/* ==========================================================================
   Attached Videos & Responsive HTML5 Player
   ========================================================================== */

.post-video-container {
  margin: 0.85rem 0;
  max-width: 100%;
  width: 100%;
  max-width: 760px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000000;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.post-video {
  width: 100%;
  max-width: 100%;
  max-height: 520px;
  height: auto;
  display: block;
  object-fit: contain;
  background: #000000;
  outline: none;
}

.youtube-embed-container {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: 0.85rem 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000000;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.youtube-embed-container:hover {
  border-color: var(--color-border-hover, #4a4a4a);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
}

.youtube-embed-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

/* Fallback for older browsers without aspect-ratio support */
@supports not (aspect-ratio: 16 / 9) {
  .youtube-embed-wrapper {
    padding-top: 56.25%;
    height: 0;
  }
  .youtube-embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
  }
}

.youtube-player {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.popover-body .youtube-embed-container {
  display: none;
}

/* ==========================================================================
   Editor Image/Video Upload, Dropzone & Attached Media Tray
   ========================================================================== */

.editor-content-area {
  position: relative;
}

.editor-dropzone-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(18, 22, 28, 0.92);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}

.dropzone-box {
  border: 2px dashed var(--color-tf-gold);
  border-radius: var(--radius-sm);
  padding: 2rem 3rem;
  text-align: center;
  background: rgba(231, 181, 59, 0.08);
}

.editor-images-tray {
  padding: 0.6rem 1rem;
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
}

.images-tray-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.images-tray-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.image-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: 0.25rem 0.5rem;
  max-width: 260px;
}

.image-chip-thumb {
  width: 28px;
  height: 28px;
  border-radius: 2px;
  object-fit: cover;
  border: 1px solid var(--color-border-subtle);
}

.image-chip-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.image-chip-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-chip-size {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.btn-remove-image-chip {
  background: transparent;
  border: none;
  color: var(--color-tf-red);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.btn-remove-image-chip:hover {
  opacity: 1;
  color: #ff5555;
}

.video-chip {
  border-color: rgba(229, 149, 0, 0.4);
  background: rgba(229, 149, 0, 0.08);
}

.video-chip-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.btn-remove-video-chip {
  background: transparent;
  border: none;
  color: var(--color-tf-red);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.btn-remove-video-chip:hover {
  opacity: 1;
  color: #ff5555;
}

/* ==========================================================================
   Full-Screen Gallery Lightbox Modal
   ========================================================================== */

.forum-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 10, 14, 0.94);
  backdrop-filter: blur(8px);
}

.lightbox-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.lightbox-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  color: var(--color-text-white);
  z-index: 10;
}

.lightbox-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lightbox-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-tf-gold);
}

.lightbox-filename {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-text-primary);
  max-width: 50vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-lightbox-close {
  font-size: 1.75rem;
  line-height: 1;
  color: var(--color-text-white);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-xs);
  padding: 0.15rem 0.6rem;
  cursor: pointer;
}

.btn-lightbox-close:hover {
  background: rgba(220, 53, 69, 0.8);
  border-color: #dc3545;
  color: #fff;
}

.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 0 1rem;
  overflow: hidden;
  user-select: none;
}

.lightbox-image-wrap {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
  transition: opacity var(--transition-fast);
}

.lightbox-arrow {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-text-white);
  font-size: 2.5rem;
  line-height: 1;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 5;
}

.lightbox-arrow:hover {
  background: var(--color-tf-gold);
  border-color: var(--color-tf-gold);
  color: #000;
  transform: scale(1.1);
}

.lightbox-arrow-prev {
  margin-left: 0.5rem;
}

.lightbox-arrow-next {
  margin-right: 0.5rem;
}

.lightbox-spinner {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(231, 181, 59, 0.2);
  border-top-color: var(--color-tf-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
