/* ===================================
   CSS Variables & Reset
   =================================== */

/* CRITICAL FIX: Prevent video overflow */



.feed-media-single,
.feed-media-single video,
.feed-media-single img,
.feed-item-image {
    max-width: 100%;
    width: 100%;
    height: auto;
}

:root {
    --brand: #198BEA;
    --brand-600: #1476c9;
    --brand-050: #eaf5ff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* ===================================
   Main Content Layout
   =================================== */
.main-content {
    max-width: 1280px;
    max-width: 1220px;
    margin: 24px auto;
    margin: 95px auto;
    padding: 0 24px;
}

.content-container {
    display: grid;
    grid-template-columns: 240px 1fr 320px;
    gap: 24px;
}

/* ===================================
   Card Component
   =================================== */
.feed-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.feed-card:hover {
    box-shadow: var(--shadow-md);
}

.feed-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

/* ===================================
   Left Sidebar
   =================================== */

/* Wrapper for sticky sidebar functionality */
.sidebar-sticky-wrapper {
    position: relative;
    width: 100%;
}

.left-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* Smart sticky behavior handled by JavaScript */
}

.profile-card {
    padding: 0;
}

.profile-cover {
    height: 60px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-600) 100%);
}

.profile-info {
    padding: 0 16px 16px;
    text-align: center;
    margin-top: -30px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--white);
    overflow: hidden;
    margin: 0 auto 12px;
    box-shadow: var(--shadow-md);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.profile-title {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 2px;
}

.profile-org {
    font-size: 13px;
    color: var(--brand);
    font-weight: 500;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-right: 1px solid var(--border);
}

.stat-item:last-child {
    border-right: none;
}

.stat-label {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    word-wrap: break-word;
    text-align: center;
    line-height: 1.2;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-top: 4px;
}

.quick-links {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.quick-link.active {
    background: var(--bg);
    color: var(--brand);
}


.quick-link.active i {
    color: var(--brand);
}

.quick-link i {
    color: var(--muted);
    width: 20px;
    font-size: 16px;
}

.quick-link:hover {
    background: var(--bg);
    color: var(--brand);
}

.quick-link:hover i {
    color: var(--brand);
}

.research-interests {
    padding: 16px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-direction: unset;
}

.tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--brand-050);
    color: var(--brand);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.tag:hover {
    background: var(--brand);
    color: white;
}

/* ===================================
   Main Feed
   =================================== */
.main-feed {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 700px;
    padding: 0;
}

#feedContainer {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.create-post {
    padding: 16px;
}

.create-post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.create-post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.create-post-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    cursor: pointer;
}

.create-post-input::placeholder {
    font-size: 14px;
}

.create-post-input:hover {
    background: var(--bg);
}

.create-post-input:focus {
    outline: none;
    border-color: var(--brand);
    background: var(--white);
    cursor: text;
}

.create-post-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--bg);
    color: var(--brand);
}

.action-btn i {
    font-size: 18px;
}

/* Feed Item Cards */
.feed-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feed-item:hover {
    box-shadow: var(--shadow-md);
}

.feed-item-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
}

.feed-item-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.feed-item-info {
    flex: 1;
}

.feed-item-author {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    display: block;
    margin-bottom: 2px;
}

.feed-item-author:hover {
    color: var(--brand);
}

.feed-item-meta {
    font-size: 13px;
    color: var(--muted);
}

.feed-item-meta span {
    margin-right: 2px;
}

.feed-item-menu {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.feed-item-menu:hover {
    background: var(--bg);
    color: var(--text);
}

.feed-item-content {
    padding: 0 16px 16px;
}

.feed-item-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
}

.feed-item-description {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
    /* margin-bottom: 12px; */
    margin: 12px 0 12px 0;
}

.feed-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* Feed Item Title Link */
.feed-item-title-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    position: relative;
    cursor: pointer;
    transition: color 0.3s ease;
}

.feed-item-title-link:hover .feed-item-title {
    color: var(--brand);
}

.feed-item-title-link .feed-item-title {
    margin: 0;
    display: inline;
}

/* Post content clickable links */
.post-link {
    color: #198BEA;
    text-decoration: underline;
    word-break: break-all;
    transition: color 0.2s ease;
}

