/* Forum CSS */
#forum-window {
    background: url('img/tableau_bois.webp') no-repeat center center;
    background-size: 100% 100%;
    overflow: visible;
}

/* Fix scrolling to content only */
body.lobby-body {
    overflow-x: hidden;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #000;
}

.lobby-wrapper {
  position: relative;
  width: 100%;
  min-height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.lobby-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
  padding-bottom: 20px !important;
}

.account-wrapper {
    height: 100%;
    padding-bottom: 10px;
}

#forum-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 600px;
    margin: 19px;
}

#forum-content {
    padding-right: 10px !important;
}

#forum-window .modal-banner {
    position: relative;
    top: -6px;
    z-index: 15;
}

#forum-window .modal-body {
    background: transparent;
    padding: 15px;
    padding-bottom: 0px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 40px);
}

/* Breadcrumbs */
.forum-breadcrumbs {
    margin-bottom: 20px;
    font-size: 14px;
    color: #8b6f3e;
    padding-bottom: 10px;
    border-bottom: 1px solid #584632;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.breadcrumbs-left span {
    cursor: pointer;
    font-weight: bold;
    color: #e0b04b;
    text-decoration: underline;
}

.breadcrumbs-left span:hover {
    color: #fff;
}

.breadcrumbs-left span:last-child {
    cursor: default;
    color: #dec9a5;
    text-decoration: none;
    font-weight: normal;
}

.breadcrumbs-right {
    font-size: 12px;
    color: #c0a060;
}

/* Category List */
.forum-category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.forum-category-item {
    background: rgb(57 53 39 / 58%);
    border: 1px solid #f8d7a8;
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.2s;
}

.forum-category-item:hover {
    background: rgb(101 20 20 / 60%);
}

.forum-category-icon {
    width: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.forum-category-main {
    flex: 1;
}

.forum-category-title {
    font-size: 16px;
    font-weight: bold;
    color: #e1b04b;
    margin-bottom: 4px;
}

.forum-category-desc {
    font-size: 12px;
    color: #f3d2a4;
    font-style: italic;
}

.last-post-info {
    font-size: 11px;
    color: #f3d2a4;
    min-width: 200px;
    line-height: 1.3;
}

.last-post-author {
    color: #e1b04b;
    font-weight: bold;
}

.last-post-topic {
    color: #e1b04b;
    font-style: italic;
}

.last-post-date {
    margin-top: 2px;
    color: #c0a060;
}

.forum-category-stats {
    font-size: 11px;
    color: #ff7900;
    text-align: right;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Topic List */
.forum-topic-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
}

.forum-topic-item {
    background: rgba(248, 240, 220, 0.5);
    border: 1px solid #a68b6d;
    border-radius: 4px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.forum-topic-item:hover {
    background: rgba(248, 240, 220, 0.8);
}

.forum-topic-main {
    display: flex;
    flex-direction: column;
}

.forum-topic-title {
    font-weight: bold;
    color: #3d2e1f;
    font-size: 14px;
}

.forum-topic-meta {
    font-size: 11px;
    color: #665241;
}

.forum-topic-stats {
    text-align: right;
    font-size: 11px;
    color: #665241;
    min-width: 80px;
}

/* Post View */
.forum-post-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}

.forum-post-item {
    background: #9b9b9b;
    border: 1px solid #c2a786;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 4px;
}

.forum-post-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    border-bottom: 1px solid #e0d0b0;
    padding-bottom: 4px;
}

.forum-post-author {
    font-weight: bold;
    color: #5a402a;
}

.forum-post-role {
    font-size: 0.8em;
    color: #886e58;
    margin-left: 5px;
}

.forum-post-date {
    font-size: 11px;
    color: #887a6a;
}

.forum-post-content {
    font-size: 13px;
    color: #2b2218;
    line-height: 1.4;
    white-space: pre-wrap;
}

/* Forms */
.forum-actions {
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-end;
}

