/* ===== JON BARRON INSPIRED ACADEMIC DESIGN ===== */

:root {
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
    --link-color: #1772d0;
    --link-hover: #f09228;
    --background: #ffffff;
    --border-color: #dddddd;
    --card-background: #ffffff;
    --phd-note-bg: #f8f9fa;
    --filter-bg: #f8f9fa;
    --code-bg: #f5f5f5;

    /* Badge and tag colors */
    --badge-under-review-bg: #fff3cd;
    --badge-under-review-text: #856404;
    --badge-preprint-bg: #d1ecf1;
    --badge-preprint-text: #0c5460;
    --badge-published-bg: #d4edda;
    --badge-published-text: #155724;
    --badge-featured-bg: #fff3cd;
    --badge-featured-text: #856404;
    --badge-series-bg: #e3f2fd;
    --badge-series-text: #1565c0;
    --tag-bg: #e9ecef;
    --tag-text: #495057;
    --tech-tag-bg: #e3f2fd;
    --tech-tag-text: #1565c0;

    /* Theme toggle colors */
    --toggle-bg: #ffffff;
    --toggle-border: #e2e8f0;
    --toggle-shadow: rgba(0, 0, 0, 0.1);
    --toggle-icon-color: #374151;

    --font-family: 'Inter', Arial, sans-serif;
    --font-size-base: 14px;
    --line-height-base: 1.4;
}

/* Dark mode variables */
[data-theme="dark"] {
    --text-primary: #e2e8f0;
    --text-secondary: #cbd5e0;
    --text-muted: #a0aec0;
    --link-color: #63b3ed;
    --link-hover: #f6ad55;
    --background: #1a202c;
    --border-color: #2d3748;
    --card-background: #2d3748;
    --phd-note-bg: #2d3748;
    --filter-bg: #2d3748;
    --code-bg: #2d3748;

    /* Dark mode badge and tag colors */
    --badge-under-review-bg: #744210;
    --badge-under-review-text: #fbbf24;
    --badge-preprint-bg: #155e75;
    --badge-preprint-text: #67e8f9;
    --badge-published-bg: #166534;
    --badge-published-text: #86efac;
    --badge-featured-bg: #744210;
    --badge-featured-text: #fbbf24;
    --badge-series-bg: #1e40af;
    --badge-series-text: #93c5fd;
    --tag-bg: #374151;
    --tag-text: #d1d5db;
    --tech-tag-bg: #1e40af;
    --tech-tag-text: #93c5fd;

    /* Dark mode theme toggle colors */
    --toggle-bg: #374151;
    --toggle-border: #6b7280;
    --toggle-shadow: rgba(0, 0, 0, 0.3);
    --toggle-icon-color: #f9fafb;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth page transitions - only for theme changes */
html {
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background: var(--background);
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 60px;
    /* Space for fixed header */
}


/* ===== MODERN HEADER ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .site-header {
    background: rgba(26, 32, 44, 0.95);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    justify-content: center;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
    color: var(--link-color);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--link-color);
    border-radius: 1px;
}

.header-right {
    display: flex;
    align-items: center;
}

/* Mobile Header Styles */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    .header-container {
        height: 60px;
        padding: 0 15px;
    }

    .header-nav {
        gap: 1.5rem;
    }

    .nav-item {
        font-size: 0.85rem;
    }

    .theme-toggle-header {
        width: 32px;
        height: 32px;
        margin-left: 0.5rem;
    }

    .theme-toggle-header .theme-toggle-icon {
        font-size: 14px;
    }
}

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

    .header-nav {
        gap: 1rem;
    }

    .nav-item {
        font-size: 0.8rem;
        padding: 0.4rem 0;
    }
}

/* ===== CONTAINER & LAYOUT ===== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.main-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 50px;
    align-items: start;
}

/* ===== PROFILE COLUMN ===== */
.profile-column {
    position: sticky;
    top: 40px;
}

.profile-content.compact {
    padding-top: 0;
    margin-top: 15vh;
}

.profile-content.compact .name,
.profile-content.compact .title {
    transform: translateX(-50px);
    opacity: 0;
    pointer-events: none;
}

.profile-content {
    text-align: center;
    padding: 20px 0;
}

.profile-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--text-primary);
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateX(-30px);
}

.name.visible {
    opacity: 1;
    transform: translateX(0);
}