.post-link:hover {
    color: #1476c9;
    text-decoration: underline;
}

.feed-item-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    margin-top: 12px;
    border-radius: var(--radius-md);
}

/* Question-specific styles */
.question-description-truncate {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
    margin-top: 8px;
}

.tag-more {
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
    font-weight: 600;
}

.tag-more:hover {
    background: var(--border);
    color: var(--text);
    border-color: var(--muted);
}

.accepted-answer-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #10b981;
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin: 8px 0;
    animation: fadeIn 0.3s ease-out;
}

.accepted-answer-badge i {
    font-size: 14px;
}

.accepted-answer-badge-header {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #10b981;
    color: white;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

.accepted-answer-badge-header i {
    font-size: 11px;
}

.publication-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.publication-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
}

.publication-meta-item i {
    color: var(--brand);
}

.publication-meta-item strong {
    color: var(--text);
    font-weight: 600;
}

.feed-item-actions {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-top: 1px solid var(--border);
}

.feed-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.feed-action-btn:hover {
    background: var(--bg);
    color: var(--brand);
}

.feed-action-btn.active {
    color: var(--brand);
}

.feed-action-btn i {
    font-size: 18px;
}

.load-more {
    text-align: center;
    padding: 24px 0;
}

.btn-load-more {
    padding: 12px 32px;
    background: var(--white);
    border: 2px solid var(--brand);
    color: var(--brand);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-load-more:hover {
    background: var(--brand);
    color: white;
}

.btn-load-more i {
    animation: spin 1s linear infinite;
    display: none;
}

.btn-load-more.loading i {
    display: inline-block;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   Right Sidebar
   =================================== */
.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.trending-topics,
.suggested-researchers,
.upcoming-events,
.popular-questions {
    padding: 16px;
}

.trending-list,
.researcher-list,
.event-list,
.question-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trending-item {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: var(--transition);
}

.trending-item:hover {
    background: var(--bg);
}

.trending-tag {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.trending-count {
    font-size: 12px;
    color: var(--muted);
}

.researcher-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.researcher-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.researcher-info {
    flex: 1;
    min-width: 0;
}

.researcher-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: block;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.researcher-title {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.researcher-designation {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.researcher-stats {
    font-size: 11px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.researcher-stats i {
    font-size: 12px;
    color: var(--brand);
}

.btn-follow,
.btn-follow-researcher {
    padding: 6px 16px;
    background: transparent;
    border: 1px solid var(--brand);
    color: var(--brand);
    font-size: 13px;
    font-weight: 600;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-follow:hover,
.btn-follow-researcher:hover {
    background: var(--brand);
    color: white;
}

.btn-follow.following,
.btn-follow-researcher.following {
    background: var(--bg);
    border-color: var(--border);
    color: var(--muted);
}

.btn-follow.following:hover,
.btn-follow-researcher.following:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #ef4444;
}

.event-item {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
}

.event-item:hover {
    border-color: var(--brand);
    background: var(--brand-050);
}

.event-date {
    display: inline-block;
    padding: 4px 8px;
    background: var(--brand-050);
    color: var(--brand);
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.event-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.event-host {
    font-size: 12px;
    color: var(--muted);
}

.question-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

.question-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
    display: block;
    text-decoration: none;
    line-height: 1.4;
}

.question-title:hover {
    color: var(--brand);
}

.question-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--muted);
}

.view-all {
    display: block;
    text-align: center;
    padding: 10px;
    margin-top: 12px;
    color: var(--brand);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.view-all:hover {
    background: var(--bg);
}

.sidebar-footer {
    padding: 16px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.footer-links a {
    font-size: 12px;
    color: var(--muted);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--brand);
}

.copyright {
    font-size: 11px;
    color: var(--muted);
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 1024px) {
    .content-container {
        grid-template-columns: 1fr 320px;
    }

    .left-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 16px;
    }

    .search-bar {
        display: none;
    }

    .nav-item span {
        display: none;
    }

    .nav-item {
        padding: 8px 12px;
    }

    .content-container {
        grid-template-columns: 1fr;
        padding: 0 16px;
    }

    .right-sidebar {
        display: none;
    }

    .main-content {
        margin: 16px auto;
        padding: 0;
    }
}

/* ===================================
   Poll Styles - Compact Design
   =================================== */
.feed-poll {
    margin: 12px 0;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.feed-poll:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.poll-question {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    line-height: 1.4;
}

.poll-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.poll-option {
    position: relative;
    min-height: 40px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--white);
    cursor: pointer;
}

.poll-option:not(.disabled):hover {
    border-color: var(--brand);
    box-shadow: 0 2px 8px rgba(25, 139, 234, 0.12);
    transform: translateY(-1px);
}

.poll-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.poll-option.disabled:hover {
    transform: none;
    box-shadow: none;
}

.poll-option-bg {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(25, 139, 234, 0.1) 0%, rgba(25, 139, 234, 0.06) 100%);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(25, 139, 234, 0.15);
}

.poll-option-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* padding: 10px 14px; */
    z-index: 1;
}

.poll-option-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
}

.poll-check-icon {
    color: var(--brand);
    font-size: 14px;
    animation: checkFadeIn 0.3s ease-out;
}

@keyframes checkFadeIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.poll-option-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.poll-percentage {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand);
    min-width: 40px;
    text-align: right;
}

