/* Enhanced Swiss Design CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

/* Modern CSS Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #000;
    background-color: #eee;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    min-height: 100vh;
}

/* Background Visualization */
#background-visualization {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#background-visualization canvas {
    display: block;
}

/* Main Content */
main {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 350px 1fr; /* Made left column slightly narrower */
    gap: 60px; /* Reduced gap slightly */
    max-width: 1600px; /* Increased overall max width */
    margin: 0 auto;
    padding: 60px 40px;
}

/* Add subtle backdrop blur to content containers */
.profile-container,
.content {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Video Container */
.video-container {
    margin: -20px -60px 40px;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Enhanced Profile Section */
.profile-container {
    position: sticky;
    top: 60px;
    height: fit-content;
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.profile-container:hover {
    transform: translateY(-2px);
}

.profile-image-placeholder {
    width: 100%;
    aspect-ratio: 1;
    margin: 0 0 30px;
    overflow: hidden;
    border-radius: 2px;
    position: relative;
}

.profile-image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: all 0.5s ease;
}

.profile-image-placeholder:hover img {
    transform: scale(1.02);
}

/* Typography Enhancements */
h1 {
    font-size: 2.8rem;
    margin: 0 0 10px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.2rem;
    margin-bottom: 40px;
    letter-spacing: 0.02em;
    color: #666;
}

/* Sections Enhancement */
.content {
    background: rgba(255, 255, 255, 0.9);
    padding: 60px 80px; /* Increased horizontal padding */
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    max-width: 1000px; /* Added max-width limit to prevent extremely wide text blocks */
}

/* About section text justification */
.about-content p {
    text-align: justify;
}

section {
    margin-bottom: 80px;
    position: relative;
}

section:last-child {
    margin-bottom: 0;
}

/* Special case for publications section to be more compact */
#publications-section h2 {
    margin-bottom: 30px; /* Reduced from default 40px */
}

h2 {
    font-size: 2rem;
    margin: 0 0 40px;
    font-weight: 600;
    position: relative;
    letter-spacing: -0.01em;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: #000;
    margin-top: 20px;
}

/* Research Section Enhancement */
.research-illustration {
    margin: 40px auto;
    background: #000;
    padding: 40px;
    position: relative;
    max-width: 800px; /* Increased max-width for wider display */
}

/* Cooperation Illustration Section */
.cooperation-illustration {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.cooperation-illustration .research-illustration {
    margin-bottom: 0;
}

.game-theory-illustration {
    width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
    filter: invert(1);
    transition: transform 0.3s ease;
}

.game-theory-illustration:hover {
    transform: scale(1.02);
}

.image-caption {
    font-size: 0.9rem;
    color: #fff;
    margin-top: 20px;
    text-align: center;
    font-style: italic;
    letter-spacing: 0.02em;
}

.research ul {
    list-style: none;
    margin: 30px 0;
}

.research ul ul {
    margin: 10px 0 20px 20px;
}

.research li {
    margin-bottom: 10px;
}

/* Enhanced Publications */
.publication {
    margin-bottom: 30px; /* Reduced from 50px */
    padding-bottom: 30px; /* Reduced from 50px */
    border-bottom: 1px solid rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: 80px 1fr; /* Reduced width of year column from 150px */
    gap: 25px; /* Reduced from 40px */
    transition: transform 0.3s ease;
}

.publication:hover {
    transform: translateX(10px);
}

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

.publication-year {
    font-size: 1.6rem; /* Reduced from 2.5rem */
    font-weight: 500; /* Reduced from 600 */
    letter-spacing: -0.02em;
    color: #000;
    opacity: 0.7; /* Reduced from 0.8 */
    align-self: start; /* Align at top rather than center */
    padding-top: 5px; /* Small padding to align better with title */
}

.publication-content h3 {
    font-size: 1.2rem; /* Reduced from 1.3rem */
    margin: 0 0 10px; /* Reduced bottom margin from 15px */
    font-weight: 600;
    line-height: 1.3;
}

.publication-content a {
    color: #000;
    text-decoration: none;
    background: linear-gradient(transparent 70%, rgba(0,0,0,0.1) 0);
    transition: background 0.3s ease;
}

.publication-content a:hover {
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.1) 0);
}

.publication-content p {
    margin: 6px 0; /* Reduced from 8px */
    font-size: 0.9rem; /* Reduced from 0.95rem */
    line-height: 1.4; /* Added tighter line height */
}

.publication-content .venue {
    font-size: 0.85rem; /* Reduced from 0.9rem */
    letter-spacing: 0.01em;
    color: #666;
    line-height: 1.3; /* Added tighter line height */
}

.publication-content .submission-info {
    font-size: 0.85rem;
    font-style: italic;
    color: #666;
    margin-top: 4px;
    line-height: 1.3;
}