.profile-content:not(.compact) .name,
.profile-content:not(.compact) .title {
    transition: all 0.3s ease;
}

.profile-content:not(.compact) .contact-info,
.profile-content:not(.compact) .phd-note {
    transition: transform 0.3s ease;
    transform: translateY(0);
}

.profile-content.compact .contact-info,
.profile-content.compact .phd-note {
    transform: translateY(-60px);
    transition: transform 0.3s ease;
}

.title {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.3;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateX(-30px);
}

.title.visible {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-connect {
    margin-bottom: 15px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
}

.sidebar-connect.visible {
    opacity: 1;
    transform: translateY(0);
}

.sidebar-connect-text {
    font-size: 13px;
    color: var(--text-primary);
    margin: 0 0 5px 0;
    font-weight: 600;
    text-align: center;
}

.sidebar-connect-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0;
    text-align: center;
    line-height: 1.3;
    font-style: italic;
}

.contact-info {
    margin-bottom: 20px;
}

.contact-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.links {
    font-size: 13px;
}

.links a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.phd-note {
    background: var(--phd-note-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 12px;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
}

/* ===== UNIFIED THEME TOGGLE ===== */
.theme-toggle-header,
#theme-toggle {
    position: relative;
    width: 64px;
    height: 32px;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    outline: none;
    display: flex;
    align-items: center;
    padding: 2px;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Dark mode background */
[data-theme="dark"] .theme-toggle-header,
[data-theme="dark"] #theme-toggle {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Toggle circle/slider */
.theme-toggle-header::before,
#theme-toggle::before {
    content: '';
    position: absolute;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.1);
    left: 3px;
    top: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dark mode slider */
[data-theme="dark"] .theme-toggle-header::before,
[data-theme="dark"] #theme-toggle::before {
    transform: translateX(32px);
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Icons inside the toggle */
.theme-toggle-header .theme-toggle-icon,
#theme-toggle .theme-toggle-icon {
    position: absolute;
    font-size: 14px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 2;
}

/* Sun icon (light mode) */
.theme-toggle-header .theme-toggle-icon:first-child,
#theme-toggle .theme-toggle-icon:first-child {
    left: 8px;
    opacity: 1;
    transform: scale(1) rotate(0deg);
    color: #f59e0b;
}

/* Moon icon (dark mode) */
.theme-toggle-header .theme-toggle-icon:last-child,
#theme-toggle .theme-toggle-icon:last-child {
    right: 8px;
    opacity: 0;
    transform: scale(0.8) rotate(-90deg);
    color: #6366f1;
}

/* Dark mode icon states */
[data-theme="dark"] .theme-toggle-header .theme-toggle-icon:first-child,
[data-theme="dark"] #theme-toggle .theme-toggle-icon:first-child {
    opacity: 0;
    transform: scale(0.8) rotate(90deg);
}

[data-theme="dark"] .theme-toggle-header .theme-toggle-icon:last-child,
[data-theme="dark"] #theme-toggle .theme-toggle-icon:last-child {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Hover effects */
.theme-toggle-header:hover,
#theme-toggle:hover {
    transform: scale(1.05);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .theme-toggle-header:hover,
[data-theme="dark"] #theme-toggle:hover {
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.3);
}

.theme-toggle-header:hover::before,
#theme-toggle:hover::before {
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.2),
        0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Focus states */
.theme-toggle-header:focus,
#theme-toggle:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Active states */
.theme-toggle-header:active,
#theme-toggle:active {
    transform: scale(0.98);
    transition: all 0.1s ease;
}

/* Legacy styles - removed for unified design */


/* Responsive design */
@media (max-width: 768px) {

    .theme-toggle-header,
    #theme-toggle {
        width: 56px;
        height: 28px;
        margin-left: 0.5rem;
    }

    .theme-toggle-header::before,
    #theme-toggle::before {
        width: 22px;
        height: 22px;
    }

    [data-theme="dark"] .theme-toggle-header::before,
    [data-theme="dark"] #theme-toggle::before {
        transform: translateX(28px);
    }

    .theme-toggle-header .theme-toggle-icon,
    #theme-toggle .theme-toggle-icon {
        font-size: 12px;
    }

    .theme-toggle-header .theme-toggle-icon:first-child,
    #theme-toggle .theme-toggle-icon:first-child {
        left: 6px;
    }

    .theme-toggle-header .theme-toggle-icon:last-child,
    #theme-toggle .theme-toggle-icon:last-child {
        right: 6px;
    }
}

