/* V5.0 Prosocial Design Theme */
:root {
    --ps-bg: #ffffff;
    /* White feed for clarity */
    --ps-surface: #ffffff;
    --ps-sidebar-bg: #f8fafc;
    /* Subtle slate sidebar */
    --ps-heading: #0f172a;
    --ps-text: #1e293b;
    /* Darker text for higher contrast */
    --ps-muted: #475569;
    /* Darker muted text */
    --ps-accent: #2563eb;
    --ps-border: #cbd5e1;
    /* Slightly darker border for definition */
    --ps-radius: 12px;
    --ps-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    /* More defined shadow */

    --font-serif: 'Merriweather', Georgia, serif;
    --font-sans: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--ps-bg);
    color: var(--ps-text);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    zoom: 0.8;
}

/* Layout Structure */
.ps-layout {
    display: flex;
    min-height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
}

.ps-sidebar {
    width: 380px;
    flex-shrink: 0;
    padding: 60px 40px;
    margin: 30px;
    background: var(--ps-sidebar-bg);
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06), 0 2px 10px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 30px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.ps-feed {
    flex: 1;
    min-width: 0;
    padding: 60px 60px 100px 60px;
    background: var(--ps-bg);
}

/* Sidebar Elements */
.ps-sidebar-brand {
    font-family: var(--font-sans);
    font-weight: 800;
    color: var(--ps-heading);
    font-size: 1.5rem;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ps-sidebar-bio {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--ps-text);
    margin-bottom: 40px;
}

.ps-sidebar-links {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 20px;
    margin-top: -10px;
    margin-bottom: 30px;
}

.ps-sidebar-links a {
    color: var(--ps-text);
    text-decoration: none;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.ps-sidebar-links a span {
    display: none;
}

.ps-sidebar-links a:hover {
    color: var(--ps-accent);
}

.ps-sidebar-nav {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ps-nav-item {
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--ps-text);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ps-nav-item i {
    width: 20px;
    text-align: center;
    color: var(--ps-muted);
}

.ps-nav-item:hover {
    background: #f1f5f9;
    color: var(--ps-accent);
}

.ps-nav-item.active {
    background: #eff6ff;
    color: var(--ps-accent);
}

.ps-nav-item.active i {
    color: var(--ps-accent);
}

/* Filter Controls in Sidebar */
.ps-sidebar-filters {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--ps-border);
}

.ps-filter-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--ps-muted);
    letter-spacing: 1px;
    margin-bottom: 20px;
}

/* Lab News Ticker Layout */
.ps-news-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    margin-top: -10px;
    width: 100%;
}

.ps-news-ticker {
    background: #f8fafc;
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    padding: 12px 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    position: relative;
}

.ps-news-ticker-label {
    background: var(--ps-accent);
    color: white;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Slow down news ticker for readability */
@keyframes ticker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.ps-news-ticker-content {
    display: flex;
    white-space: nowrap;
    animation: ticker 600s linear infinite;
    /* Drastically slowed down for premium readability (600s) */
    gap: 0;
}

.ps-news-ticker-content:hover {
    animation-play-state: paused;
}

.ps-news-item {
    font-size: 0.9rem;
    color: var(--ps-text);
    font-weight: 500;
    margin-right: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ps-news-item i {
    color: var(--ps-accent);
    font-size: 0.6rem;
}

@keyframes ps-ticker-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@media (max-width: 1024px) {
    .ps-news-container {
        flex-direction: row;
        /* Keep adjacent on mobile unless screen is very tiny */
        margin-top: 20px;
        gap: 10px;
    }

    .ps-news-ticker-label {
        padding: 4px 10px;
        font-size: 0.65rem;
    }
}

/* News Toggle Switch */
.ps-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #ffffff;
    border: 1px solid var(--ps-border);
    border-radius: 10px;
    margin-top: 20px;
}

.ps-toggle-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ps-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.ps-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ps-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--ps-border);
    transition: .4s;
    border-radius: 20px;
}

.ps-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.ps-slider {
    background-color: var(--ps-accent);
}

input:checked+.ps-slider:before {
    transform: translateX(16px);
}

.ps-hidden {
    display: none !important;
}

.ps-sidebar-bio a.ps-link-red {
    color: #990000;
    /* IU Crimson */
    font-weight: 700;
}

.ps-sidebar-bio a.ps-link-red:hover {
    text-decoration: underline;
    opacity: 0.8;
}


