/* Layout & Positioning Reset */
body {
    margin: 0;
    position: relative;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.9rem;
}

button {
    font-family: Arial, Helvetica, sans-serif;
    cursor: pointer;
    font-size: 0.9rem;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

.timestamp {
    color: #666;
    font-size: 0.7rem;
    margin-left: 32px;
    float: right;
}

.counter-and-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.char-count {
    font-size: 0.8em;
    color: #888;
}

/* Fixed Header Layout */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 20px;
    padding-right: 20px;
    z-index: 100;
}

.post-content a {
    color: #0645ad;
    text-decoration: underline;
    word-break: break-all;
}

.media-embed {
    margin: 10px 0;
    position: relative;
    max-width: 100%;
    background: #000;
}

/* Responsive 16:9 aspect ratio for video iframes */
.media-embed:not(.image-embed):not(.video-embed) {
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.media-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.media-embed.image-embed {
    padding-bottom: 0;
    height: auto;
    background: none;
}

.media-embed.image-embed img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.media-embed.video-embed {
    height: auto;
    padding-bottom: 0;
    background: #000;
}

.media-embed.video-embed video {
    width: 100%;
    height: auto;
    display: block;
}

.site-user-info {
    display: flex;
    align-items: center;
}

/* Main Content Layout - Left Aligned */
.main-feed-container {
    /* Spacing for fixed header/footer */
    margin-top: 80px;
    margin-bottom: 40px;

    margin-right: auto;
    margin-left: auto;
    width: fit-content;
    max-width: 800px;
}

/* Post & Form Structure */
.post-form-container {
    margin-bottom: 20px;
}

.post-form-container textarea {
    width: 100%;
    min-height: 80px;
    display: block;
    margin-bottom: 10px;
    resize: vertical;
}

.post {
    margin-bottom: 15px;
    display: block;
}

.post-content {
    white-space: pre-wrap;
}

/* Login Page Structure - Left Aligned */
.login-container {
    margin-top: 100px;
    margin-left: 20px;
    width: 100%;
    max-width: 400px;
}

.login-container label {
    display: block;
    margin-bottom: 5px;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    display: block;
    margin-bottom: 10px;
}

/* Fixed Footer Layout */
#bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    z-index: 100;
}

/* ------------------------------------------------------ */
/* Thread & Nested Post Styles (Extracted from EJS)      */
/* ------------------------------------------------------ */

.post-wrapper {
    margin-bottom: 15px;
}

/* Reply Button in Meta Header 
.reply-toggle-btn {
    background: none;
    border: none;
    color: blue;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9em;
    padding: 0;
    margin-left: 5px;
}*/

/* Hidden Reply Form Container */
.reply-form-container {
    display: none;
    /* Initially hidden */
    margin-top: 10px;
    padding: 10px;
    background: #f0f0f0;
}

/* Inputs inside the reply form */
.reply-textarea {
    width: 100%;
    margin-bottom: 5px;
    resize: vertical;
}

.btn-small {
    font-size: 0.9rem;
}

/* Nested Replies Tree/Indentation */
.replies-tree {
    margin-left: 30px;
    border-left: 2px solid #eee;
    padding-left: 15px;
}

/* Admin Link Alignment */
.admin-link-wrapper {
    text-align: right;
    margin-bottom: 10px;
}

/* "No Posts" Message */
.no-posts-message {
    text-align: center;
    color: #666;
    text-shadow: none;
}

/* ------------------------------------------------------ */
/* Admin Dashboard Styles                                */
/* ------------------------------------------------------ */

.admin-panel {
    margin-bottom: 40px;
}

.admin-section {
    margin-bottom: 40px;
}

/* Admin Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.admin-table th {
    text-align: left;
    border-bottom: 1px solid #ccc;
    padding: 8px;
}

.admin-table td {
    border-bottom: 1px solid #eee;
    padding: 8px;
}

/* Admin Actions */
.inline-form {
    display: inline;
}

.btn-delete {
    background: red;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-delete:hover {
    background: darkred;
}

.status-protected {
    color: #999;
    font-size: 0.9em;
    font-style: italic;
}