.poll-vote-count {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
    min-width: 55px;
    text-align: right;
}

/* User selected option */
.poll-option.user-selected {
    border-color: var(--brand);
    background: rgba(25, 139, 234, 0.02);
    box-shadow: 0 1px 6px rgba(25, 139, 234, 0.08);
}

.poll-option.user-selected .poll-option-bg {
    background: linear-gradient(90deg, rgba(25, 139, 234, 0.18) 0%, rgba(25, 139, 234, 0.1) 100%);
    border-right-color: var(--brand);
}

.poll-option.user-selected .poll-option-text {
    font-weight: 600;
    color: var(--brand);
}

/* Leading option (highest percentage) */
.poll-option.leading .poll-option-bg {
    background: linear-gradient(90deg, rgba(25, 139, 234, 0.15) 0%, rgba(25, 139, 234, 0.08) 100%);
}

.poll-option.leading .poll-percentage {
    font-size: 15px;
}

/* Poll Footer */
.poll-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
    flex-wrap: wrap;
    gap: 8px;
}

.poll-footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.poll-footer-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.poll-total-votes {
    font-weight: 600;
    color: var(--text);
}

.poll-voted-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--brand-050);
    color: var(--brand);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.poll-voted-badge i {
    font-size: 9px;
}

.poll-end-time {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
}

/* Poll Selection Message */
.poll-selection-msg {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
    padding: 5px 10px;
    background: rgba(25, 139, 234, 0.04);
    border-left: 2px solid var(--brand);
    border-radius: 3px;
    font-weight: 500;
}

/* View Votes Button */
.poll-view-votes-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--brand);
    cursor: pointer;
    transition: all 0.2s ease;
}

.poll-view-votes-btn:hover {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
    box-shadow: 0 1px 6px rgba(25, 139, 234, 0.15);
}

.poll-view-votes-btn i {
    font-size: 10px;
}


/* Responsive Poll Design */
@media (max-width: 768px) {
    .poll-option-stats {
        gap: 6px;
    }

    .poll-vote-count {
        display: none;
    }

    .poll-percentage {
        min-width: 35px;
    }

    .feed-poll {
        padding: 12px 14px;
    }

    .poll-question {
        font-size: 14px;
    }
}



@media (max-width: 480px) {
    .header-container {
        height: 56px;
    }

    .logo span {
        display: none;
    }

    .create-post-actions {
        flex-wrap: wrap;
    }

    .action-btn span {
        /* display: none; */
    }

    .action-btn {
        padding: 10px 8px;
    }

    .feed-action-btn span {
        display: none;
    }
}

/* Follow Button Styles */
.follow-btn {
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #198BEA;
    background: #fff;
    color: #198BEA;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.follow-btn:hover {
    background: #eff6ff;
}

.follow-btn.following {
    background: #e5e7eb;
    border-color: #9ca3af;
    color: #4b5563;
}

.follow-btn.following:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #dc2626;
}

.follow-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}