/* Mobile Navigation Tabs (Premium Pill Style) */
.ps-mobile-nav-tabs {
    display: none;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    gap: 10px;
    padding: 10px 0;
    margin-top: 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.ps-mobile-nav-tabs::-webkit-scrollbar {
    display: none;
}

.ps-mobile-nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid var(--ps-border);
    border-radius: 100px;
    color: var(--ps-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.ps-mobile-nav-tab i {
    color: var(--ps-accent);
}

.ps-mobile-nav-tab.active {
    background: var(--ps-accent);
    color: #ffffff;
    border-color: var(--ps-accent);
}

.ps-mobile-nav-tab.active i {
    color: #ffffff;
}

/* Mobile Select Filter */
.ps-mobile-select {
    display: none;
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--ps-border);
    background: white;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 500;
    color: var(--ps-text);
    outline: none;
    margin-top: 10px;
    cursor: pointer;
}

/* Publication Card Grid */
.ps-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}

.ps-year-header {
    grid-column: 1 / -1;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ps-heading);
    margin: 40px 0 20px 0;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.ps-year-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ps-border);
}

/* High-Fidelity Prosocial Card */
.ps-card {
    background: var(--ps-surface);
    border-radius: var(--ps-radius);
    border: 1px solid var(--ps-border);
    box-shadow: var(--ps-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.ps-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Card Visual Header */
.ps-card-header {
    height: 40px;
    /* Thinner banner */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    /* Larger icon */
}

/* Different theme colors for card headers - Darker for better icon visibility */
.ps-card-header.theme-blue {
    background-color: #dbeafe;
    /* Slightly darker than before */
    color: #1e40af;
    /* Darker icon color */
}

.ps-card-header.theme-green {
    background-color: #dcfce7;
    color: #166534;
}

.ps-card-header.theme-purple {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.ps-card-header.theme-amber {
    background-color: #fef3c7;
    color: #92400e;
}

.ps-card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ps-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.ps-card-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    border: 1px solid var(--ps-border);
    color: var(--ps-muted);
    background: white;
    text-transform: uppercase;
}

.ps-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ps-heading);
    line-height: 1.3;
    margin-bottom: 12px;
}

.ps-card-title a {
    text-decoration: none;
    color: inherit;
}

.ps-card-authors {
    font-size: 0.9rem;
    color: var(--ps-muted);
    margin-bottom: 8px;
}

.ps-card-venue {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ps-accent);
    margin-top: auto;
}

.ps-card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--ps-border);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ps-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
    .ps-layout {
        flex-direction: column;
    }

    .ps-sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--ps-border);
        padding: 40px;
        text-align: center;
        align-items: center;
        margin: 0;
        border-radius: 0;
    }

    .ps-sidebar-brand {
        justify-content: center;
        margin-bottom: 20px;
    }

    .ps-sidebar-bio {
        text-align: center;
        margin-bottom: 30px;
    }

    .ps-sidebar-links {
        flex-direction: row;
        justify-content: center;
        gap: 25px;
        margin-bottom: 20px;
    }

    .ps-sidebar-links a {
        font-size: 1.2rem;
    }

    .ps-sidebar-links a span {
        display: none;
        /* Hide link text on mobile */
    }

    .ps-sidebar-nav {
        display: none !important;
        /* Hide desktop nav on mobile */
    }

    .ps-mobile-nav-tabs {
        display: flex;
        /* Show tab bar on mobile */
    }

    .ps-mobile-nav-select {
        display: none !important;
        /* Force hide the old select */
    }

    .ps-feed {
        padding: 30px 20px;
    }

    /* Hide desktop buttons and show mobile select */
    #tagFilters {
        display: none !important;
    }

    .ps-mobile-select {
        display: block;
    }

    .ps-feed-filters {
        padding: 20px !important;
    }

}

/* Team Page Styles */
.ps-person-img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 15px;
    display: block;
    border: 3px solid var(--ps-border);
}

.ps-active-border {
    border: 3px solid var(--ps-accent);
}

.person-card {
    text-align: center;
    padding: 30px;
}

/* PI Card Specific Refinement */
.ps-pi-card {
    display: flex;
    flex-direction: row;
    padding: 40px;
    align-items: center;
    gap: 40px;
}

.ps-pi-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 5px solid var(--ps-accent);
    object-fit: cover;
    flex-shrink: 0;
}

/* PI Responsive Stacking */
@media (max-width: 768px) {
    .ps-pi-card {
        flex-direction: column;
        padding: 30px 20px;
        text-align: center;
        gap: 20px;
    }

    .ps-pi-img {
        margin: 0 auto;
    }
}