:root {
    --cafe-primary: #4f46e5;
    --cafe-secondary: #64748b;
    --cafe-bg: #f8fafc;
    --cafe-card-bg: #ffffff;
    --cafe-border: #e2e8f0;
}

.following-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #e2e8f0;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.following-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-tag-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.comment-row {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: #e2e8f0;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-tag-badge {
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
}

body {
    background-color: var(--cafe-bg);
}

.cafe-card {
    background: var(--cafe-card-bg);
    border: 1px solid var(--cafe-border);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.profile-cover {
    height: 100px;
    background: linear-gradient(135deg, var(--cafe-primary) 0%, #818cf8 100%);
}

.profile-avatar-container {
    margin-top: -50px;
    display: flex;
    justify-content: center;
    position: relative;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: #fff;
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar i {
    font-size: 5rem;
    color: var(--cafe-primary);
    line-height: 1;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.profile-info {
    text-align: center;
    padding: 1rem;
}

.profile-name {
    font-weight: 700;
    font-size: 1.25rem;
    color: #1e293b;
    margin-bottom: 0.25rem;
    cursor: pointer;
    transition: color 0.2s;
}

.profile-name:hover {
    color: var(--cafe-primary);
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    border-top: 1px solid var(--cafe-border);
    background: #fdfdfd;
}

.stat-box {
    text-align: center;
    flex: 1;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 8px;
    padding: 4px;
}

.stat-box:hover {
    background: #f1f5f9;
}

.stat-value {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    color: #0f172a;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--cafe-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.post-composer {
    min-height: 84px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem;
    background: #fff;
    outline: none;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-composer:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
}

.mention-suggestions {
    margin-top: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.mention-suggestion-btn {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.card-mention-suggestion {
    display: grid;
    grid-template-columns: 25px 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.5rem;
    align-items: center;
}

.card-mention-thumb {
    width: 25px;
    height: 25px;
    grid-row: 1 / span 2;
    border-radius: 4px;
    object-fit: contain;
    background: #f1f5f9;
}

.card-mention-main {
    font-weight: 600;
    color: #1e293b;
    line-height: 1.1;
}

.card-mention-meta {
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.1;
}

.mention-suggestion-btn:hover {
    background: #f1f5f9;
}

.feed-tabs .nav-link {
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.feed-tabs .nav-link.active {
    background-color: #4f46e5;
    color: #fff;
}

.feed-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.feed-item {
    padding: 1.5rem;
    border-bottom: 1px solid var(--cafe-border);
    transition: background 0.2s;
}

.feed-item:last-child {
    border-bottom: none;
}

.feed-item:hover {
    background: #fafafa;
}

.feed-item-highlight {
    border-left: 4px solid #6366f1;
    background: #eef2ff;
    animation: feed-highlight-pulse 1.2s ease-in-out 1;
}

@keyframes feed-highlight-pulse {
    0% {
        box-shadow: 0 0 0 rgba(99, 102, 241, 0);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.2);
    }
    100% {
        box-shadow: 0 0 0 rgba(99, 102, 241, 0);
    }
}

.feed-user-avatar {
    width: 48px;
    height: 48px;
    background: #e0e7ff;
    color: var(--cafe-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.feed-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.feed-content-wrapper {
    flex: 1;
}

.feed-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.feed-username {
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
}

.feed-username:hover {
    text-decoration: underline;
}

.feed-time {
    color: var(--cafe-secondary);
    font-size: 0.875rem;
}

.feed-text {
    font-size: 1rem;
    color: #334155;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.feed-mention-link {
    color: #4f46e5;
    font-weight: 600;
    text-decoration: none;
}

.feed-mention-link:hover {
    text-decoration: underline;
}

.feed-card-tag-link {
    color: #0f766e;
    font-weight: 700;
    text-decoration: none;
}

.feed-card-tag-link:hover {
    text-decoration: underline;
}

.feed-hashtag-link {
    color: #0ea5e9;
    font-weight: 700;
    text-decoration: none;
}

.feed-hashtag-link:hover {
    text-decoration: underline;
}

.feed-hashtag-filter {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
}

.feed-hashtag-filter-label {
    color: #64748b;
    font-weight: 600;
}

.feed-hashtag-filter-link {
    color: #0284c7;
    font-weight: 700;
    text-decoration: none;
}

.feed-hashtag-filter-link:hover {
    text-decoration: underline;
}

.trending-hashtags-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.trending-hashtag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.4rem 0.6rem;
    text-decoration: none;
    background: #f8fafc;
    transition: all 0.15s ease;
}

.trending-hashtag-item:hover {
    border-color: #bae6fd;
    background: #f0f9ff;
}

.trending-hashtag-tag {
    color: #0369a1;
    font-weight: 700;
}

.trending-hashtag-count {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
}

.feed-attachments {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.feed-card-thumb {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    cursor: pointer;
}

.feed-card-thumb:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    z-index: 10;
}

.feed-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f1f5f9;
    transition: transform 0.3s;
}

.feed-more-thumb {
    border: 1px dashed #94a3b8;
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feed-cards-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
}

.feed-cards-modal-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.feed-cards-modal-item img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: contain;
    background: #f8fafc;
}

.feed-cards-modal-caption {
    font-size: 0.75rem;
    padding: 0.5rem;
    text-align: center;
    color: #475569;
}

.feed-card-thumb:hover img {
    transform: scale(1.05);
}

.search-widget {
    position: sticky;
    top: 20px;
}

.search-input-group {
    position: relative;
}

.search-input {
    padding-left: 3rem;
    border-radius: 9999px;
    background-color: #fff;
    border: 1px solid var(--cafe-border);
    height: 3.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.search-input:focus {
    background-color: #fff;
    border-color: var(--cafe-primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cafe-secondary);
    font-size: 1.2rem;
}

.following-item {
    padding: 0.75rem;
    border-radius: 12px;
    transition: background 0.2s;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.following-item:hover {
    background: #f8fafc;
    border-color: #f1f5f9;
}

.btn-action-sm {
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.feed-actions button {
    color: var(--cafe-secondary);
    transition: all 0.2s;
    border-radius: 8px;
    padding: 0.5rem 1rem;
}

.feed-actions button:hover {
    background-color: #f1f5f9;
    color: var(--cafe-primary);
    text-decoration: none;
}

.feed-actions .like-count {
    font-weight: 600;
    font-size: 0.8rem;
}

.feed-delete-post-btn {
    opacity: 0.85;
}

.feed-delete-post-btn:hover {
    opacity: 1;
}

.activity-comments {
    border-top: 1px solid #e2e8f0;
    padding-top: 0.75rem;
}

.comment-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.5rem;
}

.comment-reply {
    margin-left: 1rem;
    background: #ffffff;
}

.comment-content {
    font-size: 0.85rem;
    color: #1e293b;
    word-break: break-word;
}

.comment-like-count {
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

#feedLoadMoreContainer {
    background: #fff;
}

.theme-dark .cafe-card,
.theme-dark #searchResults,
.theme-dark #searchResultsMobile {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

.theme-dark .profile-name,
.theme-dark .feed-title,
.theme-dark .feed-username,
.theme-dark .stat-value {
    color: #e2e8f0;
}

.theme-dark .profile-stats,
.theme-dark .feed-item:hover,
.theme-dark .following-item:hover,
.theme-dark .feed-actions button:hover {
    background: #0f172a;
}

.theme-dark .following-user-avatar,
.theme-dark .comment-avatar {
    background: #334155;
    color: #c7d2fe;
}

.theme-dark .feed-text,
.theme-dark .feed-time,
.theme-dark .stat-label,
.theme-dark .creator-name,
.theme-dark .text-muted {
    color: #94a3b8 !important;
}

.theme-dark .feed-mention-link {
    color: #a5b4fc;
}

.theme-dark .feed-card-tag-link {
    color: #5eead4;
}

.theme-dark .feed-hashtag-link {
    color: #38bdf8;
}

.theme-dark .feed-hashtag-filter-label {
    color: #94a3b8;
}

.theme-dark .feed-hashtag-filter-link {
    color: #7dd3fc;
}

.theme-dark .trending-hashtag-item {
    border-color: #334155;
    background: #0f172a;
}

.theme-dark .trending-hashtag-item:hover {
    border-color: #0284c7;
    background: #082f49;
}

.theme-dark .trending-hashtag-tag {
    color: #7dd3fc;
}

.theme-dark .trending-hashtag-count {
    color: #cbd5e1;
}

.theme-dark .post-composer {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

.theme-dark .post-composer:empty::before {
    color: #64748b;
}

.theme-dark .mention-suggestions {
    background: #1e293b;
    border-color: #334155;
}

.theme-dark .mention-suggestion-btn {
    color: #e2e8f0;
}

.theme-dark .card-mention-thumb {
    background: #0f172a;
}

.theme-dark .card-mention-main {
    color: #e2e8f0;
}

.theme-dark .card-mention-meta {
    color: #94a3b8;
}

.theme-dark .mention-suggestion-btn:hover {
    background: #0f172a;
}

.theme-dark .post-tag-badge {
    background: #312e81;
    color: #c7d2fe;
    border-color: #4338ca;
}

.theme-dark .feed-tabs .nav-link {
    color: #cbd5e1;
}

.theme-dark .feed-tabs .nav-link.active {
    background-color: #6366f1;
    color: #fff;
}

.theme-dark .search-input {
    background-color: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

.theme-dark .search-input:focus {
    background-color: #0f172a;
    border-color: #6366f1;
}

.theme-dark .search-input::placeholder {
    color: #94a3b8;
}

.theme-dark .profile-avatar,
.theme-dark .feed-card-thumb img,
.theme-dark .following-item .bg-light,
.theme-dark .list-group-item .bg-light {
    background: #0f172a !important;
}

.theme-dark .list-group-item,
.theme-dark .action-hover,
.theme-dark .feed-item,
.theme-dark .following-item {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

.theme-dark .list-group-item .text-dark,
.theme-dark .following-item .text-dark {
    color: #e2e8f0 !important;
}

.theme-dark .btn-outline-secondary {
    color: #cbd5e1;
    border-color: #475569;
}

.theme-dark .btn-outline-secondary:hover {
    background: #334155;
    color: #fff;
    border-color: #475569;
}

.theme-dark .feed-item-highlight {
    background: #1e1b4b;
    border-left-color: #818cf8;
}

.theme-dark #feedLoadMoreContainer {
    background: #1e293b;
    border-color: #334155 !important;
}

.theme-dark .activity-comments {
    border-top-color: #334155;
}

.theme-dark .comment-item {
    background: #0f172a;
    border-color: #334155;
}

.theme-dark .comment-reply {
    background: #111827;
}

.theme-dark .comment-content {
    color: #e2e8f0;
}

.theme-dark .feed-more-thumb {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

.theme-dark .feed-cards-modal-item {
    background: #1e293b;
    border-color: #334155;
}

.theme-dark .feed-cards-modal-item img {
    background: #0f172a;
}

.theme-dark .feed-cards-modal-caption {
    color: #cbd5e1;
}

@media (max-width: 991px) {
    .search-widget {
        position: static;
    }
}

/* Filter badges */
.feed-filter-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.feed-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1.5px solid #c7d2fe;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #4f46e5;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.feed-filter-badge.active {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

.feed-filter-badge:not(.active):hover {
    background: #e0e7ff;
}

/* SetShared collection box */
.feed-collection-box {
    background: #f1f5f9;
    color: #1e293b;
}

.theme-dark .feed-collection-box {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155 !important;
}

.theme-dark .feed-filter-badge {
    color: #a5b4fc;
    border-color: #4338ca;
    background: transparent;
}

.theme-dark .feed-filter-badge.active {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

.theme-dark .feed-filter-badge:not(.active):hover {
    background: #312e81;
}
