/* FORUM + MESSAGES */
.forum-layout,
.messages-layout {
  display: grid;
  gap: 20px;
}

.forum-layout {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
}

.messages-layout {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  align-items: start;
}

.forum-page-shell {
  width: min(1240px, calc(100% - 32px));
}

.forum-page-shell--topic {
  width: min(1180px, calc(100% - 32px));
}

.forum-strip-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px 24px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(18, 22, 42, 0.92), rgba(8, 10, 24, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.forum-strip-head__eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.forum-strip-head__eyebrow a {
  color: inherit;
  text-decoration: none;
}

.forum-strip-head__eyebrow a:hover {
  color: var(--text);
}

.forum-strip-head h1,
.forum-create-panel h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.forum-strip-head p,
.forum-create-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.forum-strip-head__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, auto));
  gap: 14px;
  align-self: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  text-align: right;
}

.forum-strip-head__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.forum-board,
.forum-create-panel,
.forum-posts,
.thread-card,
.empty-state-card {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.forum-board::before,
.forum-create-panel::before,
.forum-posts::before,
.thread-card::before,
.empty-state-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.03) 24%, transparent 48%);
  opacity: 0.7;
}

.forum-board > *,
.forum-create-panel > *,
.forum-posts > * {
  position: relative;
  z-index: 1;
}

.forum-board {
  padding: 0;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 20px 60px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* EGYSÉGES OSZLOPSZERKEZET */
.forum-board__header,
.forum-board__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 130px 280px;
  gap: 16px;
  align-items: center;
}

.forum-board__header {
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* Fejléc igazítás az adatoszlopokhoz */
.forum-board__header > :nth-child(1) {
  text-align: left;
}

.forum-board__header > :nth-child(2),
.forum-board__header > :nth-child(3) {
  text-align: right;
}

.forum-board__header > :nth-child(4) {
  text-align: left;
}

.forum-board__header--topics,
.forum-board__row--topics {
  grid-template-columns: minmax(0, 1fr) 110px 280px;
}

.forum-board__header--topics > :nth-child(1) {
  text-align: left;
}

.forum-board__header--topics > :nth-child(2) {
  text-align: right;
}

.forum-board__header--topics > :nth-child(3) {
  text-align: left;
}

.forum-board__row {
  padding: 16px 18px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition:
    background 0.2s ease,
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  cursor: pointer;
}

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

.forum-board__row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.forum-board__row:hover .forum-board__main h2,
.forum-board__row:hover .forum-topic-title-row h2 {
  color: #a983ff;
}

.forum-board__main {
  min-width: 0;
}

.forum-board__main h2 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 700;
  transition: color 0.2s ease;
}

.forum-board__main p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
  opacity: 0.9;
}

.forum-board__number {
  font-size: 15px;
  font-weight: 800;
  color: #eef3ff;
  text-align: right;
  justify-self: end;
  white-space: nowrap;
}

.forum-board__last {
  display: grid;
  gap: 3px;
  justify-items: start;
  min-width: 0;
}

.forum-board__last strong {
  font-size: 13px;
  color: #79b4ff;
  line-height: 1.25;
}

.forum-board__last span {
  font-size: 13px;
  color: var(--text);
  opacity: 0.8;
  line-height: 1.3;
}

.forum-board__last small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

.forum-board__empty {
  padding: 26px 20px;
}

.forum-board__empty h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.forum-board__empty p {
  margin: 0;
  color: var(--muted);
}

.forum-topic-title-row,
.forum-meta-row,
.post-card__meta,
.thread-card__top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.forum-topic-title-row h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  transition: color 0.2s ease;
}

.forum-create-panel {
  padding: 24px;
}

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

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.stack-form input,
.stack-form textarea,
.stack-form select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 8, 20, 0.88);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.stack-form input:focus,
.stack-form textarea:focus,
.stack-form select:focus {
  border-color: rgba(148, 102, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(148, 102, 255, 0.12), var(--glow-purple);
  background: rgba(10, 10, 24, 0.96);
}

.stack-form textarea {
  resize: vertical;
  min-height: 120px;
}

.forum-create-form__actions {
  display: flex;
  justify-content: flex-end;
}

.form-errors {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 79, 216, 0.1);
  border: 1px solid rgba(255, 79, 216, 0.2);
}

.form-errors p {
  margin: 0;
}

.forum-post-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.forum-post-user {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.025);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.forum-post-user strong {
  font-size: 14px;
  line-height: 1.2;
}

.forum-post-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 79, 216, 0.92), rgba(77, 163, 255, 0.92));
  box-shadow: 0 0 24px rgba(139, 93, 255, 0.18);
}

.forum-post-user__meta {
  font-size: 12px;
  color: var(--muted-2);
}

.forum-post-content {
  display: grid;
  gap: 14px;
  padding: 20px 22px;
}

.forum-post-content__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.forum-post-content__body,
.post-card__body {
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.post-card--self {
  border-color: rgba(77, 163, 255, 0.24);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(77, 163, 255, 0.08) inset,
    0 0 24px rgba(77, 163, 255, 0.08);
}

.thread-list {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.thread-card {
  display: grid;
  gap: 8px;
  color: inherit;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.thread-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 93, 255, 0.22);
  box-shadow:
    0 22px 42px rgba(0, 0, 0, 0.24),
    0 0 20px rgba(139, 93, 255, 0.08);
}

.thread-card--active {
  border-color: rgba(139, 93, 255, 0.36);
  box-shadow:
    0 0 0 1px rgba(139, 93, 255, 0.22) inset,
    0 18px 42px rgba(0, 0, 0, 0.24),
    0 0 22px rgba(139, 93, 255, 0.12);
  background: linear-gradient(180deg, rgba(139, 93, 255, 0.09), rgba(255, 255, 255, 0.025));
}

.thread-card__participants {
  color: var(--muted);
  font-size: 13px;
}

.messages-main,
.messages-sidebar {
  display: grid;
  gap: 16px;
  align-content: start;
}

@media (max-width: 980px) {
  .forum-strip-head,
  .forum-board__header,
  .forum-board__row,
  .forum-board__header--topics,
  .forum-board__row--topics {
    grid-template-columns: 1fr;
  }

  .forum-strip-head__stats {
    grid-template-columns: repeat(3, auto);
    text-align: left;
  }

  .forum-board__header {
    display: none;
  }

  .forum-board__row {
    gap: 10px;
  }

  .forum-board__number {
    text-align: left;
    justify-self: start;
    font-size: 14px;
    color: var(--muted);
  }

  .forum-board__last {
    justify-items: start;
  }

  .forum-post-row {
    grid-template-columns: 1fr;
  }

  .forum-post-user {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
}

@media (max-width: 768px) {
  .forum-page-shell,
  .forum-page-shell--topic {
    width: min(100%, calc(100% - 20px));
  }

  .forum-strip-head,
  .forum-create-panel {
    padding: 18px;
  }

  .forum-board__row,
  .forum-board__empty,
  .forum-post-content,
  .forum-post-user {
    padding: 16px;
  }

  .forum-strip-head h1,
  .forum-create-panel h2 {
    font-size: 24px;
  }
}