@media (max-width: 480px) {

    .theme-toggle-header,
    #theme-toggle {
        width: 50px;
        height: 26px;
        margin-left: 0.25rem;
    }

    .theme-toggle-header::before,
    #theme-toggle::before {
        width: 20px;
        height: 20px;
    }

    [data-theme="dark"] .theme-toggle-header::before,
    [data-theme="dark"] #theme-toggle::before {
        transform: translateX(24px);
    }

    .theme-toggle-header .theme-toggle-icon,
    #theme-toggle .theme-toggle-icon {
        font-size: 11px;
    }

    .theme-toggle-header .theme-toggle-icon:first-child,
    #theme-toggle .theme-toggle-icon:first-child {
        left: 5px;
    }

    .theme-toggle-header .theme-toggle-icon:last-child,
    #theme-toggle .theme-toggle-icon:last-child {
        right: 5px;
    }
}

/* Add a subtle pulse animation for first-time visitors */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.6), 0 2px 6px rgba(0, 0, 0, 0.15);
    }

    100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1);
    }
}

/* ===== CONTENT COLUMN ===== */
.content-column {
    max-width: 650px;
    padding-top: 10px;
}

.content-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.content-header.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.content-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.content-title {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0 0 20px 0;
    font-weight: 400;
}

.content-connect {
    margin-top: 20px;
}

.connect-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    font-weight: 500;
}

.connect-links {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
    align-items: center;
}

.connect-links a {
    font-size: 1.2rem;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.8;
}

.connect-links a:hover {
    transform: scale(1.2);
    opacity: 1;
}

.section {
    margin-bottom: 35px;
}

.section h2 {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
    margin: 25px 0 15px 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.section p {
    margin-bottom: 12px;
    text-align: justify;
}

.section a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.section a:hover {
    color: var(--link-hover);
}

/* ===== NEWS SECTION ===== */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.news-date {
    font-weight: bold;
    color: var(--text-secondary);
    min-width: 70px;
    font-size: 13px;
}

.news-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
}

/* ===== PUBLICATIONS ===== */
.publication {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eeeeee;
}

.publication:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.pub-title {
    font-size: 15px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 3px;
    line-height: 1.3;
}

