/**
 * Forum UX styles – no inline CSS in TPL files.
 * Loaded on forum list and forum thread pages only.
 */

/* ----- Forum list (c-forum) ----- */
.forum-page {
  margin-bottom: 1.5rem;
}

.forum-box {
  background-color: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.forum-title {
  padding: 1rem 1.25rem;
  margin: 0;
  font-size: 1.5rem;
  color: #fff;
  font-weight: 600;
}

.forum-search-wrap {
  margin-bottom: 1rem;
}

.forum-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.forum-search-input {
  flex: 1;
  min-width: 12rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  box-sizing: border-box;
}

.forum-search-input:focus {
  border-color: #1a5fb4;
  outline: none;
}

.forum-search-submit {
  padding: 0.5rem 1.25rem;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid #1a5fb4;
  background: #1a5fb4;
  color: #fff;
  font-family: inherit;
}

.forum-search-submit:hover {
  background: #0d3d7a;
  border-color: #0d3d7a;
}

.forum-search-results-msg {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #333;
}

.forum-description {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #333;
}

.forum-list-inner {
  padding: 1.25rem;
  margin: 1rem;
  margin-top: 0;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.forum-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.forum-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: #f5f5f5;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #e0e0e0;
}

.forum-table th.forum-col-replies,
.forum-table th.forum-col-date {
  text-align: center;
  width: 6rem;
}

.forum-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.forum-table tbody tr:hover {
  background-color: #fafafa;
}

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

.forum-thread-link {
  color: #1a5fb4;
  text-decoration: none;
  font-weight: 500;
}

.forum-thread-link:hover {
  text-decoration: underline;
  color: #0d3d7a;
}

.forum-thread-description {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: #666;
  line-height: 1.4;
  font-weight: normal;
}

.forum-col-replies,
.forum-col-date {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
}

.forum-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #666;
  font-size: 1rem;
}

/* ----- Forum thread (c-forum_thread) ----- */
.forum-thread-page {
  margin-bottom: 1.5rem;
  width: 100%;
}

.forum-thread-page table {
  width: 100%;
}

.forum-thread-content {
  background: #fff;
  color: #000;
  padding: 1.25rem;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.forum-thread-content .forum-breadcrumb,
.forum-thread-content .forum-thread-heading,
.forum-thread-content .forum-thread-description,
.forum-thread-content .forum-thread-meta,
.forum-thread-content .forum-replies-heading,
.forum-thread-content .forum-post-author,
.forum-thread-content .forum-post-body,
.forum-thread-content .forum-reply-heading,
.forum-thread-content .forum-login-prompt {
  color: #000;
}

.forum-thread-content .forum-post-date {
  color: #333;
}

.forum-breadcrumb {
  margin-bottom: 1rem;
}

.forum-breadcrumb a {
  color: #1a5fb4;
  text-decoration: none;
}

.forum-breadcrumb a:hover {
  text-decoration: underline;
}

.forum-thread-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

.forum-thread-heading {
  margin: 0 0 0.75rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #000;
  line-height: 1.3;
}

.forum-thread-description {
  padding: 0.5rem 0;
  line-height: 1.6;
  color: #000;
}

.forum-thread-meta {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #000;
}

.forum-msg {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  text-align: center;
  background: #e8f4fd;
  color: #0d3d7a;
  border: 1px solid #b8d4f0;
}

.forum-replies-heading {
  margin: 1.5rem 0 0.75rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #000;
}

.forum-post-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  background: #fafafa;
}

.forum-post-table td {
  padding: 0;
  vertical-align: top;
}

/* Sub-posts (replies to a post) */
.forum-subposts {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding-left: 1rem;
  border-left: 3px solid #e0e0e0;
}

.forum-subpost-table {
  margin-bottom: 0.75rem;
  background: #f5f5f5 !important;
}

.forum-subpost-table .forum-post {
  padding: 0.75rem 1rem;
}

.forum-subpost-table .forum-post-avatar {
  width: 36px;
  padding-right: 0.75rem;
}

.forum-subpost-table .forum-post-avatar-img {
  width: 36px;
  height: 36px;
}

.forum-subpost-table .forum-post-author,
.forum-subpost-table .forum-post-body {
  font-size: 0.9rem;
}

