/* ============================================
   FEED CARDS - Reddit-style Group Discussion Cards
   ============================================ */

/* Card Container */
.feed-card {
    margin-bottom: 16px;
    overflow: hidden;
    background: transparent;
    border: none;
    border-bottom: 1px solid #2a2a3e;
    padding-bottom: 8px;
}
.feed-card-inner {
    padding: 0;
}

/* ---- Card Header ---- */
.feed-card-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 16px 8px;
}

/* Community badge */
.feed-card-community {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    background: rgba(124, 138, 255, 0.1);
    border: 1px solid rgba(124, 138, 255, 0.2);
    border-radius: 20px;
    padding: 3px 10px 3px 4px;
    transition: background 0.2s;
}
.feed-card-community:hover {
    background: rgba(124, 138, 255, 0.2);
    text-decoration: none;
}
.feed-card-community .community-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    background: #2a2a3e;
    flex-shrink: 0;
}
.feed-card-community .community-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.feed-card-community .community-icon i {
    font-size: 11px;
    color: #7c8aff;
}
.feed-card-community .community-name {
    font-size: 12px;
    font-weight: 600;
    color: #7c8aff;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dot separator */
.feed-card-dot {
    color: #555;
    font-size: 10px;
    margin: 0 1px;
}

/* User info row */
.feed-card-user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.feed-card-avatar {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}
.feed-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.feed-card-username {
    font-size: 13px;
    font-weight: 600;
    color: #e0e0e0;
    text-decoration: none;
}
.feed-card-username:hover {
    color: #7c8aff;
    text-decoration: underline;
}
.feed-card-meta {
    font-size: 12px;
    color: #888;
}
.feed-card-time {
    font-size: 12px;
    color: #666;
}

/* ---- Discussion Reference ---- */
.feed-card-discussion-ref {
    padding: 6px 16px 4px;
    font-size: 13px;
    color: #888;
}
.feed-card-discussion-ref i {
    color: #7c8aff;
    margin-right: 5px;
    font-size: 11px;
    transform: scaleX(-1);
    display: inline-block;
}
.feed-card-discussion-ref a {
    color: #7c8aff;
    text-decoration: none;
    font-weight: 500;
}
.feed-card-discussion-ref a:hover {
    text-decoration: underline;
    color: #99a5ff;
}

/* ---- Card Content (comment text) ---- */
.feed-card-content {
    padding: 8px 16px 10px;
    font-size: 14px;
    line-height: 1.55;
    color: #d0d0d0;
    word-break: break-word;
}

/* ---- Card Media ---- */
.feed-card-media {
    width: 100%;
    max-height: 600px;
    overflow: hidden;
    background: #111;
}
.feed-card-media img {
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    display: block;
}

/* ---- Card Actions Bar ---- */
.feed-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: none;
}
.feed-card-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #888;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.feed-card-action-btn:hover {
    background: rgba(255,255,255,0.06);
    color: #bbb;
    text-decoration: none;
}
.feed-card-action-btn i {
    font-size: 14px;
}
.feed-card-readmore {
    color: #7c8aff;
    font-weight: 500;
}
.feed-card-readmore:hover {
    color: #99a5ff;
    background: rgba(124, 138, 255, 0.1);
}

/* ---- Hide vote arrows on regular feed posts ---- */
.feed-item-points,
.vote-container {
    display: none !important;
}