.publication-content .citations {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

/* Profile Sections */
.profile-section {
    margin-bottom: 20px; /* Reduced from 30px to make ribbon shorter */
}

.profile-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.collaborator-section {
    margin-bottom: 25px; /* Reduced from 35px */
    padding-bottom: 0;
}

.profile-section ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-top: 8px;
    margin-bottom: 8px; /* Added to reduce space at bottom of lists */
}

.profile-section ul li {
    margin-bottom: 3px; /* Reduced from 5px */
    font-size: 0.95rem;
}

.media-link {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    color: #000;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.media-link:hover {
    opacity: 0.8;
}

.media-link svg {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    flex-shrink: 0;
}

.media-link span {
    border-bottom: 1px solid #000;
}

.personal-info-item {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.collaborator-logos {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 30px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.collaborator-logo {
    height: 30px;
    width: auto;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.collaborator-logo:hover {
    filter: grayscale(0);
    opacity: 1;
}

/* CV Link Style */
.cv-link {
    margin-bottom: 40px;
    text-align: left;
}

.cv-link .simple-link {
    color: #000;
    text-decoration: none;
    border-bottom: 1px solid #000;
    padding-bottom: 2px;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.cv-link .simple-link:hover {
    border-bottom-width: 2px;
    opacity: 0.8;
}

/* Contact section Enhancement */
.contact {
    margin-top: 30px; /* Reduced from 40px */
    padding-top: 30px; /* Reduced from 40px */
    border-top: 1px solid rgba(0,0,0,0.1);
}

.contact h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.contact h2::after {
    width: 40px;
    margin-top: 10px;
}

.contact p {
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    line-height: 1.8;
    color: #666;
}

.contact-links {
    margin-top: 20px;
}

.contact-links a {
    color: #000;
    text-decoration: none;
    background: linear-gradient(transparent 70%, rgba(0,0,0,0.1) 0);
    transition: background 0.3s ease;
}

.contact-links a:hover {
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.1) 0);
}

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

/* Enhanced Responsive Design */
@media (max-width: 1200px) {
    main {
        grid-template-columns: 300px 1fr; /* Slightly narrower sidebar on medium screens */
        gap: 50px;
        padding: 40px 30px;
    }
    
    .content {
        padding: 40px;
    }
    
    .research-illustration {
        margin: 30px auto;
        max-width: 600px; /* Increased from 500px */
    }
}

@media (max-width: 900px) {
    main {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .profile-container {
        position: static;
        max-width: 100%;
        text-align: center;
    }
    
    .profile-image-placeholder {
        max-width: 300px;
        margin: 0 auto 30px;
    }
    
    .publication {
        grid-template-columns: 70px 1fr; /* Keep the two-column layout but make year column smaller */
        gap: 15px;
    }
    
    .publication-year {
        font-size: 1.5rem; /* Reduced from 2rem */
        opacity: 0.7;
    }

    .research-illustration {
        max-width: 400px; /* Even smaller on mobile */
    }
}

@media (max-width: 600px) {
    /* For very small screens, switch to single column publications */
    .publication {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .publication-year {
        font-size: 1.3rem;
        margin-bottom: 5px;
    }
}

@media (max-width: 600px) {
    main {
        padding: 20px;
    }
    
    .content {
        padding: 30px;
    }
    
    .research-illustration {
        margin: 20px auto;
        padding: 20px;
        max-width: 300px; /* Smallest size for mobile */
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .publication:hover {
        transform: none;
    }
}

/* Timeline News Section */
/* Timeline axis */
.timeline-axis {
    position: absolute;
    left: 100px;
    top: 70px;
    bottom: 0;
    width: 2px;
    background: #ccc;
    z-index: 0;
}

/* View options */
.view-options {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    gap: 10px;
    flex-wrap: wrap;
}

.view-btn {
    background: none;
    border: 1px solid #ccc;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.view-btn.active {
    background: #000;
    color: white;
    border-color: #000;
}

/* Divider between upcoming and past events */
.timeline-divider {
    position: relative;
    margin: 40px 0 25px 100px;
    padding-left: 30px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    letter-spacing: 2px;
    text-transform: uppercase;
    z-index: 1;
}

.timeline-divider:before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 14px;
    height: 14px;
    background: #555;
    border-radius: 50%;
    transform: translate(-7px, -50%);
    z-index: 2;
}

/* Timeline items */
.timeline-item {
    position: relative;
    margin: 15px 0;
    padding-left: 120px;
    z-index: 1;
}

/* Marker on timeline */
.timeline-item:before {
    content: "";
    position: absolute;
    left: 100px;
    top: 15px;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid #555;
    border-radius: 50%;
    transform: translateX(-6px);
    z-index: 2;
}

/* Upcoming events styling */
.upcoming .timeline-item:before {
    background: #555;
}

/* Date indicator */
.timeline-date {
    position: absolute;
    left: 0;
    top: 10px;
    width: 90px;
    text-align: right;
    font-size: 12px;
    color: #666;
    line-height: 1.2;
    white-space: nowrap;
}

/* Event content */
.timeline-content {
    background: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.timeline-content h3 {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1.3;
    cursor: pointer;
}

.timeline-content .toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    padding: 0;
}

.timeline-details {
    margin-top: 10px;
    display: none;
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.timeline-details.show {
    display: block !important;
}

.timeline-details a {
    color: #000;
    text-decoration: none;
    border-bottom: 1px solid #000;
    padding-bottom: 1px;
    transition: opacity 0.2s;
}

.timeline-details a:hover {
    opacity: 0.7;
}

/* Toggle button states */
.toggle-btn:after {
    content: "+";
    display: inline-block;
    width: 20px;
    text-align: center;
}

.expanded .toggle-btn:after {
    content: "−";
}

/* Show More/Less Button */
.show-more-container {
    position: relative;
    margin: 20px 0 20px 100px;
    padding-left: 30px;
    z-index: 1;
}

.show-more-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s;
    font-family: inherit;
}

.show-more-btn:hover {
    background: #eee;
    border-color: #ccc;
    color: #333;
}

.show-more-btn.expanded {
    background: #000;
    color: white;
    border-color: #000;
}

/* Hidden past events smooth transition */
.hidden-past-events {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive adjustments for timeline */
@media (max-width: 768px) {
    .timeline-axis {
        left: 70px;
    }
    
    .timeline-divider {
        margin-left: 70px;
    }
    
    .timeline-item {
        padding-left: 100px;
    }
    
    .timeline-item:before {
        left: 70px;
    }
    
    .timeline-date {
        width: 60px;
        font-size: 12px;
    }
    
    .view-options {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 5px;
    }
    
    .show-more-container {
        margin-left: 70px;
    }
}

@media (max-width: 480px) {
    .timeline-axis {
        left: 50px;
    }
    
    .timeline-divider {
        margin-left: 50px;
        padding-left: 20px;
        font-size: 12px;
    }
    
    .timeline-item {
        padding-left: 70px; 
    }
    
    .timeline-item:before {
        left: 50px;
    }
    
    .timeline-date {
        width: 40px;
        font-size: 11px;
    }
    
    .timeline-content {
        padding: 10px 12px;
    }
    
    .timeline-content h3 {
        font-size: 14px;
    }
    
    .show-more-container {
        margin-left: 50px;
        padding-left: 20px;
    }
    
    .show-more-btn {
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* Student Projects Cards - More Compact Version */
.project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0 30px;
}

.project-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 0.9em;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}

.project-figure {
    height: 120px;
    position: relative;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.project-image {
    height: 120px;
    width: 100%;
    object-fit: contain;
}

.project-info {
    padding: 10px;
}

.project-type {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-title {
    font-weight: 500;
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    line-height: 1.3;
}

.project-supervisors {
    font-size: 0.75rem;
    color: #666;
    line-height: 1.3;
}

.project-supervisors a {
    color: #000;
    text-decoration: none;
    border-bottom: 1px solid #000;
}

.project-status {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    z-index: 1;
}

.status-ongoing {
    background: #000;
    color: white;
}

.status-past {
    background: #e0e0e0;
    color: #333;
}

.section-subheader {
    font-size: 1.1rem;
    font-weight: 400;
    margin-top: 25px;
    margin-bottom: 12px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.opportunities {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 3px;
    margin-top: 15px;
    margin-bottom: 25px;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .project-cards {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
    }
    
    .project-figure {
        height: 110px;
    }
    
    .project-image {
        height: 110px;
    }
}

@media (max-width: 480px) {
    .project-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .section-subheader {
        font-size: 1rem;
    }
    
    .project-figure {
        height: 100px;
    }
    
    .project-image {
        height: 100px;
    }
    
    .project-info {
        padding: 8px;
    }
}

@media (max-width: 360px) {
    .project-cards {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    #background-visualization {
        display: none;
    }
    
    body {
        background: white;
    }
    
    main {
        display: block;
        padding: 0;
    }
    
    .profile-container,
    .content {
        box-shadow: none;
        background: white;
    }
    
    /* Print-friendly timeline */
    .timeline-axis, .timeline-item:before, .timeline-divider:before, .toggle-btn {
        display: none;
    }
    
    .timeline-divider {
        border-top: 1px solid #999;
        padding: 10px 0;
        margin: 20px 0;
        text-align: center;
    }
    
    .timeline-item {
        padding-left: 0;
        margin: 20px 0;
        page-break-inside: avoid;
    }
    
    .timeline-date {
        position: static;
        display: block;
        width: 100%;
        text-align: left;
        font-weight: bold;
    }
    
    .timeline-details {
        display: block;
    }
    
    .view-options {
        display: none;
    }
    
    /* Print-friendly project cards */
    .project-cards {
        display: block;
    }
    
    .project-card {
        margin: 20px 0;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .project-image {
        max-height: 100px;
        width: auto;
    }
    
    .project-figure {
        height: auto;
        max-height: 100px;
        padding: 10px;
    }
    
    .project-status {
        position: static;
        display: inline-block;
        margin-bottom: 5px;
    }
}
