.forum-rdx {
  --rdx-surface: #ffffff;
  --rdx-surface-alt: #fcfcfd;
  --rdx-text: #3e3f5e;
  --rdx-text-muted: #8f91ac;
  --rdx-border: #eaeaf5;
  --rdx-accent: #00c7d9;
  --rdx-accent-soft: rgba(0, 199, 217, 0.14);
  --rdx-accent-soft-strong: rgba(0, 199, 217, 0.22);
  --rdx-count-fill: #00a8bf;
  --rdx-active-border: rgba(97, 93, 250, 0.24);
  --rdx-shadow: 0 0 40px 0 rgba(94, 92, 154, 0.08);
  --rdx-violet: #615dfa;
  --rdx-violet-strong: #504be5;
  --rdx-violet-soft: rgba(97, 93, 250, 0.14);
  --rdx-violet-ring: rgba(97, 93, 250, 0.2);
  --rdx-composer-shadow: 0 22px 48px rgba(94, 92, 154, 0.12);
  --rdx-composer-shadow-soft: 0 12px 28px rgba(94, 92, 154, 0.08);
}

.forum-rdx .section-banner {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: var(--rdx-shadow);
}

.forum-rdx .section-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(30, 31, 57, 0.26), rgba(97, 93, 250, 0.14));
  pointer-events: none;
}

.forum-rdx .section-banner-title,
.forum-rdx .section-banner-text {
  position: relative;
  z-index: 2;
}

.forum-rdx .section-filters-bar {
  border-radius: 14px;
  box-shadow: var(--rdx-shadow);
}

.forum-rdx .section-filters-bar .button {
  border-radius: 10px;
}

.forum-rdx-index .table.table-forum,
.forum-rdx-index .table.table-forum-category,
.forum-rdx-category .forum-rdx-discussion-shell {
  border-radius: 14px;
  overflow: hidden;
  background: var(--rdx-surface);
  box-shadow: var(--rdx-shadow);
}

.forum-rdx-index .table .table-header,
.forum-rdx-category .forum-rdx-discussion-head {
  background: var(--rdx-surface-alt);
}

.forum-rdx-index .table .table-row {
  transition: background-color 0.2s ease;
}

.forum-rdx-index .table .table-row:hover {
  background-color: #f8f9ff;
}

.forum-rdx-index .forum-category-info .forum-category-title a {
  font-weight: 700;
}

.forum-rdx-index .forum-category-info .forum-category-text {
  color: var(--rdx-text-muted);
}

html[dir="ltr"] .forum-rdx-index .table.table-forum-category .table-header-column:first-child,
html[dir="ltr"] .forum-rdx-index .table.table-forum-category .table-column:first-child {
  padding-left: 36px;
}

html[dir="ltr"] .forum-rdx-index .forum-category {
  justify-content: flex-start;
  text-align: left;
}

html[dir="ltr"] .forum-rdx-index .forum-category > a:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-right: 18px;
  border-radius: 14px;
  background: var(--rdx-accent-soft);
  color: var(--rdx-count-fill);
  text-decoration: none;
  flex-shrink: 0;
}

html[dir="ltr"] .forum-rdx-index .forum-category > a:first-child i {
  font-size: 1.05rem;
}

html[dir="ltr"] .forum-rdx-index .forum-category .forum-category-info {
  margin-left: 0;
  margin-right: 0;
  min-width: 0;
}

html[dir="rtl"] .forum-rdx-index .table.table-forum-category .table-header-column:first-child,
html[dir="rtl"] .forum-rdx-index .table.table-forum-category .table-column:first-child {
  padding-left: 0;
  padding-right: 36px;
}

html[dir="rtl"] .forum-rdx-index .table.table-forum-category .table-header-column:last-child,
html[dir="rtl"] .forum-rdx-index .table.table-forum-category .table-column:last-child {
  padding-right: 0;
  padding-left: 28px;
}

html[dir="rtl"] .forum-rdx-index .table.table-forum-category .table-header-column.padded-big-left,
html[dir="rtl"] .forum-rdx-index .table.table-forum-category .table-column.padded-big-left {
  padding-left: 0;
  padding-right: 60px;
}

html[dir="rtl"] .forum-rdx-index .forum-category {
  justify-content: flex-start;
  text-align: right;
}

html[dir="rtl"] .forum-rdx-index .forum-category > a:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-left: 18px;
  border-radius: 14px;
  background: var(--rdx-accent-soft);
  color: var(--rdx-count-fill);
  text-decoration: none;
  flex-shrink: 0;
}

html[dir="rtl"] .forum-rdx-index .forum-category > a:first-child i {
  font-size: 1.05rem;
}

