/* ================================
   POST VIEWER PAGE
================================ */

.post-viewer-page {
    display: none;
    width: 100%;
    min-height: 100vh;
    background: #0f0f0f;
    color: #fff;
}

.post-viewer-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(15, 15, 15, 0.95);
    border-bottom: 1px solid #262626;
}

.post-viewer-header button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.post-viewer-header h2 {
    margin: 0;
    font-size: 20px;
}

.post-viewer-feed {
    width: 100%;
    max-width: 700px;
    margin: auto;
}

/* Individual post */

.post-viewer-item {
    width: 100%;
    margin-bottom: 25px;
    border-bottom: 1px solid #262626;
    background: #0f0f0f;
}

/* Post author */

.post-viewer-author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.post-viewer-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.post-viewer-author-info {
    flex: 1;
    min-width: 0;
}

.post-viewer-author-info h4 {
    margin: 0;
    font-size: 14px;
    cursor: pointer;
}

.post-viewer-author-info p {
    margin: 4px 0 0;
    color: #aaa;
    font-size: 12px;
}

/* Post media */

.post-viewer-media {
    width: 100%;
    background: #000;
    overflow: hidden;
}

.post-viewer-media img,
.post-viewer-media video {
    display: block;
    width: 100%;
    max-height: 85vh;
    object-fit: contain;
    background: #000;
}

/* Post actions */

.post-viewer-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 14px;
}

.post-viewer-action-btn {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-viewer-action-btn span {
    font-size: 14px;
}

.post-viewer-action-btn:hover {
    opacity: 0.7;
}

/* Caption */

.post-viewer-caption {
    padding: 0 14px 15px;
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.post-viewer-caption strong {
    margin-right: 6px;
}

/* Comments */

.post-viewer-comments {
    padding: 0 14px 15px;
}

.post-viewer-comments-toggle {
    color: #aaa;
    font-size: 13px;
    cursor: pointer;
}

/* Loading */

.post-viewer-loading {
    text-align: center;
    padding: 50px 20px;
    color: #aaa;
}

/* Desktop */

@media (min-width: 768px) {

    .post-viewer-page {
        min-height: 100vh;
    }

    .post-viewer-feed {
        padding-top: 10px;
    }

    .post-viewer-item {
        border: 1px solid #262626;
        border-radius: 8px;
        overflow: hidden;
    }

}

/* Mobile */

@media (max-width: 767px) {

    .post-viewer-header {
        padding: 13px 15px;
    }

    .post-viewer-feed {
        width: 100%;
    }

    .post-viewer-item {
        margin-bottom: 15px;
    }

    .post-viewer-media img,
    .post-viewer-media video {
        max-height: 75vh;
    }

}

/* POST VIEWER COMMENT PROFILE */
.post-comment-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.post-comment-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
}

.post-comment-details {
    flex: 1;
    min-width: 0;
}

.post-comment-author {
    padding: 0;
    border: none;
    background: transparent;
    color: #222;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.post-comment-text {
    margin: 5px 0 0;
    color: #444;
    font-size: 14px;
    overflow-wrap: anywhere;
}

/* =================================
   POST VIEWER — MATCH HOME FEED
================================= */

.post-viewer-page {
    min-height: 100vh;
    padding: 30px;
    background: var(--background, #F8F9FC);
    color: var(--text-primary, #111827);
}

.post-viewer-feed {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* Post card */
.post-viewer-item {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border, #E5E7EB);
    border-radius: 14px;
    color: var(--text-primary, #111827);
}

/* Author header */
.post-viewer-author {
    min-height: 74px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    color: var(--text-primary, #111827);
}

.post-viewer-author img {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.post-viewer-author h4,
.post-viewer-author strong {
    color: var(--text-primary, #111827);
    font-size: 13px;
    font-weight: 700;
}

.post-viewer-author p,
.post-viewer-author small {
    margin-top: 4px;
    color: var(--text-secondary, #6B7280);
    font-size: 11px;
}

/* Post media */
.post-viewer-media {
    width: 100%;
    background: var(--surface, #F1F3F9);
}

.post-viewer-media img,
.post-viewer-media video {
    display: block;
    width: 100%;
    max-height: 550px;
    object-fit: contain;
    background: var(--surface, #F1F3F9);
}

/* Caption */
.post-viewer-caption {
    padding: 15px 18px;
    background: #fff;
    color: var(--text-primary, #111827);
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* Interaction buttons */
.post-viewer-actions {
    display: flex;
    align-items: center;
    border-top: 1px solid #eee;
    background: #fff;
}

.post-viewer-actions button {
    flex: 1;
    min-width: 0;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 8px;
    border: none;
    background: transparent;
    color: #555;
    font-size: 14px;
    cursor: pointer;
}

.post-viewer-actions button:hover {
    background: #f5f5f5;
}

.post-viewer-actions button.liked {
    color: #e63965;
    font-weight: 600;
}

/* Mobile */
@media (max-width: 600px) {
    .post-viewer-page {
        padding: 15px 12px 85px;
    }

    .post-viewer-feed {
        gap: 16px;
    }

    .post-viewer-item {
        border-radius: 12px;
    }

    .post-viewer-media img,
    .post-viewer-media video {
        max-height: 75vh;
    }

    .post-viewer-author {
        padding: 13px 14px;
    }

    .post-viewer-caption {
        padding: 13px 14px;
    }

    .post-viewer-actions button {
        gap: 5px;
        padding: 12px 5px;
        font-size: 12px;
    }
}

/* =================================
   POST VIEWER — WHITE COMMENT POPUP
================================= */

#postCommentsOverlay {
    background: rgba(0, 0, 0, 0.55);
}

#postCommentsOverlay .post-comments-dialog,
#postCommentsOverlay .post-comments-modal,
#postCommentsOverlay .post-comments-content {
    background: #fff !important;
    color: #222 !important;
}

#postCommentsOverlay h2,
#postCommentsOverlay h3,
#postCommentsOverlay p,
#postCommentsOverlay label {
    color: #222;
}

#postCommentsList {
    background: #fff;
    color: #222;
}

#postCommentsOverlay input,
#postCommentsOverlay textarea {
    background: #fff;
    color: #222;
    border: 1px solid #ddd;
}

#postCommentsOverlay input::placeholder,
#postCommentsOverlay textarea::placeholder {
    color: #888;
}

#postCommentsOverlay button {
    color: #333;
}