/* ===== MENTIONS & DROPDOWNS ===== */
.mention {
    font-weight: 700;
    color: #1da1f2;
    cursor: pointer;
}

#mentionDropdown {
    position: absolute;
    z-index: 1000;
    background: #1a2d3d;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    max-height: 200px;
    overflow-y: auto;
}

.dropdown-menu {
    position: absolute;
    background: #1a2d3d;
    border: 1px solid rgba(255,255,255,0.1);
    max-height: 200px;
    overflow-y: auto;
    width: 250px;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
}

.dropdown-menu div {
    padding: 10px 14px;
    cursor: pointer;
    color: #d9d9d9;
    transition: background 0.15s ease;
}

.dropdown-menu div:hover {
    background-color: rgba(255,255,255,0.05);
}


/* ===== LINKS IN POSTS ===== */
.post-text a, .comment-text a {
    color: #1da1f2;
    text-decoration: none;
    word-break: break-word;
}

.post-text a:hover, .comment-text a:hover {
    text-decoration: underline;
}


/* ===== MAIN LAYOUT ===== */
.main-layout-container {
    display: flex;
    justify-content: center;
    gap: 0;
    max-width: 1200px;
    margin: 80px auto 0;
}


/* ===== LEFT COLUMN ===== */
.left-column {
    width: 220px;
    padding: 16px 20px;
    position: sticky;
    top: 80px;
    height: fit-content;
}

.left-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.left-column ul li {
    margin-bottom: 4px;
}

.left-column ul li a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 28px;
    text-decoration: none;
    font-size: 17px;
    font-weight: 600;
    background-image: linear-gradient(135deg, #a2e7ee 0%, #a2e7ee 33.33%, #7bc0e8 66.67%, #4196e0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    transition: background-color 0.2s ease;
}

.left-column ul li a:hover {
    background-color: rgba(29, 161, 242, 0.08);
}

.patreon-effect {
    font-weight: bold;
    background-image: linear-gradient(135deg, #ffffff 0%, #ffd700 50%, #947c00 100%) !important;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    transition: all 0.2s ease;
}

.patreon-effect:hover {
    opacity: 0.85;
}


/* ===== RIGHT COLUMN ===== */
.right-column {
    width: 320px;
    padding: 16px 20px;
    position: sticky;
    top: 80px;
    height: fit-content;
}

.right-column h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 12px;
}


/* ===== POST FEED CONTAINER (center column) ===== */
.post-feed-container {
    flex: 1;
    max-width: 620px;
    min-width: 0;
    border-left: 1px solid rgba(255,255,255,0.08);
    border-right: 1px solid rgba(255,255,255,0.08);
}


/* ===== NEW POST / COMPOSE ===== */
.new-post {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.post-input-container {
    display: flex;
    gap: 12px;
    width: 100%;
}

#postMessage {
    width: 100%;
    padding: 12px 0;
    font-size: 18px;
    font-family: inherit;
    background-color: transparent;
    color: #e7e9ea;
    border: none;
    border-radius: 0;
    outline: none;
    resize: none;
    min-height: 52px;
    transition: border-color 0.2s ease;
}

#postMessage:focus {
    border-bottom: none;
}

#postMessage::placeholder {
    color: #536471;
}

.divider-line {
    display: none;
}

.button-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 12px;
    padding-top: 12px;
    padding-left: 54px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.post-btn {
    background: #1da1f2;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
    letter-spacing: 0.3px;
}

.post-btn:hover {
    background: #1a8cd8;
}

.image-btn {
    background: transparent;
    color: #1da1f2;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 9999px;
    border: 1px solid rgba(29, 161, 242, 0.3);
    cursor: pointer;
    font-size: 13px;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}

.image-btn:hover {
    background: rgba(29, 161, 242, 0.08);
    border-color: rgba(29, 161, 242, 0.5);
}

.generated-image-container {
    margin-top: 12px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.generated-image {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin-bottom: 8px;
}


/* ===== FEED AREA ===== */
.feed {
    display: flex;
    flex-direction: column;
}


/* ===== INDIVIDUAL POST ===== */
.post-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #e7e9ea;
    transition: background-color 0.15s ease;
}

.post-item:hover {
    background-color: rgba(255,255,255,0.03);
}

.post-item .avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    margin-right: 0;
}

.post-content {
    flex: 1;
    min-width: 0;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    line-height: 1.3;
}

