@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* Color & Variable System (FC Barcelona Blau / Grana Theme) */
:root {
    --barca-blue: #004D98;
    --barca-grana: #A50044;
    --bg-primary: #f5f8fc;
    --bg-card: hsl(0, 0%, 100%);
    --text-primary: #111827;
    --text-secondary: #536173;
    --accent: var(--barca-blue);
    --accent-hover: var(--barca-grana);
    --accent-light: rgba(0, 77, 152, 0.1);
    --accent-grana-light: rgba(165, 0, 68, 0.1);
    --accent-border: rgba(0, 77, 152, 0.18);
    --accent-shadow: rgba(0, 77, 152, 0.24);
    --accent-gradient: linear-gradient(135deg, var(--barca-blue), var(--barca-grana));
    --border-color: #dbe4f0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    --radius-avatar: 24px;
    --radius-card: 16px;
    --radius-pill: 30px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --sidebar-width: 320px;
}

[data-theme="dark"] {
    --bg-primary: #07111f;
    --bg-card: #101b2d;
    --text-primary: #eef4ff;
    --text-secondary: #aab8cc;
    --accent: #6fb0f2;
    --accent-hover: #ff6f9d;
    --accent-light: rgba(0, 77, 152, 0.28);
    --accent-grana-light: rgba(165, 0, 68, 0.24);
    --accent-border: rgba(111, 176, 242, 0.28);
    --accent-shadow: rgba(0, 77, 152, 0.45);
    --accent-gradient: linear-gradient(135deg, var(--barca-blue), var(--barca-grana));
    --border-color: #203149;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

/* Reset & Global */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background:
        radial-gradient(circle at top left, var(--accent-light), transparent 32rem),
        radial-gradient(circle at top right, var(--accent-grana-light), transparent 28rem),
        linear-gradient(135deg, rgba(0, 77, 152, 0.05), rgba(165, 0, 68, 0.05)),
        var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

/* Main Layout Grid */
.app-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 3.5rem;
    max-width: 1080px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Sidebar Styling */
.sidebar {
    position: sticky;
    top: 4rem;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 2.2rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--accent-gradient);
}

.profile-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.avatar-wrapper {
    position: relative;
    width: 200px;
    height: 340px; /* Taller to fit 9:16 portrait avatar perfectly without clipping */
    margin: 0 auto 1.5rem;
    border-radius: var(--radius-avatar);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 3px solid var(--bg-card);
    outline: 1px solid var(--border-color);
}

.profile-card:hover .avatar-wrapper {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
    outline-color: var(--accent-hover);
}

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

.name-zh {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

h1.profile-name {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.5rem;
}

.profile-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 1.2rem;
    line-height: 1.4;
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.2rem 0;
}

.contact-info {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    font-size: 0.85rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    color: var(--text-secondary);
}

.contact-item svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
}

.contact-item a {
    color: var(--text-secondary);
}

.contact-item a:hover {
    color: var(--accent);
}

/* Secure Email Obfuscation Styles */
.secure-email {
    direction: rtl;
    unicode-bidi: bidi-override;
    text-align: left;
    display: inline-block;
}

.social-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.social-row {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.social-icon:hover {
    transform: translateY(-2px) scale(1.08);
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-md);
}

.social-img-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 4px;
    transition: var(--transition);
}

.social-img-icon.round {
    border-radius: 50%;
}

.sidebar-nav {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    background: linear-gradient(90deg, var(--accent-light), var(--accent-grana-light));
    color: var(--accent);
}

.nav-link svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

section {
    scroll-margin-top: 4rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
    padding-bottom: 0.6rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.bio-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 2.2rem;
    box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--barca-blue);
}

.bio-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.bio-text a {
    font-weight: 500;
    border-bottom: 1px dashed var(--accent);
}

.bio-text a:hover {
    border-bottom-style: solid;
}

/* Biography Timeline */
.bio-timeline {
    margin-top: 2rem;
    position: relative;
    padding-left: 1.5rem;
}

.bio-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(to bottom, var(--barca-blue), var(--barca-grana), transparent);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 1.4rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.6rem;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--barca-grana);
    box-shadow: 0 0 0 3px var(--accent-grana-light);
}

.timeline-role {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.timeline-org {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.timeline-org a {
    color: var(--accent) !important;
    border-bottom: none !important;
    font-weight: 500;
}

.timeline-org a:hover {
    text-decoration: underline;
}

.timeline-period {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--text-muted, var(--text-secondary));
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.1rem 0.6rem;
    margin-top: 0.3rem;
    font-family: var(--font-heading);
}

/* Advisor section */
.advisors-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.8rem;
}

.advisor-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0.35rem 0.9rem 0.35rem 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.advisor-chip-label {
    font-size: 0.72rem;
    color: var(--barca-grana);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: var(--accent-grana-light);
    border-radius: 20px;
    padding: 0.1rem 0.45rem;
}

