/* Community Feed CSS - Dark Theme for BitcoinCounterFlow */
:root {
    --cf-primary-color: linear-gradient(93deg, #e71792, #0084ff);
    --cf-liked-color: #E0245E; /* Twitter-like red for liked state */
    --cf-background: #080808; /* Dark background to match theme */
    --cf-border-color: #2F2F2F;
    --cf-text-color: #E6E6E6; /* Light text for dark theme */
    --cf-secondary-text: #A0A0A0; /* Muted text for meta info */
    --cf-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --cf-border-radius: 12px;
    --cf-spacing: 16px;
}

.site-main.hfeed {
   display: flex;
}

/* Container for the community feed */
#primary.content-area {
    max-width: 700px;
    margin: 0 auto;
    padding: var(--cf-spacing);
    background: var(--cf-background);
}

/* Page title styling */
.page-header .page-title {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--cf-text-color);
    text-align: center;
    margin-bottom: calc(var(--cf-spacing) * 2);
    position: relative;
    padding-bottom: 8px;
}

.page-header .page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 92.5%;
    height: 3px;
    background: var(--cf-primary-color);
    border-radius: 2px;
}

/* Post card styling */
article.post-community_post {
    background: var(--cf-background);
    border: 1px solid var(--cf-border-color);
    border-radius: var(--cf-border-radius);
    margin-bottom: var(--cf-spacing);
    padding: var(--cf-spacing);
    box-shadow: var(--cf-shadow);
    transition: box-shadow 0.2s ease;
}


article.post-community_post:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Post header */
.entry-header {
    display: block;
    margin-bottom: var(--cf-spacing);
}

.entry-header .entry-title {
    font-size: 1.2rem;
    color: var(--cf-text-color);
    margin: 0 0 8px 0;
    font-weight: 500;
    text-transform: uppercase;
}

.entry-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--cf-secondary-text);
    font-size: 0.9rem;
}

.entry-meta .posted-on,
.entry-meta .byline {
    display: block;
}

/* Post content */
.entry-content {
    margin-bottom: var(--cf-spacing);
    color: var(--cf-text-color);
    line-height: 1.5;
    position: relative;
}

.content-preview {
    transition: max-height 0.3s ease;
}

.content-preview img,
.content-preview video {
    max-width: 100%;
    border-radius: var(--cf-border-radius);
    margin-top: 8px;
    border: 2px solid #333;
}

/* Load More button */
.cf-load-more {
    background: none;
    border: 1px solid var(--cf-border-color);
    color: var(--cf-text-color);
    padding: 8px 26px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 8px;
    transition: background 0.2s ease, color 0.2s ease;
    display: block;
}

.cf-load-more:hover {
    background: var(--cf-primary-color);
    color: #fff;
}

/* Footer with interactions */
.entry-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--cf-border-color);
    padding-top: var(--cf-spacing);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* Like button */
.cf-like-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--cf-secondary-text);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.cf-like-button:hover {
    color: var(--cf-liked-color);
}

.cf-like-button.liked {
    color: var(--cf-liked-color);
}

.cf-like-button::before {
    content: '\f004'; /* Font Awesome heart icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 400;
}

.cf-like-button.liked::before {
    font-weight: 900; /* Solid heart for liked state */
}

.cf-like-count {
    color: var(--cf-secondary-text);
    font-size: 0.9rem;
}

/* Comments link */
.comments-link {
    color: var(--cf-secondary-text);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.comments-link::before {
    content: '\f075'; /* Font Awesome comment icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 400;
}

.comments-link:hover {
    color: var(--cf-primary-color);
}

/* Chat widget base styles */
.cf-chat-widget {
    background: var(--cf-background);
    border: 1px solid var(--cf-border-color);
    border-radius: var(--cf-border-radius);
    box-shadow: var(--cf-shadow);
    display: flex;
    flex-direction: column;
}

/* Chat widget on /feed page */
.cf-chat-widget.cf-feed-chat {
    position: sticky;
    margin-top: 10px;
    margin-right: 10px;
    width: 300px;
    min-height: 450px;
    bottom: 0;
    
}

/* Chat widget on other pages */
.cf-chat-widget.cf-default-chat {
    width: 100%;
    max-width: 400px;
    min-height: 300px;
    margin: 20px auto;
    border-radius: 8px;
}

/* Chat widget full height */
.cf-chat-widget.full-height-chat {
    height: 100%;
    min-height: 0;
}

/* Chat header */
.cf-chat-header {
    padding: 10px;
    border-bottom: 1px solid var(--cf-border-color);
}

.cf-chat-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--cf-text-color);
}

/* Chat messages */
.cf-chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Chat message */
.cf-chat-message {
    margin-bottom: 10px;
    position: relative;
}

.cf-chat-message p {
    margin: 5px 0;
    color: var(--cf-text-color);
    font-size: 0.9rem;
}

.cf-chat-author {
    font-weight: 600;
    color: var(--cf-text-color);
    font-size: 0.9rem;
}

.cf-chat-date {
    color: var(--cf-secondary-text);
    font-size: 0.8rem;
    margin-left: 5px;
}

/* Delete button */
.cf-delete-message {
    background: none;
    border: none;
    color: var(--cf-liked-color);
    font-size: 0.8rem;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 0;
    padding: 2px 5px;
}

.cf-delete-message:hover {
    text-decoration: underline;
}

/* Hide delete button for non-admins */
body:not(.cf-is-admin) .cf-delete-message {
    display: none;
}

/* Chat form */
.cf-chat-form {
    padding: 10px;
    border-top: 1px solid var(--cf-border-color);
}

.cf-chat-form textarea {
    width: 100%;
    height: 50px;
    resize: none;
    background: #1A1A1A;
    color: var(--cf-text-color);
    border: 1px solid var(--cf-border-color);
    border-radius: 5px;
    padding: 5px;
    font-size: 0.9rem;
}

.cf-chat-form button {
    width: 100%;
    padding: 8px;
    background: var(--cf-primary-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 0.9rem;
}

.cf-chat-form button:hover {
    opacity: 0.9;
}

/* Responsive design for chat widget */
@media (max-width: 600px) {
    .cf-chat-widget.cf-feed-chat {
        width: 100%;
        right: 0;
        bottom: 0;
        border-radius: 0;
        display: none;
    }

    .cf-chat-widget.cf-default-chat {
        width: 100%;
        max-width: 100%;
        margin: 10px 0;
        min-height: 250px;
    }
}

/* Responsive design */
@media (max-width: 600px) {
    #primary.content-area {
        padding: calc(var(--cf-spacing) / 2);
    }

    article.post-community_post {
        padding: calc(var(--cf-spacing) / 2);
    }

    .page-header .page-title {
        font-size: 1.5rem;
    }

    .entry-header .entry-title {
        font-size: 1.1rem;
    }

    .entry-meta {
        font-size: 0.8rem;
    }

    .cf-chat-widget {
        width: 100%;
        right: 0;
        bottom: 0;
        border-radius: 0;
        display: none;
    }
}

/* Integration with Blocksy dark theme */
body.ct-theme {
    --cf-primary-color: var(--theme-palette-color-1, linear-gradient(93deg, #e71792, #0084ff));
    --cf-background: var(--theme-palette-color-7, #080808);
    --cf-border-color: var(--theme-border-color, #2F2F2F);
    --cf-text-color: var(--theme-text-color, #E6E6E6);
    --cf-secondary-text: var(--theme-secondary-text-color, #A0A0A0);
}