.post-content .post-author,
.post-content a.author-link {
    font-weight: 700;
    font-size: 15px;
    color: #e7e9ea;
    text-decoration: none;
    display: inline;
}

.post-content a.author-link:hover {
    text-decoration: underline;
}

/* dff22a: author skeleton — shown until the cached users/{uid} lookup resolves, so the
   author no longer flashes "Unknown User". A subtle shimmer bar holds the line height. */
.post-content a.author-link.author-loading {
    display: inline-block;
    width: 110px;
    height: 14px;
    border-radius: 7px;
    vertical-align: middle;
    background: linear-gradient(90deg, #22384a 25%, #2c465c 37%, #22384a 63%);
    background-size: 400% 100%;
    animation: ktm-author-shimmer 1.2s ease-in-out infinite;
    color: transparent;
}

@keyframes ktm-author-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* dff22a: lightweight loading state while a post detail is fetched (no blank flash). */
.post-view-loading {
    padding: 28px 16px;
    text-align: center;
    color: #8899a6;
    font-size: 15px;
}

.post-content .post-time {
    font-size: 13px;
    color: #71767b;
    white-space: nowrap;
}

.post-content .post-time::before {
    content: '\00b7';
    margin: 0 4px;
}

.post-content .post-text {
    font-size: 15px;
    line-height: 1.5;
    color: #e7e9ea;
    margin-top: 4px;
    margin-bottom: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-image {
    width: 100%;
    max-height: 510px;
    height: auto;
    border-radius: 16px;
    margin-top: 12px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.08);
}


/* ===== POST ACTIONS (comment, like, view, share) ===== */
.post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 360px;
    margin-top: 12px;
}

.post-actions .action-icon {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #71767b;
    font-size: 13px;
    transition: color 0.15s ease;
    padding: 4px 8px;
    border-radius: 9999px;
    margin: -4px -8px;
}

.post-actions .action-icon:hover {
    color: #1da1f2;
}

.post-actions .action-icon.action-comment:hover {
    color: #1da1f2;
    background: rgba(29, 161, 242, 0.08);
}

.post-actions .action-icon.action-like:hover {
    color: #f91880;
    background: rgba(249, 24, 128, 0.08);
}

.post-actions .action-icon.action-like.liked {
    color: #f91880;
}

.post-actions .action-icon.action-like.liked i {
    font-weight: 900;
}

.post-actions .action-icon.action-views:hover {
    color: #1da1f2;
    background: rgba(29, 161, 242, 0.08);
}

.post-actions .action-icon.action-share:hover {
    color: #1da1f2;
    background: rgba(29, 161, 242, 0.08);
}

.post-actions .action-icon i {
    font-size: 15px;
}

.post-actions .action-icon span {
    font-size: 13px;
}


/* ===== POST DETAIL VIEW ===== */
.post-view-container {
    width: 100%;
    padding: 0;
    color: #e7e9ea;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    color: #e7e9ea;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: background 0.15s ease;
    position: sticky;
    top: 60px;
    background: rgba(15, 25, 35, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10;
}

.back-btn:hover {
    background: rgba(255,255,255,0.03);
}

.back-btn i {
    margin-right: 8px;
    color: #1da1f2;
}

.post-view-content {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.post-view-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.post-view-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.post-view-author-info {
    display: flex;
    flex-direction: column;
}

.post-view-body .post-author,
.post-view-author-info .post-view-author-name {
    font-weight: 700;
    font-size: 16px;
    color: #e7e9ea;
    text-decoration: none;
}

.post-view-author-info .post-view-author-name:hover {
    text-decoration: underline;
}

.post-view-body .post-time,
.post-view-author-info .post-view-handle {
    font-size: 13px;
    color: #71767b;
    margin-top: 1px;
}

.post-view-text {
    font-size: 17px;
    line-height: 1.55;
    color: #e7e9ea;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-view-image {
    width: 100%;
    max-height: 510px;
    height: auto;
    border-radius: 16px;
    margin-top: 12px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.08);
}

.post-view-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 14px;
    color: #71767b;
}

.post-view-meta .meta-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-view-meta .meta-stat .meta-count {
    color: #e7e9ea;
    font-weight: 700;
}

