/* SciConnect - Professional Scientific Networking Platform */

/* CSS Custom Properties */
:root {
    --primary-color: #1950AF;
    --secondary-color: #79B70D;
    --accent-color: #F28C25;
    --background-color: #FAFBFC;
    --surface-color: #FFFFFF;
    --text-primary: #2C3E50;
    --text-secondary: #6C7B7F;
    --text-muted: #95A5A6;
    --border-color: #E1E8ED;
    --hover-color: #F7F9FA;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-light-blue: 0 1px 3px rgba(25, 80, 175, 0.2);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-heavy: 0 8px 25px rgba(0, 0, 0, 0.1);
    --border-radius: 9px;
    --transition: all 0.2s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    /*background-color: var(--background-color);*/
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.page {
    display: grid;
    grid-template-columns: 260px 1fr 320px;
    /*min-height: calc(100vh - 60px);
    max-width: 1200px;
    margin: 0 auto;*/
    gap: 20px;
    padding:8em 0;
    /*padding: 20px;*/
}

/* Sidebar Styles */
.sidebar {
    background: transparent;
    border: none;
    height: fit-content;
    position: fixed;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nav-menu {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}


.page-header {
    text-align: left;
    padding-top: 5em;
    margin-bottom: 1em;
}

    .page-header h1 {
        color: #2c3e50;
        font-size: 2.5rem;
        margin-bottom: 10px;
        font-weight: 600;
    }

        .page-header h1 i {
            margin-right: 15px;
            color: #3498db;
        }

.miniPage-header {
    text-align: center;
    padding-top: 0.5em;
    margin-bottom: 1em;
}

    .miniPage-header h2 {
        color: #2c3e50;
        font-size: 1.6rem;
        margin-bottom: 5px;
        font-weight: 600;
    }

    .miniPage-header .page-description {
        color: #7f8c8d;
        font-size: 1.1rem;
        margin-bottom: 0;
        text-align: center;
    }

.page-description {
    color:var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* Profile Card */
.profile-card {
    background: var(--surface-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.profile-card-header {
    background: linear-gradient(135deg, var(--primary-color), #2A5BC7);
    height: 80px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-card-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    /*border: 4px solid var(--surface-color);*/
    border-radius: 50%;
    overflow: hidden;
    position: absolute;
    bottom: -40px;
    background: var(--surface-color);
}

.profile-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card-content {
    padding: 50px 20px 20px 20px;
    text-align: center;
}

.profile-card-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.profile-card-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.profile-card-title {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
    text-align:center;
}

.profile-card-stats {
    display: flex;
    flex-direction:column;    
    gap:1em;
}

.profile-card-stats .stat-item {
    display:flex;
    align-items:center;
    gap:1em;
}

.profile-card-stats .stat-number {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.profile-card-stats .stat-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-card-stats .stat-item.primary .stat-number,
.profile-card-stats .stat-item.primary .stat-label {
    color: var(--primary-color);
}

.profile-card-stats .stat-item.secondary .stat-number,
.profile-card-stats .stat-item.secondary .stat-label {
    color: var(--secondary-color);
}

.profile-card-stats .stat-item.accent .stat-number,
.profile-card-stats .stat-item.accent .stat-label {
    color: var(--accent-color);
}

.profile-card-interests {
    text-align: left;
}

.interests-title {
    font-size: 12pt;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 13px;
}

.interests-list {
    margin-bottom: 13px;
}

.interest-item {
    display:grid;
    grid-template-columns:2em 8em 2em;
    align-items: center;
    gap:1em;
    margin-bottom:4px;
}

.interest-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.8em;
    height: 1.8em;
    border-radius: 4px;
}

.interest-indicator.primary {
    background: var(--primary-color);
}

.interest-indicator.secondary {
    background: var(--secondary-color);
}

.interest-indicator.accent {
    background: var(--accent-color);
}

.interest-indicator.normal {
    background:#333;
}

.interest-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2em;
    height: 2em;
    padding:7px;
    font-size: 12pt;
    font-weight: 500;
    color: var(--primary-color);
    border-radius: 5px;
    background: var(--hover-color);
}

.more-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: var(--transition);
}

.more-btn:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.navigation {
    padding: 0;
}

.nav-section {
    margin-bottom: 22px;
}

.nav-section h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 22px 22px 11px 22px;
    margin-bottom: 0;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 13px 22px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 400;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: var(--hover-color);
    color: var(--primary-color);
}

.nav-item.active .nav-link {
    background-color: rgba(25, 80, 175, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.nav-link i {
    width: 22px;
    margin-right: 13px;
    font-size: 18px;
    text-align: center;
}

/* Main Content */
.main-content {
    background: transparent;
    min-height: 100vh;
}

.feed-container {
    max-width: 660px;
    margin: 0 auto;
}

.create-post-section {
    margin-bottom: 22px;
}

.posts-section {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* Right Sidebar */
.right-sidebar {
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 88px;
    height: fit-content;
}

/* Widget Styles */
.widget {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.widget-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #F8F9FA, #FFFFFF);
    display: flex;
    align-items: center;
}

.widget-header i {
    color: var(--primary-color);
    margin-right: 9px;
    font-size: 18px;
}

.widget-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.widget-content {
    padding: 18px 22px;
}

/* Suggested Connections */
.connection-item {
    display: flex;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.connection-item:last-child {
    border-bottom: none;
}

.connection-item:hover {
    background-color: var(--hover-color);
}

.connection-avatar {
    width: 44px;
    height: 44px;
    margin-right: 13px;
}

.connection-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.connection-info {
    flex: 1;
    min-width: 0;
}

.connection-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.connection-title {
    font-size: 13px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Trending Topics */
.topic-item {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.topic-item:last-child {
    border-bottom: none;
}

.topic-item:hover {
    background-color: var(--hover-color);
}

.topic-name {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.topic-count {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Upcoming Events */
.event-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.event-item:last-child {
    border-bottom: none;
}

.event-item:hover {
    background-color: var(--hover-color);
}

.event-date {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), #2A5BC7);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: white;
}

.event-day {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.event-month {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.event-info {
    flex: 1;
    min-width: 0;
}

.event-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-location {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Create Post */
.create-post {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-light);
    margin-bottom: 20px;
    height: fit-content;
    transition: all 0.3s ease;
}

.create-post-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.create-post-input {
    flex: 1;
}

.create-post-input textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    color: var(--text-primary);
    background: transparent;
    min-height: 60px;
}

.create-post-input textarea::placeholder {
    color: var(--text-muted);
}

.post-image-preview {
    position: relative;
    margin-bottom: 16px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.post-image-preview img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.remove-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(233, 233, 252, 1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

    .remove-image-btn:hover {
        background: rgba(200, 200, 252, 1);
    }

.create-post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.post-options {
    display: flex;
    align-items: center;
    gap: 16px;
}

.post-option-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 20px;
    transition: var(--transition);
    font-size: 14px;
}

.post-option-btn:hover {
    background: var(--hover-color);
    color: var(--primary-color);
}

.category-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--surface-color);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

/* Post Card */
.post-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
    transition: var(--transition);
    position:relative;
}

.post-card:hover {
    box-shadow: var(--shadow-medium);
}

.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
}

    .post-header .repost-label {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.5em;
        font-size: 11pt;
        color: var(--text-muted);
        font-weight: 500;
    }

    .post-author {
        display: flex;
        align-items: center;
    }

.author-avatar {
    width: 48px;
    height: 48px;
    margin-right: 12px;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.author-info {
    flex: 1;
}

.author-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    font-size: 15px;
}

.author-title {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.post-time {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.post-time i {
    margin-right: 4px;
}

.post-menu-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.post-menu-btn:hover {
    background: var(--hover-color);
    color: var(--text-secondary);
}

.post-content {
    padding: 0 20px 2px 20px;
}

.post-content p {
    line-height: 1.5;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.post-image {
    margin: 16px 0;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height:250px;
    object-fit: cover;
}

.post-tags {
    margin-top: 7px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: rgba(25, 80, 175, 0.1);
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.post-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 20px 12px 20px;
    border-bottom: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-item .text-red {
    color: #E74C3C;
}

.post-actions {
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.action-btn:hover {
    /*background: var(--hover-color);*/
    color: var(--primary-color);
}

.action-btn.liked {
    color: #E74C3C;
}

.action-btn.liked:hover {
    color: #C0392B;
}

    .action-btn.viewed {
        color: #054175;
    }

        .action-btn.viewed:hover {
            color: #02213B;
        }

/* Comments */
.commentsArea {
    border-top: 1px solid var(--border-color);
    padding: 16px 20px;
    background: #FAFBFC;
    z-index:3;
}

.view-more-comments {
    text-align: center;
    margin-top: 8px;
    font-size:13px;
}

/* Buttons */
/*.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    gap: 6px;
}*/

/*.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #164A98;
}*/

/*.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}*/

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.link-btn {
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
}

.link-btn:hover {
    text-decoration: underline;
}

/* Loading States */
.loading-more {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

.no-posts {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.no-posts i {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.no-posts h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .top-nav-container {
        padding: 0 16px;
    }
    
    .top-nav-search {
        max-width: 400px;
        margin: 0 20px;
    }
    
    .page {
        grid-template-columns: 240px 1fr 280px;
        gap: 16px;
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .page {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }
    
    .sidebar,
    .right-sidebar {
        position: static;
        order: 2;
    }
    
    .main-content {
        order: 1;
    }
    
    .top-nav-container {
        padding: 0 12px;
        height: 56px;
    }
    
    .top-nav-search {
        margin: 0 12px;
        max-width: none;
    }
    
    .top-nav-brand .brand-text {
        display: none;
    }
    
    .nav-icons {
        gap: 4px;
    }
    
    .nav-icon-btn {
        width: 36px;
        height: 36px;
    }
    
    .profile-dropdown {
        right: 12px;
        width: 260px;
    }
    
    .profile-card {
        margin-bottom: 16px;
    }
    
    .profile-card-content {
        padding: 40px 16px 16px 16px;
    }
    
    .profile-card-stats {
        padding: 0 5px;
    }
    
    .profile-card-stats .stat-number {
        font-size: 16px;
    }
    
    .profile-card-stats .stat-label {
        font-size: 8px;
    }
}

@media (max-width:630px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }
}

    @media (max-width: 480px) {
        .page {
            padding: 12px;
            gap: 12px;
        }

        .create-post,
        .post-card {
            margin-left: -4px;
            margin-right: -4px;
            border-radius: 0;
            border-left: none;
            border-right: none;
        }

        .post-actions {
            flex-wrap: wrap;
        }

        .action-btn {
            min-width: 80px;
            font-size: 12px;
        }
    }
    /* Error UI */
    #blazor-error-ui {
        background: lightyellow;
        bottom: 0;
        box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
        display: none;
        left: 0;
        padding: 0.6rem 1.25rem 0.7rem 1.25rem;
        position: fixed;
        width: 100%;
        z-index: 2;
    }

        #blazor-error-ui .dismiss {
            cursor: pointer;
            position: absolute;
            right: 0.75rem;
            top: 0.5rem;
        }
    /* Animation Utilities */
    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .fade-in {
        animation: fadeIn 0.3s ease-out;
    }
    /* Focus Styles */
    .nav-link:focus,
    .action-btn:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
    /* Accessibility */
    @media (prefers-reduced-motion: reduce) {
        * {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    } 