/* Antigravity Refinements */
.feed-header-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-follow-sm {
    background: transparent;
    border: none;
    color: var(--brand);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
    margin-left: 4px;
}

.btn-follow-sm:hover {
    color: var(--brand-600);
    text-decoration: underline;
}

.btn-follow-sm::before {
    content: '';
    margin-right: 8px;
    color: var(--muted);
    font-weight: 400;
    display: inline-block;
    text-decoration: none;
}

.btn-follow-sm.following {
    color: var(--muted);
}

.btn-follow-sm.following:hover {
    color: var(--text);
    text-decoration: none;
}

.feed-item-menu-container {
    position: relative;
    margin-left: auto;
}

.feed-item-menu {
    color: var(--muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    border: none;
    background: transparent;
}

.feed-item-menu:hover {
    background: var(--bg);
    color: var(--text);
}

.feed-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #eee;
    z-index: 10;
    display: none;
    overflow: hidden;
    padding: 4px 0;
}

.feed-dropdown.show {
    display: block;
}

.feed-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
}

.feed-dropdown-item:hover {
    background: #f5f5f5;
    color: var(--brand);
}

.feed-dropdown-item i {
    width: 16px;
    text-align: center;
    color: #666;
}

.feed-dropdown-item.delete-item {
    color: #ef4444;
}

.feed-dropdown-item.delete-item i {
    color: #ef4444;
}

.feed-dropdown-item.delete-item:hover {
    background: #fef2f2;
}


/* ========== MEDIA GALLERY & DOCUMENT PREVIEW ========== */

/* Enhanced Document Preview Card - Compact Size */
.document-preview-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 8px 0;
}

.document-preview-card:hover {
    border-color: var(--brand);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.doc-icon-wrapper {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    border-radius: 6px;
}

.doc-icon {
    font-size: 28px;
}

.doc-icon.fa-file-pdf {
    color: #d32f2f;
}

.doc-icon.fa-file-word {
    color: #2b579a;
}

.doc-icon.fa-file-excel {
    color: #217346;
}

.doc-icon.fa-file-powerpoint {
    color: #d24726;
}

.doc-icon.fa-file-alt {
    color: #666;
}

.doc-info {
    flex: 1;
    min-width: 0;
}

.doc-filename {
    font-size: 14px;
    font-weight: 600;
    color: #000;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-action {
    font-size: 12px;
    color: #666;
}

/* Media Grid Layouts */
.feed-media-single {
    position: relative;
    width: 100%;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    max-width: 100%;
}

.feed-media-single video,
.feed-media-single img {
    width: 100%;
    display: block;
    max-width: 100%;
}

.feed-media-grid {
    display: grid;
    gap: 4px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
    cursor: pointer;
}

/* 2 items - 2 columns */
.feed-media-grid.count-2 {
    grid-template-columns: 1fr 1fr;
}

/* 3 items - 3 columns */
.feed-media-grid.count-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Grid items */
.media-grid-item {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    /* Square aspect ratio */
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

/* Video grid items */
.media-grid-item.video-grid-item video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Document grid items */
.media-grid-item.doc-grid-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.media-grid-item.doc-grid-item i {
    font-size: 48px;
    position: absolute;
}

.doc-grid-item i.fa-file-pdf {
    color: #d32f2f;
}

.doc-grid-item i.fa-file-word {
    color: #2b579a;
}

.doc-grid-item i.fa-file-excel {
    color: #217346;
}

.doc-grid-item i.fa-file-powerpoint {
    color: #d24726;
}

.doc-grid-item i.fa-file-alt {
    color: #666;
}

/* More overlay */
.more-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
}

.more-count {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 4px;
}

.more-text {
    font-size: 14px;
    font-weight: 500;
}

/* Fix media overflow */
.feed-item-image,
.feed-media-single video,
.feed-media-single img {
    max-width: 100%;
    width: 100%;
    height: auto;
}

.feed-item,
.feed-item-content {
    max-width: 100%;
    overflow: hidden;
}

.feed-item-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.feed-item-text {
    font-size: 15px;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .feed-media-grid.count-3 {
        grid-template-columns: 1fr 1fr;
    }
}

.feed-item-designation {
    display: block;
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
    margin-top: 2px;
    margin-bottom: 4px;
}