body {
    background-color: #F8FAFC;
    color: #1E293B;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px !important;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.header {
    background-color: #FFFFFF;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #E2E8F0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: rgb(157, 157, 189);
}

.search-bar {
    position: relative;
    width: 35%;
}

.search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 0.875rem;
    background-color: #F8FAFC;
    transition: all 0.15s ease;
}

.search-input:focus {
    outline: none;
    border-color: rgb(157, 157, 189);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    background-color: #FFFFFF;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 0.875rem;
}

.clear-search {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94A3B8;
    padding: 0.25rem;
    cursor: pointer;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.clear-search:hover {
    background-color: #F1F5F9;
    color: rgb(157, 157, 189);
}

.clear-search i {
    font-size: 0.75rem;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem 0;
}

.posts-section {
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 1.25rem;
}

.sort-options {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #E2E8F0;
}

.sort-button {
    padding: 0.375rem 0.75rem;
    border: none;
    background: none;
    color: #64748B;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.sort-button:hover {
    background-color: #F1F5F9;
    color: rgb(157, 157, 189);
}

.sort-button.active {
    background-color: rgb(157, 157, 189);
    color: #FFFFFF;
}

.post-form {
    background-color: #F8FAFC;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #E2E8F0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.post-form h2 {
    margin: 0 0 0.75rem 0;
    color: #1E293B;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-form h2::before {
    content: '\f075';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: rgb(157, 157, 189);
    font-size: 0.875rem;
}

.input-name {
    width: 100%;
    padding: 0.625rem 0.875rem;
    margin-bottom: 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    background-color: #FFFFFF;
}

.input-name:focus {
    outline: none;
    border-color: rgb(157, 157, 189);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

#submit-post {
    background-color: rgb(157, 157, 189);
    color: #FFFFFF;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

#submit-post:hover {
    background-color: #1D4ED8;
    transform: translateY(-1px);
}

#submit-post:active {
    transform: translateY(0);
}

#submit-post::before {
    content: '\f1d8';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 0.875rem;
}

.post-card {
    display: flex;
    gap: 0.75rem;
    background-color: #FFFFFF;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #E2E8F0;
    transition: all 0.15s ease;
    margin-left: auto;
    margin-right: auto;
}

.post-card:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-color: #E2E8F0;
}

.post-footer {
    display: flex;
    gap: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid #E2E8F0;
    align-items: center;
    justify-content: space-between;
}

.vote-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem;
    border-radius: 4px;
    background-color: #F8FAFC;
}

.vote-button {
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 4px;
    transition: all 0.15s ease;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.vote-button:hover {
    color: rgb(157, 157, 189);
    background-color: #F1F5F9;
}

.vote-button.active {
    color: rgb(157, 157, 189);
}

.vote-button.upvote.active {
    color: rgb(157, 157, 189);
}

.vote-button.downvote.active {
    color: #DC2626;
}

.score-display {
    font-weight: 600;
    color: #1E293B;
    font-size: 0.875rem;
    min-width: 2rem;
    text-align: center;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.comment-count {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #64748B;
    font-size: 0.75rem;
}

.comment-count i {
    font-size: 0.875rem;
}

.post-action {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #64748B;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    background-color: #F8FAFC;
    border: 1px solid transparent;
}

.post-action:hover {
    color: rgb(157, 157, 189);
    background-color: #F1F5F9;
    border: 1px solid #c3c8ce;
}

.post-action.comment-toggle {
    font-weight: 500;
}

.post-action.comment-toggle i {
    font-size: 0.75rem;
}

.post-content {
    flex: 1;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #64748B;
    font-size: 0.75rem;
}

.post-author {
    font-weight: 500;
    color: rgb(157, 157, 189);
}

.post-author .author-name {
    color: rgb(0, 108, 2);
}

.post-title {
    margin: 0 0 0.75rem 0;
    color: #1E293B;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
}

.post-text {
    color: #334155;
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.875rem;
}

/* Comment section */
.comment-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #E2E8F0;
    transition: all 0.3s ease;
}

.comment-section.hidden {
    display: none;
}

.comment-form-container {
    background-color: #F8FAFC;
    border-radius: 6px;
    padding: 0.875rem;
    margin-bottom: 1rem;
    border: 1px solid #E2E8F0;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.comment-input {
    width: 100%;
    min-height: 80px;
    padding: 0.625rem 0.875rem;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 0.875rem;
    resize: vertical;
    transition: all 0.15s ease;
    background-color: #FFFFFF;
}

.comment-input:focus {
    outline: none;
    border-color: rgb(157, 157, 189);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.comment-button {
    background-color: rgb(157, 157, 189);
    color: #FFFFFF;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    align-self: flex-end;
}

.comment-button:hover {
    background-color: rgb(157, 157, 189);
    transform: translateY(-1px);
}

.comment-button:active {
    transform: translateY(0);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.comment {
    background-color: #F8FAFC;
    border-radius: 6px;
    padding: 0.875rem;
    border: 1px solid #E2E8F0;
    transition: all 0.15s ease;
}

.comment:hover {
    border-color: #E2E8F0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
    color: #64748B;
    font-size: 0.75rem;
}

.comment-header span:last-child {
    color: #94A3B8;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.comment-header span:last-child::before {
    content: '•';
    color: #94A3B8;
}

.comment-author {
    font-weight: 500;
    color: rgb(157, 157, 189);
}

.comment-author .author-name {
    color: rgb(0, 108, 2) !important;
    display: inline-block !important;
}

.comment-author .author-name::before {
    content: '' !important;
}

.comment-text {
    color: #334155;
    line-height: 1.6;
    font-size: 0.875rem;
}

.no-comments {
    text-align: center;
    color: #64748B;
    padding: 0.875rem;
    background-color: #F8FAFC;
    border-radius: 6px;
    border: 1px dashed #E2E8F0;
    font-size: 0.875rem;
}

#message-box, #error-box {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    z-index: 1000;
    animation: slideIn 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#message-box {
    background-color: rgb(157, 157, 189);
    color: #FFFFFF;
}

#error-box {
    background-color: #DC2626;
    color: #FFFFFF;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.hidden {
    display: none;
}

/* New post button */
.new-post-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgb(157, 157, 189);
    color: #FFFFFF;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 1rem;
}

