/* Single Post Page Styles */
:root {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --text-primary: #333333;
    --text-secondary: #757575;
    --border-color: #e0e0e0;
    --accent-color: #2196F3;
    --category-bg: #FFF3E0;
    --category-text: #E65100;
}

[data-theme="dark"] {
    --bg-primary: #14191f;
    --bg-secondary: #1b2028;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: #2d3339;
    --accent-color: #2196F3;
    --category-bg: #4a3000;
    --category-text: #ffa726;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
}

.single-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    margin-bottom: 100px;
}

.main-content {
    flex: 1;
    margin-right: 40px;
}

.timeline {
    width: 160px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

h1 {
    font-size: 24px;
    margin-bottom: 10px;
}

h1.entry-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.3;
}

.category {
    display: inline-block;
    background-color: var(--category-bg);
    color: var(--category-text);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

.post-category {
    display: inline-block;
    background-color: #FFF3E0;
    color: #E65100;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 20px;
    text-decoration: none;
}

.post-category:hover {
    background-color: #FFE0B2;
}

.entry-header {
    margin-bottom: 20px;
}

.separator {
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
}

.post {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.post-author {
    display: flex;
    align-items: center;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 15px;
}

.username {
    font-weight: bold;
    color: var(--text-primary);
    text-decoration: none;
}

.timestamp {
    color: var(--text-secondary);
    font-size: 14px;
}

.post-content {
    color: var(--text-primary);
    margin-bottom: 15px;
}

.post-actions {
    margin-top: 15px;
}

.post-actions button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    margin-right: 15px;
    font-size: 14px;
}

.reply-section {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.reply-icon {
    width: 40px;
    height: 40px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
}

.reply-text {
    color: var(--text-secondary);
}

.timeline {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.timeline-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 5px;
}

.timeline-line {
    width: 2px;
    height: 100px;
    background-color: var(--border-color);
    margin: 10px 0;
}

.write-reply-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--bg-primary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.write-reply-btn:hover {
    background-color: var(--border-color);
}

/* Reply Form Styles */
#comment-editor {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 20px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: none;
    width: calc(75% - 40px); /* Match the main-content width (75%) minus padding */
    max-width: 900px; /* Match or be slightly less than main content max-width */
}

#comment-editor form {
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.editor-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.editor-toolbar span {
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.editor-toolbar span:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

#comment-editor textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
    font-family: inherit;
    font-size: 16px;
    resize: vertical;
    background: var(--bg-primary);
    color: var(--text-primary);
}

#comment-editor .form-submit {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

#comment-editor .submit {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

#comment-editor .submit:hover {
    background-color: var(--accent-hover);
}

.editor-close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    padding: 5px;
    line-height: 1;
}

.editor-close:hover {
    color: var(--text-primary);
}

.reply-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

/* Ensure content doesn't get hidden behind the form */
.single-container {
    margin-bottom: 100px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .single-container {
        flex-direction: column;
        padding: 10px;
    }

    .main-content {
        margin-right: 0;
        margin-bottom: 20px;
    }

    .timeline {
        width: 100%;
        position: static;
    }

    .post {
        padding: 15px;
    }

    .reply-section {
        padding: 15px;
    }

    #comment-editor {
        width: 100%;
        height: 100vh;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        max-width: none;
        border-radius: 0;
        padding: 20px;
    }

    #comment-editor form {
        height: calc(100vh - 40px);
        display: flex;
        flex-direction: column;
    }

    #comment-editor textarea {
        flex: 1;
        resize: none;
    }

    .editor-toolbar {
        flex-wrap: wrap;
    }
}
