/* This resets everything so margins/padding don't break your layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

nav {
    background-color: #ffffff;
    width: 100%;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    font-weight: bold;
    color: #1877f2; 
    font-size: 24px;
    letter-spacing: 1px;
}

.main-container {
    margin-top: 50px;
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 500px;
    width: 90%;
}

h1 {
    font-size: 24px;
    color: #1c1e21;
    margin-bottom: 8px;
}

p {
    color: #606770;
    font-size: 15px;
    margin-bottom: 20px;
}

/* UI Fixes for the Post Box */
.post-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

textarea {
    width: 100%;
    height: 90px;
    padding: 12px;
    border: 1px solid #ccd0d5;
    border-radius: 6px;
    resize: none; 
    font-family: Arial, sans-serif;
    font-size: 15px;
}

textarea:focus {
    outline: none;
    border-color: #1877f2; 
}

button {
    background-color: #1877f2;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #166fe5; 
}

/* Styling for the live Feed */
#posts-feed {
    margin-top: 30px;
    width: 100%;
    text-align: left;
}

.feed-item {
    background: #f8f9fa;
    border: 1px solid #e4e6eb;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.feed-text {
    color: #050505;
    font-size: 15px;
    margin-bottom: 8px;
    word-break: break-word;
}

.feed-time {
    color: #65676b;
    font-size: 12px;
}

.no-posts {
    text-align: center;
    color: #8a8d91;
    font-style: italic;
}

/* Styling for the character counter */
#char-count-wrapper {
    text-align: right;
    font-size: 13px;
    color: #65676b;
    margin-top: -4px;
    margin-bottom: 2px;
}

/* Custom Auth Layout Adjustments */
#auth-header-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#sign-in-btn {
    background-color: #1877f2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

#sign-in-btn:hover {
    background-color: #166fe5;
}

#login-prompt {
    background: #f0f2f5;
    border-radius: 8px;
    border: 1px dashed #ccd0d5;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Make sure the Clerk User Button profile avatar looks clean */
.cl-userButtonTrigger {
    outline: none;
}

.cl-userButtonTrigger:focus {
    outline: none;
}

/* --- Reactions & Comments Interfaces --- */
.reactions-container {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.react-btn {
    background: #f0f2f5;
    color: #050505;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    font-weight: normal;
    transition: background 0.2s;
}

.react-btn:hover {
    background: #e4e6eb;
}

.feed-divider {
    border: 0;
    height: 1px;
    background: #e4e6eb;
    margin: 12px 0;
}

.comments-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comment-item {
    background: #ffffff;
    border: 1px solid #e4e6eb;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
}

.comment-author {
    font-weight: bold;
    color: #65676b;
    font-size: 11px;
}

.comment-text {
    color: #1c1e21;
    margin: 2px 0 4px 0;
}

.comment-time {
    color: #90949c;
    font-size: 10px;
}

.comment-input-wrapper {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccd0d5;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
}

.comment-input:focus {
    border-color: #1877f2;
}

.comment-submit-btn {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 20px;
}

/* --- Comments & Reactions Display Layouts --- */
.reactions-container {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.react-btn {
    background: #f0f2f5;
    color: #050505;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    font-weight: normal;
    transition: background 0.2s;
}

.react-btn:hover:not([disabled]) {
    background: #e4e6eb;
}

.feed-divider {
    border: 0;
    height: 1px;
    background: #e4e6eb;
    margin: 12px 0;
}

.comments-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comment-item {
    background: #ffffff;
    border: 1px solid #e4e6eb;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
}

.comment-author {
    font-weight: bold;
    color: #65676b;
    font-size: 11px;
}

.comment-text {
    color: #1c1e21;
    margin: 2px 0 4px 0;
}

.comment-time {
    color: #90949c;
    font-size: 10px;
}

.comment-input-wrapper {
    display: flex;
    gap: 6px;
}

.comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccd0d5;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
}

.comment-input:focus {
    border-color: #1877f2;
}

.comment-submit-btn {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 20px;
}

/* --- Filter Navigation Tabs Layout --- */
.filter-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 15px 0 5px 0;
    width: 100%;
}

.filter-btn {
    flex: 1;
    background: #e4e6eb;
    color: #050505;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.filter-btn:hover {
    background: #d8dadf;
}

.filter-btn.active {
    background: #1877f2;
    color: #ffffff;
}