/* Uniform post action links: upvote count, Upvote, Hide Posts, Send Message, Reply, Delete */
.forum-post-action {
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

.forum-post-action-sep {
  color: #999;
  margin: 0 0.2rem;
  font-weight: normal;
  user-select: none;
}

/* All clickable actions share the same link style */
.forum-post-author .forum-upvote-link,
.forum-post-author .forum-send-message-link,
.forum-post-author .forum-reply-to-post,
.forum-post-author .forum-hide-posts-link,
.forum-post-author .forum-delete-link {
  font-size: 0.875rem;
  color: #1a5fb4;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  margin-left: 0;
}

.forum-post-author .forum-upvote-link:hover,
.forum-post-author .forum-send-message-link:hover,
.forum-post-author .forum-reply-to-post:hover,
.forum-post-author .forum-hide-posts-link:hover,
.forum-post-author .forum-delete-link:hover {
  text-decoration: underline;
}

/* Upvote count and "Upvoted" label: same size, non-link style */
.forum-upvote-count,
.forum-upvoted-label {
  font-size: 0.875rem;
  color: #666;
  font-weight: normal;
  margin-left: 0;
}

.forum-upvoted-label {
  font-style: italic;
}

.forum-reply-wrap,
.forum-delete-wrap,
.forum-hide-posts-wrap,
.forum-upvote-wrap,
.forum-send-message-wrap {
  margin-left: 0.5rem;
}

.forum-upvote-form,
.forum-hide-posts-form,
.forum-delete-form {
  display: inline;
}

/* Upvote and Hide Posts side by side with icons - flat flex row */
.forum-upvote-hide-row {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.forum-upvote-hide-row .forum-upvote-count,
.forum-upvote-hide-row .forum-upvoted-label {
  flex-shrink: 0;
}

.forum-upvote-hide-row .forum-upvote-form,
.forum-upvote-hide-row .forum-hide-posts-form {
  display: inline;
  margin: 0;
}

.forum-upvote-hide-row .forum-upvote-link,
.forum-upvote-hide-row .forum-hide-posts-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.forum-action-btn-icon {
  font-size: 0.95em;
  margin-right: 0;
}

/* "Replying to X" line above form */
.forum-replying-to {
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: #333;
  background: #e8f4fd;
  border-radius: 4px;
  border: 1px solid #b8d4f0;
}

.forum-replying-to .forum-cancel-reply {
  margin-left: 0.5rem;
  font-size: 0.875rem;
  color: #1a5fb4;
  text-decoration: none;
}

.forum-replying-to .forum-cancel-reply:hover {
  text-decoration: underline;
}

.forum-post {
  display: table;
  width: 100%;
  padding: 1rem;
}

.forum-post-avatar {
  display: table-cell;
  width: 48px;
  padding-right: 1rem;
  vertical-align: top;
}

.forum-post-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  display: block;
}

.forum-send-message-below-avatar {
  margin-top: 0.5rem;
  text-align: center;
}

.forum-send-message-below-avatar .forum-send-message-link {
  font-size: 0.875rem;
  color: #1a5fb4;
  text-decoration: none;
}

.forum-send-message-below-avatar .forum-send-message-link:hover {
  text-decoration: underline;
}

.forum-post-main {
  display: table-cell;
  vertical-align: top;
}

.forum-post-author {
  font-weight: 600;
  color: #000;
  margin-bottom: 0.35rem;
}

.forum-post-author-link {
  color: #1a5fb4;
  text-decoration: none;
}

.forum-post-author-link:hover {
  text-decoration: underline;
}

.forum-post-count {
  font-size: 0.875rem;
  color: #666;
  font-weight: normal;
  margin-left: 0.15rem;
}

.forum-post-date {
  font-size: 0.875rem;
  color: #333;
  margin-left: 0.25rem;
}

/* Send message uses shared .forum-post-author link styles above */

.forum-post-body {
  margin-top: 0.5rem;
  line-height: 1.6;
  color: #000;
}

.forum-post-body .forum-post-link {
  color: #1a5fb4;
  text-decoration: none;
}

.forum-post-body .forum-post-link:hover {
  text-decoration: underline;
  color: #0d3d7a;
}

.forum-reply-below-post {
  margin-top: 0.5rem;
}

.forum-reply-below-post .forum-reply-to-post {
  font-size: 0.875rem;
  color: #1a5fb4;
  text-decoration: none;
}

.forum-reply-below-post .forum-reply-to-post:hover {
  text-decoration: underline;
}

.forum-reply-heading {
  margin: 1.5rem 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #000;
}

.forum-reply-form {
  margin-top: 0.5rem;
}

.forum-reply-form textarea {
  width: 100%;
  max-width: 36rem;
  min-height: 6rem;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  box-sizing: border-box;
}

.forum-reply-form textarea:focus {
  border-color: #1a5fb4;
  outline: none;
}

.forum-reply-form .forum-submit {
  margin-top: 0.75rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.95rem;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid #1a5fb4;
  background: #1a5fb4;
  color: #fff;
}

.forum-reply-form .forum-submit:hover {
  background: #0d3d7a;
  border-color: #0d3d7a;
}

.forum-balance-alert {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: #000;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
}

.forum-login-prompt {
  margin-top: 1rem;
  padding: 0.75rem 0;
  font-size: 0.95rem;
  color: #000;
}

.forum-login-prompt a {
  color: #1a5fb4;
  text-decoration: none;
}

.forum-login-prompt a:hover {
  text-decoration: underline;
}

/* Responsive: stack table on small screens */
@media (max-width: 640px) {
  .forum-table th.forum-col-replies,
  .forum-table th.forum-col-date,
  .forum-table .forum-col-replies,
  .forum-table .forum-col-date {
    width: auto;
  }

  .forum-list-inner {
    margin: 0.75rem;
    padding: 1rem;
  }

  .forum-thread-heading {
    font-size: 1.25rem;
  }
}