html[dir="rtl"] .forum-rdx-index .forum-category .forum-category-info {
  margin-left: 0;
  margin-right: 0;
  min-width: 0;
}

.forum-rdx-category .forum-rdx-discussion-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 78px;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--rdx-border);
}

.forum-rdx-category .forum-rdx-discussion-head p {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--rdx-text-muted);
}

.forum-rdx-discussion-list {
  display: flex;
  flex-direction: column;
}

.forum-rdx-discussion-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 78px;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--rdx-border);
  background: var(--rdx-surface);
  transition: background-color 0.2s ease;
}

.forum-rdx-discussion-row:last-child {
  border-bottom: 0;
}

.forum-rdx-discussion-row:hover {
  background: #f9fafe;
}

.forum-rdx-discussion-main {
  min-width: 0;
}

.forum-rdx-discussion-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.forum-rdx-discussion-title a {
  color: var(--rdx-text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.forum-rdx-discussion-title a:hover {
  color: var(--rdx-accent);
}

.forum-rdx-discussion-badges {
  display: inline-flex;
  gap: 6px;
}

.forum-rdx-discussion-excerpt {
  font-size: 0.86rem;
  color: var(--rdx-text-muted);
  line-height: 1.45;
  margin-bottom: 8px;
}

.forum-rdx-discussion-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--rdx-text-muted);
  font-size: 0.78rem;
}

.forum-rdx-discussion-user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.forum-rdx-discussion-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.forum-rdx-discussion-username {
  font-weight: 700;
  color: var(--rdx-text);
}

.forum-rdx-discussion-role {
  font-size: 0.72rem;
}

.forum-rdx-discussion-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.forum-rdx-discussion-stat {
  background: var(--rdx-surface-alt);
  border: 1px solid var(--rdx-border);
  border-radius: 10px;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 6px;
}

.forum-rdx-discussion-stat .value {
  color: var(--rdx-text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.forum-rdx-discussion-stat .label {
  margin-top: 5px;
  color: var(--rdx-text-muted);
  font-size: 0.69rem;
  text-transform: uppercase;
}

.forum-rdx-discussion-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.forum-rdx-discussion-row .post-settings-icon {
  color: var(--rdx-text-muted);
}

.forum-rdx-topic .section-filters-bar.v7,
.forum-rdx-topic .forum-post,
.forum-rdx-topic .post-options,
.forum-rdx-topic .post-comment-list {
  box-shadow: var(--rdx-shadow);
}

.forum-rdx-topic .section-header .badge {
  margin-inline-end: 6px;
}

.forum-rdx-topic .forum-post {
  border-radius: 14px;
  overflow: hidden;
}

.forum-rdx-topic .post-options {
  border-radius: 0 0 14px 14px;
}

.forum-rdx-form .forum-rdx-form-shell {
  border-radius: 14px;
  background: var(--rdx-surface);
  box-shadow: var(--rdx-shadow);
}

.forum-rdx-form .forum-rdx-form-header {
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--rdx-border);
}

.forum-rdx-form .forum-rdx-attachment-box {
  padding: 14px;
  border: 1px dashed #d2d4e8;
  border-radius: 12px;
  background: #fafbff;
}

.forum-rdx .post-comment {
  border-top-color: var(--rdx-border);
}

.forum-rdx .post-comment .post-comment-text {
  display: block;
}

.forum-rdx .post-comment-form,
.forum-rdx-comment-form-shell {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 249, 255, 0.98));
  box-shadow: var(--rdx-composer-shadow-soft);
}

.forum-rdx .post-comment-form .user-avatar,
.forum-rdx-comment-form-shell .user-avatar {
  position: relative;
  top: auto;
  left: auto;
  flex-shrink: 0;
  margin-top: 6px;
}

.forum-rdx .post-comment-form .form,
.forum-rdx-comment-form-shell .form {
  min-width: 0;
  flex: 1;
}

.forum-rdx .post-comment-form .form-row,
.forum-rdx .post-comment-form .form-item,
.forum-rdx-comment-form-shell .form-row,
.forum-rdx-comment-form-shell .form-item {
  margin: 0;
}

.forum-rdx .post-comment-form .forum-rdx-comment-form-main,
.forum-rdx-comment-form-shell .forum-rdx-comment-form-main {
  width: 100%;
}