.post-view-actions {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.post-view-actions .action-icon {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #71767b;
    font-size: 18px;
    padding: 12px 16px;
    border-radius: 9999px;
    transition: all 0.15s ease;
}

.post-view-actions .action-icon:hover {
    color: #1da1f2;
    background: rgba(29, 161, 242, 0.08);
}

.post-view-actions .action-icon.action-like:hover {
    color: #f91880;
    background: rgba(249, 24, 128, 0.08);
}

.post-view-actions .action-icon.action-like.liked {
    color: #f91880;
}

.post-view-actions .action-icon.action-share:hover {
    color: #1da1f2;
    background: rgba(29, 161, 242, 0.08);
}


/* ===== SHARE BUTTON (legacy, hidden in new layout) ===== */
.share-btn {
    display: none;
}


/* ===== REPLY SECTION ===== */
.reply-section {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.reply-section textarea {
    flex: 1;
    padding: 12px 0;
    border-radius: 0;
    font-size: 15px;
    font-family: inherit;
    border: none;
    resize: none;
    background-color: transparent;
    color: #e7e9ea;
    outline: none;
    min-height: 48px;
}

.reply-section textarea:focus {
    outline: none;
}

.reply-section textarea::placeholder {
    color: #536471;
}

.reply-btn {
    background: #1da1f2;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    align-self: flex-end;
    white-space: nowrap;
}

.reply-btn:hover {
    background: #1a8cd8;
}


/* ===== COMMENTS ===== */
.comments-section {
    margin-top: 0;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: background-color 0.15s ease;
}

.comment-item:hover {
    background-color: rgba(255,255,255,0.02);
}

.comment-item .avatar {
    width: 36px;
    height: 36px;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
}

.comment-content .comment-author {
    font-weight: 700;
    font-size: 14px;
    color: #e7e9ea;
}

.comment-content .comment-time {
    font-size: 13px;
    color: #71767b;
}

.comment-content .comment-time::before {
    content: '\00b7';
    margin: 0 4px;
}

.comment-content .comment-text {
    font-size: 14px;
    line-height: 1.5;
    color: #e7e9ea;
    margin-top: 2px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}


/* ===== MODAL (Image Generation) ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #0f1923;
    margin: 10% auto;
    padding: 28px;
    width: 90%;
    border-radius: 16px;
    max-width: 480px;
    color: #e7e9ea;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
}

.modal-content h2 {
    margin-top: 0;
    font-size: 20px;
    color: #e7e9ea;
}

.modal-content p {
    font-size: 14px;
    color: #71767b;
    margin-top: 6px;
}

.close {
    color: #71767b;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 8px;
    right: 14px;
    transition: color 0.15s ease;
}

.close:hover {
    color: #e7e9ea;
}

#imagePrompt {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    background-color: rgba(255,255,255,0.04);
    color: #e7e9ea;
    border: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 16px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

#imagePrompt:focus {
    outline: none;
    border-color: #1da1f2;
}

.generate-btn {
    width: 100%;
    padding: 12px;
    background: #1da1f2;
    color: #fff;
    border: none;
    border-radius: 9999px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 8px;
}

.generate-btn:hover {
    background: #1a8cd8;
}


/* ===== IMAGE GENERATED MESSAGE ===== */
#imageGeneratedMessage {
    text-align: center;
    margin: 8px auto;
    font-weight: 600;
    font-size: 14px;
    background-image: linear-gradient(135deg, #34d058 0%, #28a745 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}


/* ===== AUTH CTA ===== */
.auth-cta {
    text-align: center;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.auth-cta p {
    color: #71767b;
    font-size: 15px;
}

.sign-up-highlight {
    color: #1da1f2;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    transition: opacity 0.2s ease;
}

.sign-up-highlight:hover {
    text-decoration: underline;
}


/* ===== TOAST NOTIFICATION ===== */
.toast-notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1da1f2;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(29, 161, 242, 0.3);
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* ===== LOADING SPINNERS ===== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.kraken-image-loading-spinner {
    border: 3px solid rgba(255,255,255,0.1);
    border-top: 3px solid #1da1f2;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

.main-posts-loading-spinner {
    border: 3px solid rgba(255,255,255,0.1);
    border-top: 3px solid #1da1f2;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}


/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
    .right-column {
        display: none;
    }
}

@media (max-width: 768px) {
    .left-column {
        display: none;
    }
    .main-layout-container {
        justify-content: center;
    }
    .post-feed-container {
        border-left: none;
        border-right: none;
    }
    .button-container {
        padding-left: 0;
    }
}