.interests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.interest-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.interest-item:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.interest-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent-grana-light));
    color: var(--barca-blue);
    flex-shrink: 0;
}

.interest-icon-wrapper svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.interest-name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
}

/* Publications list */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem; /* Tighter gap for high density */
}

.publication-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.publication-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: var(--transition);
}

.publication-card:hover {
    transform: translateY(-1px);
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-md);
}

.publication-card:hover::before {
    opacity: 1;
}

.pub-title {
    font-family: var(--font-heading);
    font-size: 0.98rem; /* Slightly smaller title */
    font-weight: 600; /* Medium-bold for clean look */
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 0.3rem;
}

.pub-authors {
    font-size: 0.85rem; /* More compact author list */
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

.pub-authors strong {
    color: var(--text-primary);
    font-weight: 600;
}

.pub-meta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.pub-badge-container {
    flex-shrink: 0;
}

.pub-venue-badge {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--accent);
    background: var(--accent-light);
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--accent-border);
    white-space: nowrap;
}

.pub-links {
    display: flex;
    gap: 0.5rem;
}

.pub-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem; /* Smaller button text */
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.5rem; /* Tighter padding */
    border-radius: 4px;
    transition: var(--transition);
}

.pub-link-btn:hover {
    color: var(--accent-hover);
    border-color: var(--accent-hover);
    background: var(--accent-grana-light);
}

.pub-link-btn svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
}

.pub-link-btn.stars {
    border: none;
    background: none;
    padding: 0;
    display: flex;
    align-items: center;
}

.pub-link-btn.stars img {
    height: 22px;
}

/* Resources & Activities */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.2rem;
}

.resource-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.6rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.resource-card h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.resource-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    flex-grow: 1;
}

.resource-btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--barca-blue);
}

.resource-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    transition: var(--transition);
}

.resource-btn:hover svg {
    transform: translateX(3px);
}

.activities-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 2.2rem;
    box-shadow: var(--shadow-sm);
}

.activities-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.activity-tag {
    position: relative;
    font-size: 0.9rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: default;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.activity-tag::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(165, 0, 68, 0.12));
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s ease;
}

.activity-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.22);
}

.activity-tag:hover::after {
    opacity: 1;
}

/* Publication Filtering UI on publication.html */
.search-filter-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 1.8rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.search-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 0.9rem 1.2rem 0.9rem 2.8rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light), 0 0 0 6px var(--accent-grana-light);
}

.search-wrapper svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--text-secondary);
    stroke-width: 2.2;
    pointer-events: none;
    transition: var(--transition);
}

.search-input:focus + svg {
    stroke: var(--accent);
}

.year-filter-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.year-btn {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: var(--transition);
}

.year-btn:hover {
    color: var(--accent-hover);
    border-color: var(--accent-hover);
}

.year-btn.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 10px var(--accent-shadow);
}

.year-group-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.year-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

.year-group-toggle:hover {
    color: var(--accent-hover);
}

.year-group-label {
    flex: 1;
}

.collapse-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease;
}

.year-section.is-collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.year-section.is-collapsed .publications-list {
    display: none;
}

.publications-loading {
    color: var(--text-secondary);
    padding: 2rem 0;
    text-align: center;
}

.publications-loading.error {
    color: #b42318;
}

.year-group-title span.count-badge {
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--border-color);
    color: var(--text-secondary);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    display: none;
}

.no-results svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-secondary);
    stroke-width: 1.5;
    fill: none;
    margin-bottom: 1rem;
}

/* Theme Toggle Button */
.theme-toggle-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
}

.theme-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-btn:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: var(--accent-hover);
    color: var(--accent-hover);
}

.theme-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: var(--transition);
}

.theme-btn .sun-icon {
    display: none;
}

.theme-btn .moon-icon {
    display: block;
}

[data-theme="dark"] .theme-btn .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-btn .moon-icon {
    display: none;
}

/* Footer Styling */
footer {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content > section, .profile-card, .sidebar-nav {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.main-content > section:nth-child(1) { animation-delay: 0.1s; }
.main-content > section:nth-child(2) { animation-delay: 0.2s; }
.main-content > section:nth-child(3) { animation-delay: 0.3s; }
.main-content > section:nth-child(4) { animation-delay: 0.4s; }

/* Responsive Adjustments */
@media (max-width: 992px) {
    .app-container {
        grid-template-columns: 280px 1fr;
        gap: 2rem;
        padding: 3rem 1.5rem;
    }
    :root {
        --sidebar-width: 280px;
    }
}

@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
        padding: 2rem 1.5rem;
    }
    
    .sidebar {
        position: static;
    }

    .nav-menu {
        display: none;
    }
}

