.forum_container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

.forum_container h1 {
    margin-bottom: 1rem;
}

/* Subforum navigation */
.forum_subforum_nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ddd;
}

.forum_nav_label {
    color: #666;
    font-style: italic;
}

.forum_subforum_btn {
    padding: 0.4rem 1rem;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
}

.forum_subforum_btn:hover {
    background: #e0e0e0;
}

.forum_subforum_active {
    background: #333;
    color: #fff;
    border-color: #333;
}

.forum_subforum_active:hover {
    background: #444;
}

/* Buttons */
.forum_btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.9rem;
}

.forum_btn_primary {
    background: #333;
    color: #fff;
    border-color: #333;
}

.forum_btn_primary:hover {
    background: #444;
}

.forum_btn_cancel {
    background: #f5f5f5;
    color: #333;
}

.forum_btn_cancel:hover {
    background: #e0e0e0;
}

.forum_btn_small {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
}

.forum_btn_edit {
    background: #e8e8e8;
    border-color: #bbb;
}

.forum_btn_edit:hover {
    background: #ddd;
}

.forum_btn_delete {
    background: #f5e5e5;
    border-color: #d99;
    color: #900;
}

.forum_btn_delete:hover {
    background: #f0d0d0;
}

/* Forms */
.forum_form {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
}

.forum_form_group {
    margin-bottom: 0.75rem;
}

.forum_form_group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: bold;
    font-size: 0.9rem;
}

.forum_form_group input,
.forum_form_group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.forum_form_actions {
    display: flex;
    gap: 0.5rem;
}

/* Hidden */
.forum_hidden {
    display: none !important;
}

/* Messages */
.forum_message {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.forum_message_success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.forum_message_error {
    background: #fce4ec;
    border: 1px solid #ef9a9a;
    color: #c62828;
}

/* Login prompt */
.forum_login_prompt {
    padding: 0.75rem;
    background: #fff3e0;
    border: 1px solid #ffcc80;
    border-radius: 4px;
    margin-bottom: 1rem;
    color: #e65100;
}

.forum_login_prompt a {
    font-weight: bold;
}

/* Empty state */
.forum_empty {
    color: #666;
    font-style: italic;
    padding: 2rem 0;
    text-align: center;
}

/* Threads */
.forum_thread {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fff;
}

.forum_thread_header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.forum_thread_title {
    margin: 0;
    font-size: 1.1rem;
}

.forum_thread_meta {
    color: #666;
    font-size: 0.85rem;
}

.forum_thread_actions {
    margin-left: auto;
    display: flex;
    gap: 0.25rem;
}

.forum_thread_content {
    margin-bottom: 0.75rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Replies section */
.forum_replies_section {
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

.forum_toggle_replies {
    font-size: 0.85rem;
    color: #555;
}

.forum_no_replies {
    font-size: 0.85rem;
    color: #999;
    font-style: italic;
}

.forum_replies {
    margin-top: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid #eee;
}

.forum_reply {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.forum_reply:last-child {
    border-bottom: none;
}

.forum_reply_header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.forum_reply_meta {
    color: #666;
    font-size: 0.8rem;
}

.forum_reply_actions {
    margin-left: auto;
    display: flex;
    gap: 0.25rem;
}

.forum_reply_content {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.95rem;
}

.forum_reply_section {
    margin-top: 0.5rem;
}

/* Edit forms within threads/replies */
.forum_edit_form {
    margin-top: 0.5rem;
}

.forum_reply_form {
    margin-top: 0.5rem;
}

/* New thread section */
.forum_new_thread_section {
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 600px) {
    .forum_container {
        padding: 0.5rem;
    }

    .forum_thread_header {
        flex-direction: column;
    }

    .forum_thread_actions {
        margin-left: 0;
    }

    .forum_reply_header {
        flex-direction: column;
    }

    .forum_reply_actions {
        margin-left: 0;
    }
}