.new-post-button:hover {
    background-color: rgb(157, 157, 189);
    transform: translateY(-1px);
}

.new-post-button:active {
    transform: translateY(0);
}

.new-post-button i {
    font-size: 0.75rem;
}

/* Post form container */
.post-form-container {
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.post-form-container.hidden {
    display: none;
}

.post-form {
    background-color: #F8FAFC;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #E2E8F0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.post-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.post-form h2 {
    margin: 0;
    color: #1E293B;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-form-button {
    background: none;
    border: none;
    color: #64748B;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.close-form-button:hover {
    background-color: #F1F5F9;
    color: #1E293B;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #64748B;
    gap: 1rem;
}

.loading-state i {
    font-size: 2rem;
    color: rgb(157, 157, 189);
}

.no-posts {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748B;
}

.no-posts i {
    font-size: 3rem;
    color: #94A3B8;
    margin-bottom: 1rem;
}

.no-posts h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 0.5rem;
}

.no-posts p {
    font-size: 0.875rem;
}

.character-count {
    font-size: 0.75rem;
    color: #64748B;
    text-align: right;
    margin-top: 0.25rem;
}

.character-count.warning {
    color: #DC2626;
}

.username-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.username-popup-content {
    background-color: #FFFFFF;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.username-popup-content .markdown-content {
    padding-right: 1rem;
}

.username-popup-content .markdown-content h1 {
    font-size: 1.5rem;
    color: #1E293B;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #E2E8F0;
}

.username-popup-content .markdown-content h2 {
    font-size: 1.25rem;
    color: #1E293B;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.username-popup-content .markdown-content p {
    margin-bottom: 1rem;
    color: #334155;
}

.username-popup-content .markdown-content code {
    background-color: #F1F5F9;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.875em;
    color: rgb(157, 157, 189);
}