.forum-rdx .post-comment-form .forum-rdx-comment-composer,
.forum-rdx-comment-form-shell .forum-rdx-comment-composer {
  padding: 14px 16px 14px;
  border: 1px solid var(--rdx-border);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(252, 252, 253, 0.98) 0%, rgba(246, 247, 252, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.forum-rdx .post-comment-form .forum-rdx-comment-composer:focus-within,
.forum-rdx-comment-form-shell .forum-rdx-comment-composer:focus-within {
  border-color: var(--rdx-violet-ring);
  background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%);
  box-shadow:
    0 0 0 4px rgba(97, 93, 250, 0.08),
    var(--rdx-composer-shadow);
  transform: translateY(-1px);
}

.forum-rdx-comment-body {
  margin-top: 6px;
  color: var(--rdx-text);
  font-size: 0.86rem;
  line-height: 1.65;
}

.forum-rdx-comment-body p + p {
  margin-top: 8px;
}

.forum-rdx-comment-body pre {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #151724;
  color: #f5f6ff;
  overflow-x: auto;
}

.forum-rdx-comment-body code {
  background: #eff1f8;
  border-radius: 6px;
  padding: 1px 5px;
}

.forum-rdx-comment-body blockquote {
  margin-top: 10px;
  padding: 8px 12px;
  border-left: 3px solid var(--rdx-accent);
  background: #f6f7fc;
}

.forum-rdx-comment-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(234, 234, 245, 0.96);
}

.forum-rdx-tool-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--rdx-border);
  background: rgba(255, 255, 255, 0.75);
  color: var(--rdx-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(94, 92, 154, 0.04);
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.forum-rdx-tool-btn:hover {
  border-color: rgba(97, 93, 250, 0.16);
  color: var(--rdx-violet);
  background: rgba(97, 93, 250, 0.08);
  box-shadow: 0 10px 18px rgba(94, 92, 154, 0.08);
  transform: translateY(-1px);
}

.forum-rdx-tool-btn:focus-visible {
  outline: 0;
  border-color: var(--rdx-violet);
  color: var(--rdx-violet);
  background: rgba(97, 93, 250, 0.1);
  box-shadow: 0 0 0 3px rgba(97, 93, 250, 0.14);
}

.forum-rdx-comment-input {
  min-height: 98px;
  max-height: 280px;
  resize: vertical;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rdx-text);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.7;
}

.forum-rdx-comment-input::placeholder {
  color: #9b9db8;
  font-weight: 600;
}

.forum-rdx-comment-input:focus {
  outline: 0;
}

.forum-rdx-comment-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(234, 234, 245, 0.88);
}

.forum-rdx-comment-send {
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--rdx-violet) 0%, var(--rdx-violet-strong) 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(97, 93, 250, 0.28);
  transition: opacity 0.15s ease, transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.forum-rdx-comment-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(97, 93, 250, 0.34);
  filter: brightness(1.02);
}

.forum-rdx-comment-send:focus-visible {
  outline: 0;
  box-shadow:
    0 0 0 4px rgba(97, 93, 250, 0.16),
    0 18px 30px rgba(97, 93, 250, 0.34);
}

.forum-rdx-comment-send .interactive-input-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.forum-rdx-comment-send.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.forum-rdx-comment-send.is-loading::after {
  content: "...";
  margin-inline-start: 4px;
}