.pub-authors {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.pub-venue {
    font-size: 13px;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.pub-description {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
    text-align: justify;
}

.pub-links {
    font-size: 12px;
}

.pub-links a {
    color: var(--link-color);
    text-decoration: none;
    margin-right: 3px;
}

.pub-links a:hover {
    color: var(--link-hover);
}

.view-all {
    margin-top: 15px;
    text-align: center;
}

.view-all a {
    color: var(--link-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
}

.view-all a:hover {
    color: var(--link-hover);
}

/* ===== PROJECTS ===== */
.project {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eeeeee;
}

.project:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.project-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.project-description {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 5px;
    text-align: justify;
}

.project-links {
    font-size: 12px;
}

.project-links a {
    color: var(--link-color);
    text-decoration: none;
    margin-right: 3px;
}

.project-links a:hover {
    color: var(--link-hover);
}

/* ===== SERVICE SECTION ===== */
.service-item {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .container {
        padding: 25px 15px;
    }

    .main-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .profile-column {
        position: static;
        text-align: center;
        display: none;
        /* Hide sidebar on mobile */
    }

    .content-header {
        margin-bottom: 30px;
        text-align: center;
    }

    .content-name {
        font-size: 2rem;
    }

    .connect-links {
        justify-content: center;
        gap: 20px;
    }

    .connect-links a {
        font-size: 1.4rem;
    }

    .profile-image {
        width: 150px;
        height: 150px;
    }

    .name {
        font-size: 20px;
    }

    .section h2 {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .profile-image {
        width: 120px;
        height: 120px;
    }

    .name {
        font-size: 18px;
    }

    .news-item {
        flex-direction: column;
        gap: 3px;
    }

    .news-date {
        min-width: auto;
        font-weight: bold;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .container {
        max-width: none;
        padding: 0;
    }

    .main-layout {
        grid-template-columns: 200px 1fr;
        gap: 20px;
    }

    .profile-image {
        width: 120px;
        height: 120px;
    }

    .section {
        break-inside: avoid;
    }

    a {
        color: var(--text-primary);
        text-decoration: underline;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== SELECTION ===== */
::selection {
    background: rgba(99, 179, 237, 0.3);
}

[data-theme="dark"] ::selection {
    background: rgba(99, 179, 237, 0.4);
}

/* ===== FOCUS STYLES ===== */
a:focus {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

button:focus {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

.tag-cloud-item:focus {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

/* ===== DETAILED PAGES STYLES ===== */
.page-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    border-bottom: 1px solid var(--border-color);
}

.index-nav {
    justify-content: center;
    padding: 15px 0;
    margin-bottom: 10px;
    margin-bottom: 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.page-nav .nav-links {
    display: flex;
    gap: 20px;
}

.page-nav .nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.page-nav .nav-links a.active,
.page-nav .nav-links a:hover {
    color: var(--link-color);
    background: rgba(59, 130, 246, 0.1);
}

.page-nav a[href*="index.html"] {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 0;
}

.page-nav a[href*="index.html"]:hover {
    color: var(--link-color);
}

.page-layout {
    max-width: 800px;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 6px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

/* Filter Section */
.filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px;
    background: var(--filter-bg);
    border-radius: 6px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--card-background);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--link-color);
    color: white;
    border-color: var(--link-color);
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.sort-options select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
}

/* Publications Page */
.publications-container {
    margin-bottom: 40px;
}

.year-section {
    margin-bottom: 30px;
}

.year-header {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--border-color);
}

.publication-item {
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-background);
}

.pub-header {
    margin-bottom: 8px;
}

.pub-title-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.status-badge {
    font-size: 10px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-badge.under-review {
    background: var(--badge-under-review-bg);
    color: var(--badge-under-review-text);
}

.status-badge.preprint {
    background: var(--badge-preprint-bg);
    color: var(--badge-preprint-text);
}

.status-badge.published {
    background: var(--badge-published-bg);
    color: var(--badge-published-text);
}

.status-badge.active {
    background: var(--badge-featured-bg);
    color: var(--badge-featured-text);
}

.status-badge.completed {
    background: var(--badge-published-bg);
    color: var(--badge-published-text);
}

.status-badge.on-hold {
    background: var(--badge-under-review-bg);
    color: var(--badge-under-review-text);
}

.pub-tags {
    margin: 10px 0;
}

.tag {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-right: 5px;
    margin-bottom: 3px;
}

.pub-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 12px;
}

.btn-secondary {
    padding: 6px 12px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-secondary:hover {
    background: var(--link-color);
    color: white;
    border-color: var(--link-color);
}

.btn-primary {
    padding: 6px 12px;
    background: var(--link-color);
    border: 1px solid var(--link-color);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-primary:hover {
    background: var(--link-hover);
    border-color: var(--link-hover);
}

/* Statistics */
.pub-stats {
    background: var(--filter-bg);
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
}

.pub-stats h3 {
    font-size: 16px;
    margin-bottom: 15px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: var(--link-color);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Tags Cloud */
.research-areas-section {
    margin-bottom: 30px;
}

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

.tag-cloud-item {
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag-cloud-item:hover {
    background: var(--link-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .tag-cloud-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Projects Page */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.project-card {
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-background);
    transition: all 0.2s ease;
}

.project-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.project-badges {
    display: flex;
    gap: 8px;
}

.featured-badge {
    background: var(--badge-featured-bg);
    color: var(--badge-featured-text);
    font-size: 10px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.project-technologies {
    margin: 10px 0;
    font-size: 13px;
}

.tech-tag {
    display: inline-block;
    background: var(--tech-tag-bg);
    color: var(--tech-tag-text);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    margin-right: 4px;
    margin-bottom: 2px;
}

.project-collaboration {
    margin: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Lab Overview */
.lab-overview {
    background: var(--filter-bg);
    padding: 25px;
    border-radius: 6px;
    margin-bottom: 30px;
}

.lab-principles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.principle h4 {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.principle p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Technologies Section */
.technologies-section {
    margin-bottom: 30px;
}

.tech-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.tech-category h4 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-background);
    border-radius: 8px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.modal-header h2 {
    font-size: 18px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-authors {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.modal-venue {
    font-size: 13px;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.modal-abstract {
    margin-bottom: 15px;
}

.modal-abstract h4 {
    font-size: 14px;
    margin-bottom: 8px;
}

.modal-abstract p {
    font-size: 13px;
    line-height: 1.5;
    text-align: justify;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section h4,
.modal-section h5 {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.modal-section ul {
    margin-left: 20px;
    margin-bottom: 10px;
}

.modal-section li {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.experiment-item {
    background: var(--filter-bg);
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.experiment-status,
.experiment-tech {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Blog Preview Styles (Homepage) - Compact List Style */
.blog-post-preview {
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border-color);
}

.blog-post-preview:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.blog-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.blog-preview-date {
    font-weight: 500;
}

.blog-preview-category {
    color: var(--text-muted);
    font-size: 11px;
}

.blog-preview-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    color: var(--text-primary);
}

.blog-preview-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.blog-preview-title a:hover {
    color: var(--link-color);
}

.blog-preview-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 6px;
}

.blog-preview-tags {
    display: none;
    /* Hide tags on homepage for cleaner look */
}

.blog-preview-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.blog-preview-read-time {
    color: var(--text-muted);
}

.blog-preview-link {
    color: var(--link-color);
    text-decoration: none;
    font-size: 11px;
}

.blog-preview-link:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Back to Blog Link */
.back-link {
    max-width: 720px;
    margin: 0 auto 20px auto;
    padding: 0 20px;
}

.back-link a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
}

.back-link a:hover {
    color: var(--link-color);
}

/* Blog Post Content Styles (Reusable) */
.blog-post-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px;
    line-height: 1.6;
}

.blog-post-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

/* Simple blog header layout */

.blog-post-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.blog-post-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0;
    line-height: 1.2;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.blog-post-date {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Author info removed - clean row layout */

.blog-post-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0;
    line-height: 1.5;
    font-weight: 400;
}

.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0;
}

/* Responsive design for blog header */
@media (max-width: 768px) {
    .blog-post-title {
        font-size: 1.8rem;
    }
}

.series-info {
    background: var(--badge-series-bg);
    color: var(--badge-series-text);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.blog-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 30px 0 15px 0;
    color: var(--text-primary);
}

.blog-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 25px 0 10px 0;
    color: var(--text-primary);
}

.blog-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.blog-content ul,
.blog-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.blog-content li {
    margin-bottom: 8px;
}

.blog-content strong {
    font-weight: 600;
}

.blog-content code {
    background: var(--code-bg);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.blog-content pre {
    background: #2d3748 !important;
    padding: 20px !important;
    border-radius: 8px !important;
    overflow-x: auto !important;
    margin: 25px 0 !important;
    position: relative !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid #4a5568 !important;
}

.blog-content pre code {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-size: 0.9em !important;
    color: #e2e8f0 !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
}

/* Prism.js enhancements - Carbon.sh inspired with classic dark theme */
pre[class*="language-"] {
    background: #282c34 !important;
    border: 1px solid #3e4451 !important;
    color: #abb2bf !important;
    padding: 0 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    margin: 25px 0 !important;
    box-shadow: 0 20px 68px rgba(0, 0, 0, 0.55) !important;
    position: relative !important;
}

/* Carbon.sh style header with dots */
pre[class*="language-"]::before {
    content: '';
    display: block;
    background: #21252b;
    padding: 12px 16px;
    border-bottom: 1px solid #181a1f;
    min-height: 8px;
}

/* macOS-style window controls */
.code-window-controls {
    position: absolute;
    top: 12px;
    left: 16px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.code-control-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.code-control-btn .control-dot {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
}

.code-close .control-dot {
    background: #ff5f56;
}

.code-minimize .control-dot {
    background: #ffbd2e;
}

.code-maximize .control-dot {
    background: #27c93f;
}

.code-control-btn:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.code-control-btn:active {
    transform: scale(0.95);
}

/* Show icon on hover */
.code-control-btn:hover::after {
    position: absolute;
    font-size: 8px;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.6);
}

.code-close:hover::after {
    content: '×';
}

.code-minimize:hover::after {
    content: '−';
}

.code-maximize:hover::after {
    content: '+';
}

pre[class*="language-"]>code {
    display: block;
    padding: 20px !important;
    overflow-x: auto;
}

code[class*="language-"] {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 0.9em !important;
    color: #abb2bf !important;
    background: transparent !important;
}

/* Classic Dark Theme (Atom One Dark inspired) */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #5c6370 !important;
    font-style: italic !important;
}

.token.punctuation {
    color: #abb2bf !important;
}

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
    color: #e06c75 !important;
}

.token.boolean,
.token.number {
    color: #d19a66 !important;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #98c379 !important;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
    color: #56b6c2 !important;
}

.token.atrule,
.token.attr-value,
.token.function,
.token.class-name {
    color: #61afef !important;
}

.token.keyword {
    color: #c678dd !important;
    font-weight: 500 !important;
}

.token.important,
.token.bold {
    font-weight: bold !important;
}

.token.italic {
    font-style: italic !important;
}

/* Copy button styling - Carbon.sh inspired */
div.code-toolbar {
    position: relative;
}

div.code-toolbar>.toolbar {
    position: absolute;
    top: 8px;
    right: 16px;
    z-index: 10;
    display: flex;
    align-items: center;
}

div.code-toolbar>.toolbar button,
div.code-toolbar>.toolbar .toolbar-item a {
    background: transparent !important;
    color: #888 !important;
    border: none !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-size: 0 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
}

/* Copy icon using Unicode */
div.code-toolbar>.toolbar button::before {
    content: '⧉';
    font-size: 16px !important;
    display: block;
    line-height: 1;
}

div.code-toolbar>.toolbar button:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
}

div.code-toolbar>.toolbar button:active {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* Success state for copy button */
div.code-toolbar>.toolbar button[data-copy-state="copy-success"] {
    color: #27c93f !important;
}

div.code-toolbar>.toolbar button[data-copy-state="copy-success"]::before {
    content: '✓';
    font-size: 18px !important;
}

.blog-content blockquote {
    border-left: 4px solid var(--link-color);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: var(--text-secondary);
}

.math-formula {
    background: var(--filter-bg);
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
    text-align: center;
    font-family: 'Times New Roman', serif;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

/* MathJax styling */
.MathJax {
    font-size: 1.2em !important;
}

mjx-container[jax="CHTML"] {
    line-height: 1.3 !important;
}

mjx-container[jax="CHTML"][display="true"] {
    margin: 1.5em 0 !important;
    text-align: center !important;
}

/* Inline math styling */
.blog-content mjx-container[display="true"] {
    margin: 1.5em 0 !important;
}

/* Math formula container enhancements */
.math-formula mjx-container {
    font-size: 1.3em !important;
}

.math-formula mjx-container[display="true"] {
    margin: 0 !important;
}

/* ===== TIMELINE PAGE ===== */
.minimal-timeline-container {
    margin-top: 25px;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.minimal-timeline {
    position: relative;
    padding-left: 0;
}

.minimal-timeline-entry {
    margin-bottom: 8px;
    line-height: 1.65;
    text-align: justify;
}

.minimal-timeline-entry p {
    margin: 0;
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 400;
}

.minimal-timeline-date {
    font-weight: 700;
    color: var(--text-primary);
    font-style: italic;
    display: inline;
    margin-right: 6px;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.minimal-timeline-content {
    display: inline;
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-primary);
}

.minimal-timeline-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.minimal-timeline-links {
    display: inline;
    margin-left: 4px;
}

.minimal-timeline-link {
    font-size: 14px;
    color: var(--accent-color);
    text-decoration: none;
    margin-right: 6px;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.2s ease;
}

.minimal-timeline-link:hover {
    border-bottom-color: var(--accent-color);
}

.minimal-timeline-year-section {
    margin-bottom: 35px;
}

.minimal-timeline-year-section:last-child {
    margin-bottom: 0;
}

.minimal-timeline-year-header {
    margin-bottom: 18px;
    position: relative;
}

.minimal-timeline-year {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    display: inline-block;
    padding-right: 20px;
    background-color: var(--background);
    position: relative;
    z-index: 2;
}

.minimal-timeline-year-header::after {
    content: '';
    position: absolute;
    height: 1px;
    background: linear-gradient(to right, var(--border-color) 0%, var(--border-color) 70%, transparent 100%);
    left: 0;
    right: 0;
    top: 50%;
    z-index: 1;
}

.minimal-timeline-empty {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-style: italic;
    font-size: 15px;
}

@media (max-width: 768px) {
    .minimal-timeline-container {
        margin-top: 20px;
        max-width: 100%;
        padding: 0 15px;
    }

    .minimal-timeline-entry {
        margin-bottom: 7px;
        text-align: left;
    }

    .minimal-timeline-entry p {
        font-size: 14px;
    }

    .minimal-timeline-date {
        font-size: 13px;
        display: block;
        margin-bottom: 2px;
        margin-right: 0;
    }

    .minimal-timeline-content {
        font-size: 14px;
        display: block;
    }

    .minimal-timeline-link {
        font-size: 13px;
    }

    .minimal-timeline-year {
        font-size: 18px;
    }

    .minimal-timeline-year-section {
        margin-bottom: 28px;
    }
}

/* Blog Page Styles */
.blog-posts-container {
    margin-bottom: 40px;
}

.blog-post-item {
    margin-bottom: 30px;
    padding: 25px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-background);
    transition: all 0.2s ease;
}

.blog-post-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.blog-post-item.featured {
    border-left: 4px solid var(--link-color);
}

.blog-post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.blog-post-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-muted);
}

.blog-post-badges {
    display: flex;
    gap: 8px;
}

.featured-badge {
    background: var(--badge-featured-bg);
    color: var(--badge-featured-text);
    font-size: 10px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.series-badge {
    background: var(--badge-series-bg);
    color: var(--badge-series-text);
    font-size: 10px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 10px;
}

.blog-post-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
    color: var(--text-primary);
}

.blog-post-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 15px;
}

.blog-post-tags {
    margin-bottom: 15px;
}

.blog-post-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.blog-post-link {
    font-size: 13px;
    color: var(--link-color);
    text-decoration: none;
}

.blog-post-link:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Blog Series Section */
.blog-series-section {
    margin-bottom: 40px;
    background: var(--filter-bg);
    padding: 25px;
    border-radius: 8px;
}

.series-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.series-item {
    background: var(--card-background);
    padding: 20px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.series-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.series-description {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.series-posts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.series-post {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.series-post:hover {
    background-color: var(--filter-bg);
}

.series-post-number {
    background: var(--link-color);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.series-post-title {
    flex-grow: 1;
    font-size: 13px;
    color: var(--text-primary);
}

.series-post-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* Blog Tags Section */
.blog-tags-section {
    margin-bottom: 40px;
}

/* Archive Section */
.blog-archive-section {
    margin-bottom: 40px;
}

.archive-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.archive-year {
    background: var(--filter-bg);
    padding: 20px;
    border-radius: 6px;
}

.archive-year-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.archive-posts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.archive-post {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.archive-post:hover {
    background-color: var(--card-background);
}

.archive-post-title {
    font-size: 13px;
    color: var(--text-primary);
    flex-grow: 1;
    margin-right: 10px;
}

.archive-post-date {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Blog Modal Styles */
.blog-modal {
    max-width: 600px;
}

.modal-blog-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.modal-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.modal-series-info {
    background: var(--badge-series-bg);
    color: var(--badge-series-text);
    padding: 10px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 13px;
}

.modal-blog-links {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.filter-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.filter-header h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.no-series {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
}

/* Responsive Design for Detailed Pages */
@media (max-width: 768px) {
    .filter-section {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .filter-buttons {
        flex-wrap: wrap;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .lab-principles {
        grid-template-columns: 1fr;
    }

    .tech-categories {
        grid-template-columns: 1fr;
    }

    .pub-title-section {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .pub-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Blog responsive styles */
    .blog-post-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .blog-post-meta {
        flex-wrap: wrap;
        gap: 10px;
    }

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

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

    .archive-post {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .modal-blog-links {
        flex-direction: column;
    }
}

/* ===== INLINE REFERENCE STYLING ===== */
/* Compact inline reference links for blog posts */
a.inline-ref {
    display: inline;
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 500;
    margin: 0 1px;
    padding: 0;
    transition: color 0.2s ease, background-color 0.2s ease;
}

a.inline-ref:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Ensure references don't break across lines awkwardly */
a.inline-ref::before {
    content: '';
    display: inline-block;
    width: 0;
}

/* Style for the reference section at the bottom */
.blog-content h3+div[style*="font-size: 12px"] p {
    margin: 8px 0;
}

.blog-content h3+div[style*="font-size: 12px"] a {
    word-break: break-all;
    color: var(--link-color);
}

.blog-content h3+div[style*="font-size: 12px"] a:hover {
    color: var(--link-hover);
}