/* Global Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 45px;
    height: 45px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: linear-gradient(135deg, var(--barca-grana), var(--barca-blue));
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Footer Styling */
.site-footer {
    text-align: center;
    padding: 3rem 0 1.5rem 0;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* News Section Styling */
.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.news-item {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.news-date {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    font-size: 0.85rem;
}

/* Skeleton Loader Styles */
.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    animation: skeleton-pulse 1.8s ease-in-out infinite;
}

.skeleton-line {
    background: var(--border-color);
    border-radius: 4px;
    height: 12px;
    opacity: 0.8;
}

.skeleton-title {
    width: 75%;
    height: 16px;
    margin-bottom: 0.3rem;
}

.skeleton-authors {
    width: 50%;
    height: 12px;
    margin-bottom: 0.5rem;
}

.skeleton-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.3rem;
}

.skeleton-badge {
    background: var(--border-color);
    width: 80px;
    height: 16px;
    border-radius: 4px;
    opacity: 0.8;
}

.skeleton-links {
    display: flex;
    gap: 0.5rem;
}

.skeleton-btn {
    background: var(--border-color);
    width: 60px;
    height: 24px;
    border-radius: 6px;
    opacity: 0.8;
}

@keyframes skeleton-pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.35;
    }
    100% {
        opacity: 0.6;
    }
}

/* Staggered Fade-in Animation for Publication Cards */
@keyframes pubCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.publication-card {
    opacity: 0;
    animation: pubCardFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Indigo Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(79, 70, 229, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(79, 70, 229, 0.3);
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 70, 229, 0.6);
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* Tactile active scaling for touch devices */
.year-btn:active, 
.nav-link:active, 
.pub-link-btn:active, 
.theme-btn:active,
.resource-btn:active,
.back-to-top:active,
.year-group-toggle:active {
    transform: scale(0.96) !important;
}

/* Smooth Liquid theme transition */
body, 
.sidebar, 
.profile-card, 
.sidebar-nav, 
.nav-link, 
.bio-card, 
.publication-card, 
.resource-card, 
.activities-list, 
.activity-tag, 
.search-input, 
.year-btn, 
.theme-btn, 
.back-to-top, 
footer, 
h1, h2, h3, h4, p, span, a, svg {
    transition: background-color 0.4s ease, 
                color 0.3s ease, 
                border-color 0.4s ease, 
                box-shadow 0.4s ease, 
                background 0.4s ease,
                transform 0.2s ease;
}

/* Real-time search highlighting styling */
mark.search-highlight {
    background-color: rgba(79, 70, 229, 0.18);
    color: #4f46e5;
    border-radius: 4px;
    padding: 0 2px;
    margin: 0 -2px;
    font-weight: inherit;
}

[data-theme="dark"] mark.search-highlight {
    background-color: rgba(111, 176, 242, 0.25);
    color: #6fb0f2;
}

/* Global Visitors Map Card Styles */
.visitor-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    padding: 1.2rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
    margin-top: 1rem;
}

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

.visitor-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.visitor-title svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent);
    fill: none;
}

.visitor-map-container {
    width: 100%;
    min-height: 130px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(79, 70, 229, 0.02);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 2px;
}

/* Stylized Abstract SVG Map Placeholder */
.visitor-placeholder-svg {
    position: absolute;
    inset: 10px;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    z-index: 1;
    pointer-events: none;
    opacity: 0.7;
}

.visitor-placeholder-svg path {
    fill: rgba(79, 70, 229, 0.1);
    transition: fill 0.3s ease;
}

[data-theme="dark"] .visitor-placeholder-svg path {
    fill: rgba(111, 176, 242, 0.1);
}

/* Pulsing radar dots for high-tech aesthetic footprint placeholders */
.visitor-map-container::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: var(--barca-grana);
    border-radius: 50%;
    top: 38%;
    left: 78%; /* Beijing/Asia Area */
    z-index: 2;
    box-shadow: 0 0 0 0 rgba(165, 0, 68, 0.6);
    animation: radar-pulse 2s infinite;
}

.visitor-map-container::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: var(--barca-blue);
    border-radius: 50%;
    top: 50%;
    left: 28%; /* US/North America Area */
    z-index: 2;
    box-shadow: 0 0 0 0 rgba(0, 77, 152, 0.6);
    animation: radar-pulse 2s infinite 0.7s;
}

@keyframes radar-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.5);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

/* Allow ClustrMaps/MapMyVisitors canvas/widget to sit elegantly inside */
.visitor-map-container > iframe,
.visitor-map-container > canvas,
.visitor-map-container > a,
.visitor-map-container > img {
    position: relative;
    z-index: 3;
    width: 100% !important;
    max-height: 100% !important;
    border-radius: 6px;
    filter: grayscale(10%) contrast(105%);
}

[data-theme="dark"] .visitor-map-container > iframe,
[data-theme="dark"] .visitor-map-container > canvas,
[data-theme="dark"] .visitor-map-container > a,
[data-theme="dark"] .visitor-map-container > img {
    filter: invert(90%) hue-rotate(180deg) brightness(95%) contrast(110%);
}