/* ---- Round avatars on regular posts ---- */
.community-post-item img.community-post-item-image {
    border-radius: 50% !important;
    width: 45px !important;
    height: 45px !important;
    object-fit: cover;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 576px) {
    /* Hide sidebar and toggle button on mobile */
    #sidebar {
        display: none !important;
        width: 0 !important;
    }
    #sidebarCollapse {
        display: none !important;
    }
    
    .sidebar-layout-community .feed-section-bg,
    .sidebar-layout-community section.feed-section-bg {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .community-post-item-display {
        margin-left: 0 !important;
        padding-left: 0 !important;
        margin-right: 0 !important;
        padding-right: 0 !important;
    }
    .custom-menu {
        display: none !important;
    }

    .feed-card {
        border-radius: 0;
        margin-bottom: 4px;
        border-bottom: 1px solid #2a2a3e;
    }

    /* Header - compact row */
    .feed-card-header {
        padding: 10px 12px 4px;
        gap: 4px;
    }
    .feed-card-avatar {
        width: 24px;
        height: 24px;
    }
    .feed-card-username {
        font-size: 12px;
    }
    .feed-card-meta,
    .feed-card-time {
        font-size: 11px;
    }
    .feed-card-community .community-name {
        max-width: 120px;
        font-size: 11px;
    }
    .feed-card-community {
        padding: 2px 8px 2px 3px;
    }
    .feed-card-community .community-icon {
        width: 18px;
        height: 18px;
    }

    /* Content text - full width, tight padding */
    .feed-card-content {
        padding: 6px 12px 8px;
        font-size: 14px;
    }

    /* Media - FULL WIDTH within container */
    .feed-card-media {
        width: calc(100% + 24px);
        margin-left: -12px;
        max-height: none;
    }
    .feed-card-media img {
        width: 100%;
        max-height: 500px;
        object-fit: cover;
    }
    .feed-card-media video {
        width: 100%;
        max-height: 500px;
    }

    /* Actions bar - icon only, spread out */
    .feed-card-actions {
        padding: 8px 12px;
        justify-content: flex-start;
        gap: 4px;
    }
    .feed-card-action-btn {
        padding: 6px 8px;
    }
    .feed-card-action-btn span {
        display: none;
    }
    .feed-card-action-btn i {
        font-size: 18px;
    }

    /* Vote buttons inline */
    .feed-card-vote {
        display: flex;
        align-items: center;
        gap: 2px;
    }

    /* Comments section tighter */
    .feed-card-comments {
        padding: 0 12px;
    }
    .feed-card-comment-avatar img {
        width: 22px;
        height: 22px;
    }

    /* Discussion ref */
    .feed-card-discussion-ref {
        padding: 4px 12px;
        font-size: 12px;
    }

    .feed-card-readmore span {
        display: inline !important;
        font-size: 12px;
    }

    /* === GROUPED COMMUNITY ITEMS === */

    /* Stack the layout vertically on mobile */
    .community-post-item {
        flex-direction: column !important;
        padding: 10px 0 !important;
        gap: 6px !important;
    }

    /* Hide the vote container on grouped items */
    .community-post-item > .vote-container {
        display: none !important;
    }

    /* Header row: avatar + username + text on one line */
    .community-post-item > div:not(.vote-container) {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-left: 0 !important;
    }

    .community-post-item > div:not(.vote-container) > a:first-child {
        display: inline-block;
        position: absolute;
        width: 28px;
        height: 28px;
        overflow: hidden;
        z-index: 1;
    }

    /* Fix avatar - perfect circle, no stretching */
    .community-post-item img.community-post-item-image {
        width: 28px !important;
        height: 28px !important;
        max-height: 28px !important;
        min-height: 28px !important;
        max-width: 28px !important;
        min-width: 28px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
    }

    /* Username + action text row */
    .community-post-item-display {
        width: 100% !important;
    }

    .community-post-item-display > p,
    .community-post-item-display.community-post-item-display-slider > p {
        padding-left: 36px;
        font-size: 13px !important;
        line-height: 28px !important;
    }

    /* Media grid - full width */
    .community-post-item-display .flex-wrap-1,
    .community-post-item-display .media-grid {
        width: 100% !important;
        padding: 0 !important;
        margin-top: 6px;
    }

    /* Make thumbnails bigger on mobile */
    .community-post-item-display .display-image {
        width: 100% !important;
        height: auto !important;
        max-height: 400px;
        object-fit: cover;
        border-radius: 0 !important;
    }

    /* Single image uploads - full width */
    .community-post-item-display .flex-wrap-1 a {
        display: block;
        width: 100%;
    }

    /* Multiple image grid */
    .community-post-item-display .media-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }

    .community-post-item-display .media-grid .display-image {
        width: 100% !important;
        height: 150px !important;
        object-fit: cover;
    }

    /* Single image - no grid, full width */
    .community-post-item-display .media-grid a:only-child {
        grid-column: 1 / -1;
    }
    .community-post-item-display .media-grid a:only-child .display-image {
        height: auto !important;
        max-height: 400px;
    }

    /* Slider full width */
    .community-post-item-display .friend-full-slider {
        width: 100% !important;
    }
    .community-post-item-display .friend-full-slider .display-image,
    .community-post-item-display .friend-slider-image {
        width: 100% !important;
        height: auto !important;
        max-height: 400px;
        object-fit: cover;
        border-radius: 0 !important;
    }

    /* Stats bar under single images */
    .kink-video-primary-info-renderer {
        padding: 6px 12px;
    }
}