.forum-rdx .post-comment-heading {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.forum-rdx-category .forum-sidebar-stack {
  display: grid;
  gap: 16px;
}

.forum-rdx-category .forum-sidebar-card {
  overflow: hidden;
  box-shadow: var(--rdx-shadow);
}

.forum-rdx-category .forum-sidebar-card .widget-box-content {
  padding-top: 0;
}

.forum-rdx-category .forum-category-command-list {
  display: grid;
  gap: 10px;
}

.forum-rdx-category .forum-category-command {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.forum-rdx-category .forum-category-board-list {
  display: grid;
  gap: 14px;
}

.forum-rdx-category .forum-category-board-item {
  border: 1px solid var(--rdx-border);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.forum-rdx-category .forum-category-board-item:hover {
  transform: translateY(-1px);
  border-color: #d7daf1;
  box-shadow: 0 16px 30px rgba(94, 92, 154, 0.08);
}

.forum-rdx-category .forum-category-board-item.is-active {
  border-color: var(--rdx-active-border);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: 0 18px 34px rgba(94, 92, 154, 0.12);
}

.forum-rdx-category .forum-category-board-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.forum-rdx-category .forum-category-board-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.forum-rdx-category .forum-category-board-link:hover {
  text-decoration: none;
}

.forum-rdx-category .forum-category-board-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(97, 93, 250, 0.12);
  color: #615dfa;
  flex-shrink: 0;
}

.forum-rdx-category .forum-category-board-item.is-active .forum-category-board-icon {
  background: rgba(97, 93, 250, 0.18);
}

.forum-rdx-category .forum-category-board-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.forum-rdx-category .forum-category-board-copy strong {
  color: var(--rdx-text);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.forum-rdx-category .forum-category-board-copy span {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  color: var(--rdx-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.forum-rdx-category .forum-category-board-count {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--rdx-accent-soft);
  color: var(--rdx-count-fill);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.forum-rdx-category .forum-category-board-item.is-active .forum-category-board-count {
  background: var(--rdx-accent-soft-strong);
}

@media screen and (max-width: 960px) {
  .forum-rdx-category .forum-rdx-discussion-head {
    display: none;
  }

  .forum-rdx-discussion-row {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }

  .forum-rdx-discussion-stats,
  .forum-rdx-discussion-actions {
    justify-content: flex-start;
  }

  .forum-rdx-form .grid.grid-3-9 {
    display: block;
  }

  .forum-rdx-topic .forum-post .forum-post-content {
    display: block;
  }

  .forum-rdx-category .forum-category-board-item {
    padding: 14px;
  }

  .forum-rdx .post-comment-form,
  .forum-rdx-comment-form-shell {
    padding: 18px;
  }
}

/* Fix mobile hidden forum sections 
   styles.css historically used nth-last-child(3) to hide an old column, but now it hides Categories (1st column) */
@media screen and (max-width: 960px) {
  .forum-rdx-index .table.table-forum-category .table-header-column:first-child,
  .forum-rdx-index .table.table-forum-category .table-column:first-child {
    display: table-cell !important;
  }
}

@media screen and (max-width: 640px) {
  .forum-rdx .post-comment-form,
  .forum-rdx-comment-form-shell {
    gap: 12px;
    padding: 16px;
  }

  .forum-rdx .post-comment-form .forum-rdx-comment-composer,
  .forum-rdx-comment-form-shell .forum-rdx-comment-composer {
    padding: 12px;
    border-radius: 14px;
  }

  .forum-rdx-comment-toolbar {
    gap: 6px;
    margin-bottom: 8px;
    padding-bottom: 10px;
  }

  .forum-rdx-tool-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .forum-rdx-comment-input {
    min-height: 88px;
    font-size: 0.85rem;
  }

  .forum-rdx-comment-footer {
    margin-top: 12px;
    padding-top: 8px;
  }

  .forum-rdx-comment-send {
    min-width: 40px;
    width: 40px;
    height: 40px;
    border-radius: 11px;
  }
}

html[dir="rtl"] .forum-rdx .post-comment-form,
html[dir="rtl"] .forum-rdx-comment-form-shell {
  direction: rtl;
}

html[dir="rtl"] .forum-rdx .post-comment-form .forum-rdx-comment-footer,
html[dir="rtl"] .forum-rdx-comment-form-shell .forum-rdx-comment-footer {
  justify-content: flex-start;
}

/* Mobile Forum Navigation */
.forum-mobile-nav-shell {
  display: none;
  margin-bottom: 24px;
}

@media screen and (max-width: 960px) {
  .forum-mobile-nav-shell {
    display: block;
    margin-top: 24px;
  }

  .forum-mobile-filters-card {
    padding: 0;
  }

  .forum-mobile-filters-card .widget-box-content {
    padding: 16px;
  }

  .forum-mobile-nav-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .forum-mobile-add-btn {
    width: 100%;
    justify-content: center;
    height: 46px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.875rem;
    box-shadow: none;
  }

  .forum-mobile-category-dropdown {
    position: relative;
    width: 100%;
  }

  .forum-cat-select {
    width: 100%;
    height: 46px;
    padding: 0 40px 0 16px;
    border: 1px solid var(--rdx-border);
    border-radius: 10px;
    background-color: var(--rdx-surface-alt);
    color: var(--rdx-text);
    font-size: 0.875rem;
    font-weight: 700;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .forum-cat-select:focus {
    border-color: var(--rdx-violet);
    background-color: var(--rdx-surface);
    outline: none;
  }

  .forum-mobile-category-dropdown .select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--rdx-text-muted);
    font-size: 0.75rem;
    transition: color 0.2s ease;
  }

  .forum-cat-select:focus + .select-arrow {
    color: var(--rdx-violet);
  }

  /* RTL Support */
  .rtl .forum-cat-select {
    padding: 0 16px 0 40px;
  }

  .rtl .forum-mobile-category-dropdown .select-arrow {
    right: auto;
    left: 16px;
  }
}

@media screen and (min-width: 681px) and (max-width: 960px) {
  .forum-mobile-nav-actions {
    flex-direction: row;
  }
}