.forum-btn {
    background: linear-gradient(to bottom, #7da55c, #45721c);
    border: 1px solid #2f4f13;
    border-radius: 3px;
    color: #fff;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.forum-btn:hover {
    background: linear-gradient(to bottom, #90c06e, #4f8220);
}

.forum-form {
    background: rgba(255, 255, 255, 0.5);
    padding: 10px;
    border: 1px solid #a68b6d;
    border-radius: 5px;
    margin-top: 10px;
}

.forum-input-group {
    margin-bottom: 10px;
}

.forum-input-group label {
    display: block;
    margin-bottom: 4px;
    color: #3d2e1f;
    font-weight: bold;
    font-size: 12px;
}

.forum-input {
    width: 100%;
    padding: 6px;
    border: 1px solid #8e735b;
    border-radius: 3px;
    background: #fefcf5;
    font-family: inherit;
    color: #333;
    box-sizing: border-box;
    /* Important so padding fits in width */
}

textarea.forum-input {
    min-height: 100px;
    resize: vertical;
}

/* Reply Box */
.forum-reply-box {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #a48a62;
}

/* New Form Styles */
.forum-action-btn {
    background: linear-gradient(to bottom, #673420, #470000);
    border: 1px solid #e0b04b;
    border-radius: 3px;
    color: #fff;
    padding: 3px 10px;
    font-size: 11px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 1px black;
}

.forum-action-btn:hover {
    background: linear-gradient(to bottom, #90c06e, #4f8220);
}

.forum-create-header {
    background: #4f1616;
    color: #dec9a5;
    padding: 5px 10px;
    font-weight: bold;
    border-radius: 4px 4px 0 0;
    margin-top: 10px;
    border: 1px solid #fab005;
    border-bottom: none;
}

.forum-form {
    background: #e8e8e8;
    padding: 10px;
    border: 1px solid #999;
    border-radius: 0 0 4px 4px;
    margin-top: 0;
    /* Connected to header */
}

.forum-form-row {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.forum-form-row label {
    width: 120px;
    color: #333;
    font-size: 12px;
    font-weight: bold;
}

.forum-select {
    padding: 4px;
    border: 1px solid #aaa;
    border-radius: 3px;
    background: #fff;
}

.forum-form-options {
    background: #dcdcdc;
    padding: 8px;
    border: 1px solid #bbb;
    margin-top: 10px;
    font-size: 12px;
    color: #333;
}

.option-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #000;
}

.forum-actions-bottom {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.forum-btn.secondary {
    background: linear-gradient(to bottom, #999, #666);
    border: 1px solid #444;
}

/* --- Dynamic Forum Header --- */
#forum-header-container {
    margin-bottom: 20px;
    font-family: 'Verdana', 'Arial', sans-serif;
}

.forum-top-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    /* Spacing between logo area and gray bar */
    padding-left: 10px;
}



.forum-logo-img {
    height: 60px;
    /* Adjust based on actual logo size */
    width: auto;
    display: block;
}

.forum-main-menu {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    /* Align to bottom of logo if needed */
    height: 40px;
    /* Align with logo visual center */
}

.forum-nav-link {
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    text-shadow: 1px 1px 2px #000;
}

.forum-nav-link:hover,
.forum-nav-link.active {
    color: #e0b04b;
    /* Gold hover */
    border-bottom: 2px solid #e0b04b;
}

/* Gray Info Bar */
.forum-info-bar {
    background: linear-gradient(to bottom, #99866d, #593b2d);
    /* Metallic gradient */
    border: 1px solid #444;
    border-radius: 4px;
    padding: 5px 10px;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-bar-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 5px;
}

.welcome-msg {
    color: #fff;
    text-shadow: 1px 1px 1px #000;
}

.welcome-msg strong {
    color: #fff;
    /* Name color */
}

.forum-clock {
    font-size: 11px;
    color: #ddd;
    text-shadow: 1px 1px 1px #000;
}

.info-bar-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #3d2e1f;
    /* Dark text for stats? Screenshot shows dark text on gray? No, screenshot text is black/dark brown */
    text-shadow: none;
}

.user-stats-text {
    color: #ffffff;
    /* Dark reddish brown text similar to screenshot */
    line-height: 1.4;
}

.forum-search-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-icon-deco {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

#forum-search-input {
    padding: 2px 5px;
    border: 1px solid #fff;
    border-radius: 2px;
    font-size: 11px;
    width: 150px;
}

#forum-search-btn {
    padding: 1px 6px;
    font-size: 10px;
    cursor: pointer;
    background: #eee;
    border: 1px solid #999;
    border-radius: 2px;
}

/* Forum Topic UI Refactor */

/* 1. Header Bar: Author | Topic */
.forum-topic-header-bar {
    background: linear-gradient(180deg, #505050 0%, #303030 100%);
    color: white;
    display: flex;
    padding: 5px 10px;
    font-weight: bold;
    font-size: 12px;
    border: 1px solid #000;
    margin-bottom: 5px;
    align-items: center;
}

/* 2. Topic Item Layout (Flex Row) */
.forum-post-item {
    display: flex;
    padding: 0;
    background: none;
    border: 1px solid #999;
    margin-bottom: 5px;
}

/* 3. Left Column: Author Info */
.post-author-side {
    width: 180px;
    background: #dcdcdc;
    padding: 10px;
    border-right: 1px solid #bbb;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-shrink: 0;
}

/* 4. Right Column: Content */
.post-content-side {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    background: #e8e8e8;
    min-width: 0;
    /* Prevent overflow text issues */
}

/* 5. Post Header (Title, Date, Quote) */
.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

/* 6. Post Body */
.post-body {
    flex: 1;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    white-space: pre-wrap;
    margin-bottom: 20px;
}

/* 7. Post Footer (Karma, Report) */
.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    /* Push to bottom */
}

/* 8. Karma Controls */
.karma-controls {
    font-size: 11px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.karma-controls span {
    vertical-align: middle;
}