.username-popup-content .markdown-content pre {
    background-color: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

.username-popup-content .markdown-content pre code {
    background-color: transparent;
    padding: 0;
    color: #334155;
}

.username-popup-content .markdown-content ul,
.username-popup-content .markdown-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.username-popup-content .markdown-content li {
    margin: 0.25rem 0;
    color: #334155;
}

.username-popup-content .markdown-content blockquote {
    border-left: 4px solid #E2E8F0;
    margin: 1rem 0;
    padding: 0.5rem 0 0.5rem 1rem;
    color: #64748B;
    background-color: #F8FAFC;
    border-radius: 0 4px 4px 0;
}

.username-popup-content .markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.username-popup-content .markdown-content th,
.username-popup-content .markdown-content td {
    border: 1px solid #E2E8F0;
    padding: 0.75rem;
    text-align: left;
}

.username-popup-content .markdown-content th {
    background-color: #F8FAFC;
    font-weight: 600;
    color: #1E293B;
}

.username-popup-content .markdown-content td {
    color: #334155;
}

.username-popup-content .username-submit {
    margin-top: 1.5rem;
    width: 100%;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/* Scrollbar styling for the popup */
.username-popup-content::-webkit-scrollbar {
    width: 8px;
}

.username-popup-content::-webkit-scrollbar-track {
    background: #F1F5F9;
    border-radius: 4px;
}

.username-popup-content::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

.username-popup-content::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.username-popup h3 {
    margin: 0 0 0.5rem 0;
    color: #1E293B;
    font-size: 1.25rem;
    font-weight: 600;
}

.username-popup p {
    margin: 0 0 1.5rem 0;
    color: #64748B;
    font-size: 0.875rem;
}

.username-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.username-submit {
    background-color: rgb(157, 157, 189);
    color: #FFFFFF;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.username-submit:hover {
    background-color: rgb(157, 157, 189);
    transform: translateY(-1px);
}

.username-submit:active {
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.post-date {
    color: #64748B;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.post-date::before {
    content: '•';
    color: #94A3B8;
}

/* Markdown Styles */
.markdown-content {
    line-height: 1.6;
    color: #334155;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: 600;
    line-height: 1.25;
    color: #1E293B;
}

.markdown-content h1 { 
    font-size: 1.5em;
    border-bottom: 2px solid #E2E8F0;
    padding-bottom: 0.5em;
}

.markdown-content h2 { 
    font-size: 1.25em;
    border-bottom: 1px solid #E2E8F0;
    padding-bottom: 0.25em;
}

.markdown-content h3 { font-size: 1.125em; }
.markdown-content h4 { font-size: 1em; }
.markdown-content h5 { font-size: 0.875em; }
.markdown-content h6 { font-size: 0.75em; }

.markdown-content p {
    margin-bottom: 1em;
}

.markdown-content a {
    color: rgb(157, 157, 189);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.markdown-content a:hover {
    border-bottom-color: rgb(157, 157, 189);
}

.markdown-content strong {
    font-weight: 600;
    color: #1E293B;
}

.markdown-content em {
    font-style: italic;
    color: #475569;
}

.markdown-content ul,
.markdown-content ol {
    margin: 0.75em 0;
    padding-left: 1.5em;
    list-style-position: outside;
}

.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ol {
    list-style-type: decimal;
}

.markdown-content li {
    margin: 0.375em 0;
    display: list-item;
}

.markdown-content li > p {
    margin: 0.5em 0;
}

.markdown-content code {
    background-color: #F1F5F9;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.875em;
    color: rgb(157, 157, 189);
}

.markdown-content pre {
    background-color: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 1em;
    margin: 1em 0;
    overflow-x: auto;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
    color: #334155;
    font-size: 0.875em;
    line-height: 1.5;
}

.markdown-content blockquote {
    border-left: 4px solid #E2E8F0;
    margin: 1em 0;
    padding: 0.75em 1em;
    color: #64748B;
    background-color: #F8FAFC;
    border-radius: 0 4px 4px 0;
}

.markdown-content blockquote p {
    margin: 0;
}

.markdown-content blockquote p:not(:last-child) {
    margin-bottom: 0.5em;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1em 0;
    border: 1px solid #E2E8F0;
}

.markdown-content hr {
    border: none;
    border-top: 2px solid #E2E8F0;
    margin: 1.5em 0;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
    font-size: 0.875em;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid #E2E8F0;
    padding: 0.75em;
    text-align: left;
}

.markdown-content th {
    background-color: #F8FAFC;
    font-weight: 600;
    color: #1E293B;
}

.markdown-content td {
    color: #334155;
}

.markdown-content tr:nth-child(even) {
    background-color: #F8FAFC;
}

.markdown-content tr:hover {
    background-color: #F1F5F9;
}

/* Remove preview styles */
.markdown-preview {
    display: none;
}

/* Update help button position */
.markdown-help {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    color: #64748B;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.markdown-help:hover {
    color: rgb(157, 157, 189);
    background-color: #F1F5F9;
}

/* Single Post View */
.single-post-view {
    background-color: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 1.25rem;
    margin-top: 1rem;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748B;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.back-button:hover {
    color: rgb(157, 157, 189);
}

.back-button i {
    font-size: 0.75rem;
}

.post-link {
    color: #1E293B;
    text-decoration: none;
    transition: color 0.15s ease;
}

.post-link:hover {
    color: rgb(157, 157, 189);
}

/* Update post card styles for single view */
.single-post-view .post-card {
    margin: 0;
    border: none;
    padding: 0;
}

.single-post-view .post-card:hover {
    box-shadow: none;
}

/* Username change button */
.change-username-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: #64748B;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.change-username-button:hover {
    color: rgb(157, 157, 189);
    background-color: #F1F5F9;
}

.change-username-button i {
    font-size: 0.875rem;
} 