/* Post View Full Page Styles */
.post-view-active {
    overflow: hidden;
    height: 100vh;
}

.post-view-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9); /* slightly transparent */
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (prefers-color-scheme: dark) {
    .post-view-container {
        background: rgba(16, 16, 16, 0.9); /* dark mode background with transparency */
    }
}

.post-view-container.active {
    opacity: 1;
    transform: translateY(0);
}

.post-view-backdrop {
    display: none;
}

.post-view-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.post-view-header {
    display: flex;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    padding: 10px 0;
    position: relative;
    min-height: 48px;

    /* Glass effect */
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    .post-view-header {
        background-color: rgba(16, 16, 16, 0.3);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    }
}

.post-view-header-back {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 16px;
}

.post-view-header-back:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    .post-view-header-back:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

.post-view-header-title {
    font-weight: 600;
    font-size: 16px;
}

@media (prefers-color-scheme: dark) {
    .post-view-header-title {
        color: #f0f0f0;
    }
}

.post-view-main {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    width: 100%;
}

/* MOBILE FIX: Make post and comment sections same width */
.post-view-content .post {
    border-bottom: none;
    padding: 7px;
    width: 100%;
    box-sizing: border-box;
}

.post-view-comments {
    border-top: 1px solid #eee;
    padding: 15px;
    background: #ffffff;
    width: 100%;
    box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
    .post-view-comments {
        border-top: 1px solid #333;
        background: #101010;
    }
}

.comments-header h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #333;
}

@media (prefers-color-scheme: dark) {
    .comments-header h3 {
        color: #f0f0f0;
    }
}

.comments-placeholder {
    color: #666;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

@media (prefers-color-scheme: dark) {
    .comments-placeholder {
        color: #aaa;
    }
}

.post-view-comment-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #000;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background-color 0.2s;
    z-index: 1001;
}

.post-view-comment-button:hover {
    transform: scale(1.05);
    background-color: #333;
}

/* Loading spinner */
.post-loading {
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Desktop styles */
@media (min-width: 768px) {
    .post-view-container {
        position: fixed;
        height: 100%;
    }

    .post-view-content .post {
        max-width: 600px;
        padding: 20px 0;
        border: none;
    }

    .post-view-comments {
        max-width: 600px;
        padding: 20px 0;
        border-top: 1px solid #eee;
        background: #ffffff;
    }
    
    @media (prefers-color-scheme: dark) {
        .post-view-comments {
            border-top: 1px solid #333;
            background: #101010;
        }
    }

    .post-view-main {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .post-view-comment-button {
        right: calc(50% - 300px + 20px);
        bottom: 30px;
    }
}

/* Smooth animations for opening/closing */
.post-view-container {
    animation-duration: 0.3s;
    animation-fill-mode: both;
}

.post-view-container.active {
    animation-name: postViewFadeIn;
}

@keyframes postViewFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
