/* ===================================
   Network Page Specific Styles
   Extends feed.css design system
   =================================== */

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

.network-main-feed {
    max-width: unset;
}

/* Network Header */
.network-header {
    background: linear-gradient(135deg, #198BEA 0%, #0a66c2 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(25, 139, 234, 0.2);
}

.network-title {
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: unset;
    color: var(--white);
}

.network-title i {
    /* color: var(--brand); */
    font-size: 28px;
}

.network-subtitle {
    font-size: 14px;
    /* color: var(--muted); */
    margin: 0;
}

/* Network Section */
.network-section {
    padding: 20px;
}

.network-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.network-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    line-height: unset;
}

.see-all-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
    transition: var(--transition);
}

.see-all-link:hover {
    color: var(--brand-600);
    text-decoration: underline;
}

/* People Grid */
.network-people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

/* Person Card */
.network-person-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.network-person-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--brand);
    transform: translateY(-2px);
}

.person-card-header {
    padding: 16px 16px 0;
    text-align: center;
}

.person-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
    transition: var(--transition);
}

.network-person-card:hover .person-avatar {
    border-color: var(--brand);
}

.person-card-body {
    padding: 12px 16px;
    text-align: center;
    flex-grow: 1;
}

.person-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 4px;
    transition: var(--transition);
}

.person-name:hover {
    color: var(--brand);
}

.person-designation {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 2px 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}

.person-organization {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 8px 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}

.person-mutual {
    font-size: 12px;
    color: var(--brand);
    margin: 8px 0 0 0;
    /* display: flex; */
    align-items: flex-start;
    /* justify-content: center;
    gap: 6px; */
    line-height: 1.4;
}

.person-mutual i {
    font-size: 11px;
    flex-shrink: 0;
    line-height: 1.4;
    padding-top: 1px;
}

.person-card-footer {
    padding: 0 16px 16px;
}

/* Follow Button */
.btn-follow {
    width: 100%;
    padding: 8px 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);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

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

.btn-follow i {
    font-size: 12px;
}

/* Following State */
.btn-follow.connected {
    background: var(--bg);
    border-color: var(--border);
    color: var(--muted);
}

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

.btn-connect.connected i {
    display: none;
}

.btn-connect.connected::before {
    content: '✓ ';
    margin-right: 4px;
}

.btn-connect.connected:hover::before {
    content: '✗ ';
}

/* Responsive Design */
@media (max-width: 1024px) {
    .network-people-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .network-content-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .network-title {
        font-size: 20px;
    }

    .network-title i {
        font-size: 24px;
    }

    .network-section {
        padding: 16px;
    }

    .network-people-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .person-avatar {
        width: 64px;
        height: 64px;
    }

    .person-card-header {
        padding: 12px 12px 0;
    }

    .person-card-body {
        padding: 8px 12px;
    }

    .person-card-footer {
        padding: 0 12px 12px;
    }
}

@media (max-width: 480px) {
    .network-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .network-people-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading State */
.network-section.loading {
    position: relative;
    min-height: 200px;
}

.network-section.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animation for card entrance */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.network-person-card {
    animation: slideInUp 0.4s ease-out;
}

/* Stagger animation for multiple cards */
.network-person-card:nth-child(1) {
    animation-delay: 0s;
}

.network-person-card:nth-child(2) {
    animation-delay: 0.1s;
}

.network-person-card:nth-child(3) {
    animation-delay: 0.2s;
}

.network-person-card:nth-child(4) {
    animation-delay: 0.3s;
}

.network-person-card:nth-child(5) {
    animation-delay: 0.4s;
}

.network-person-card:nth-child(6) {
    animation-delay: 0.5s;
}

/* ===================================
   Trending Researcher Styles
   =================================== */

.trending-card {
    position: relative;
}

/* Cards with star badges need position context too */
.star-card {
    position: relative;
}

.trending-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.trending-badge i {
    font-size: 10px;
}

/* ===================================
   Star Researcher Badge Styles
   =================================== */

.star-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #198BEA 0%, #0a66c2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(25, 139, 234, 0.3);
}

.star-badge i {
    font-size: 10px;
}

/* ===================================
   Publication Card Styles
   =================================== */

.publication-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.publication-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: var(--transition);
}

.publication-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--brand);
}

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

.publication-author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.publication-author-info {
    flex: 1;
}

.publication-author-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 2px;
    transition: var(--transition);
}

.publication-author-name:hover {
    color: var(--brand);
}

.publication-author-affiliation {
    font-size: 12px;
    color: var(--muted);
    margin: 0;
}

.btn-follow-small {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--brand);
    color: var(--brand);
    font-size: 12px;
    font-weight: 600;
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.btn-follow-small i {
    font-size: 10px;
}

.publication-body {
    padding-left: 60px;
}

.publication-title {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
}

.publication-title a {
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}

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

.publication-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--muted);
}

.publication-journal,
.publication-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.publication-journal i,
.publication-date i {
    font-size: 12px;
    color: var(--brand);
}

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

.publication-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

/* Publication Person Card Specific Styles */
.publication-person-card .person-card-body {
    display: flex;
    flex-direction: column;
    /* gap: 6px; */
}

.publication-title-text {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    margin: 8px 0 !important;
    text-align: center;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.publication-title-text i {
    color: #10b981;
    font-size: 12px;
    flex-shrink: 0;
    line-height: 1.4;
    padding-top: 1px;
}

.publication-mini-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--muted);
    margin-top: 6px;
}

.publication-mini-meta span {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.publication-mini-meta i {
    font-size: 10px;
    color: var(--brand);
    flex-shrink: 0;
    line-height: 1.4;
    padding-top: 2px;
}

.publication-mini-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    font-size: 10px;
    color: var(--muted);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.publication-mini-stats span {
    display: flex;
    align-items: flex-start;
    gap: 3px;
    line-height: 1.4;
}

.publication-mini-stats i {
    font-size: 9px;
    color: var(--brand);
    flex-shrink: 0;
    line-height: 1.4;
    padding-top: 2px;
}

/* Responsive for publications */
@media (max-width: 768px) {
    .publication-body {
        padding-left: 0;
    }

    .publication-header {
        flex-wrap: wrap;
    }

    .publication-meta {
        gap: 12px;
    }

    .publication-stats {
        gap: 12px;
    }
}

@media (max-width: 480px) {

    .publication-meta,
    .publication-stats {
        flex-direction: column;
        gap: 8px;
    }
}

/* ===================================
   Page Index / Table of Contents
   =================================== */

.page-index-card {
    position: sticky;
    top: 80px;
    /* Adjust based on your header height */
    padding: 16px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.index-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.index-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.index-link {
    display: block;
    color: var(--text-secondary);
    border-left: 3px solid transparent;
    align-items: center;
    padding: 10px 12px;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

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

.index-link.active {
    /* border-left-color: var(--brand); */
    background: var(--bg);
    color: var(--brand);
}

/* Scrollbar Styling - Applied to scrollable results area */
.page-index-card::-webkit-scrollbar {
    width: 6px;
}

.page-index-card::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.page-index-card::-webkit-scrollbar-thumb {
    background: #198BEA;
    border-radius: 3px;
}

.page-index-card::-webkit-scrollbar-thumb:hover {
    background: #1570c1;
}

/* CSS for Questions List Layout */
#questions .network-people-grid {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
    gap: 12px;
}