/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    overflow-x: auto;
    width: 100%;
    min-width: 0;
}

/* Container Layout */
.container {
    display: grid;
    grid-template-rows: auto 1fr;
    grid-template-columns: 300px 1fr;
    min-height: 100vh;
    gap: 0;
    width: 100%;
    overflow-x: auto;
}

/* Top Navigation Panel */
.top-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    grid-column: 1 / -1;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Left Profile Panel */
.left-panel {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 2rem 1.5rem;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-menu li {
    margin-bottom: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.nav-link i {
    margin-right: 0.5rem;
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
}

/* Center Content Panel */
.center-panel {
    background: white;
    padding: 2rem;
    overflow-y: auto;
    height: calc(100vh - 80px);
    scroll-behavior: smooth;
}

.content-section {
    display: block;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    margin-bottom: 2rem;
    scroll-margin-top: 2rem;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.subtitle {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

/* Simple Timeline with Line */
.timeline-container {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem 0;
    margin: 1rem 0;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #667eea;
    transform: translateY(-50%);
    z-index: 1;
}

.timeline-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    flex: 1;
    min-height: 80px;
}

.timeline-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    border: 2px solid white;
    transform: translate(-50%, -50%);
    z-index: 3;
    box-shadow: 0 0 0 2px #667eea;
}

/* Year labels positioned above the line, no callout lines */
.timeline-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: #667eea;
    margin-top: -1.5rem;
    white-space: nowrap;
    background: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Content positioned at the end of callout lines, alternating up/down */
.timeline-item:nth-child(odd) .timeline-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin-top: 1.5rem;
    margin-left: 1.5rem;
    background: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-item:nth-child(even) .timeline-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin-top: -1.5rem;
    margin-left: 1.5rem;
    background: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-content h3 {
    font-size: 0.9rem;
    color: #2c3e50;
    margin: 0;
    text-align: center;
    font-weight: 500;
    white-space: nowrap;
}

/* Vertical callout lines extending to content labels */
.timeline-item:nth-child(odd)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 20px;
    background: #667eea;
    transform: translate(-50%, -50%);
    z-index: 2;
    margin-top: 1.5rem;
    margin-left: 0.5rem;
}

.timeline-item:nth-child(even)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1px;
    height: 20px;
    background: #667eea;
    transform: translate(-50%, -50%);
    z-index: 2;
    margin-top: -1.5rem;
    margin-left: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .timeline-container {
        flex-direction: column;
        gap: 2rem;
        padding: 2rem 0;
    }
    
    .timeline-line {
        display: none;
    }
    
    .timeline-item {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        min-height: auto;
        position: relative;
    }
    
    .timeline-marker {
        position: static;
        transform: none;
        margin-right: 1rem;
    }
    
    .timeline-label {
        position: static;
        transform: none;
        margin: 0;
        margin-right: 1rem;
    }
    
    .timeline-content {
        position: static;
        transform: none;
        margin: 0;
    }
    
    .timeline-content h3 {
        text-align: left;
        white-space: normal;
    }
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.content-card {
    background: white;
    padding: 1.25rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 2rem;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.4rem;
    scroll-margin-top: 2rem;
}

/* Education Styles */
.education-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: none;
}

.education-item h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.institution {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.duration {
    color: #7f8c8d;
    font-style: italic;
}

/* Publications Styles */
.publication-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: none;
}

.publication-item h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.authors {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.venue {
    color: #7f8c8d;
    margin-bottom: 0.25rem;
}

.acceptance-rate {
    color: #27ae60;
    font-weight: 600;
}

/* Research Styles */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.research-item {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: none;
}

.research-item h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* Contact Styles */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-info p {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
}

.contact-info i {
    color: #667eea;
    width: 20px;
}

.contact-info a {
    color: #667eea;
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Right Personal Info Panel */
.right-panel {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 2rem 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.profile-section {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-image {
    margin-bottom: 1.5rem;
}

.profile-image img {
    width: 150px;
    height: 200px;
    border-radius: 6px;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.profile-section h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.title {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.university {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.info-section {
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.info-item i {
    color: #667eea;
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

.info-item a {
    color: #667eea;
    text-decoration: none;
}

.info-item a:hover {
    text-decoration: underline;
}

.quick-stats {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.quick-stats h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 250px 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
        min-height: 100vh;
        width: 100%;
        overflow-x: auto;
        gap: 0;
    }

    .left-panel {
        height: auto;
        position: static;
        padding: 1.5rem 1rem;
        width: 70%;
        max-width: 70%;
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
        border-radius: 12px;
        margin: 0 auto;
    }

    /* Enhanced mobile navigation */
    .top-panel {
        padding: 0.75rem 1rem;
        position: sticky;
        top: 0;
        z-index: 1000;
        backdrop-filter: blur(10px);
        background: rgba(102, 126, 234, 0.95);
    }

    .nav-menu {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.5rem;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem 1rem;
        margin: 0 -1rem;
    }
    
    .nav-menu::-webkit-scrollbar {
        display: none;
    }
    
    .nav-menu {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .nav-menu li { 
        flex: 0 0 auto; 
        min-width: fit-content;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
        border-radius: 25px;
        background: rgba(255, 255, 255, 0.1);
        transition: all 0.3s ease;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: white;
        font-weight: 500;
    }

    .nav-link:hover,
    .nav-link.active {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .nav-link i {
        margin-right: 0.5rem;
        font-size: 0.9rem;
    }

    .center-panel {
        height: auto;
        padding: 1rem 0.75rem;
        width: 100%;
        overflow-x: auto;
    }

    /* Mobile profile section improvements */
    .profile-section {
        text-align: center;
        padding: 1rem 0;
    }

    .profile-image {
        width: 120px;
        height: 120px;
        margin: 0 auto 1rem;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }

    .profile-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .profile-section h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
        color: #2c3e50;
    }

    .profile-section .title {
        font-size: 1rem;
        color: #666;
        margin-bottom: 0.25rem;
    }

    .profile-section .university {
        font-size: 0.9rem;
        color: #888;
    }

    /* Mobile info section */
    .info-section {
        margin: 1.5rem 0;
    }

    .info-item {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .info-item:last-child {
        border-bottom: none;
    }

    .info-item i {
        width: 20px;
        color: #666;
        font-size: 1rem;
    }

    .info-item span,
    .info-item a {
        font-size: 0.9rem;
        color: #555;
        text-decoration: none;
    }

    .info-item a:hover {
        color: #333;
    }

    /* Mobile quick stats */
    .quick-stats {
        margin-top: 1.5rem;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.5);
        border-radius: 12px;
    }

    .quick-stats h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        text-align: left;
        color: #2c3e50;
    }

    .stat-item {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .stat-item:last-child {
        border-bottom: none;
    }

    .stat-number {
        font-size: 1.2rem;
        font-weight: bold;
        color: #333;
        margin-right: 0;
    }

    .stat-label {
        font-size: 0.9rem;
        color: #666;
        margin-left: 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .research-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav-menu { flex-direction: row; }

    .hero {
        padding: 2rem 1rem;
    }
    
    /* Enhanced mobile content cards */
    .content-card {
        padding: 1.25rem;
        margin: 0.75rem 0;
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        background: white;
        border: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .content-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        color: #2c3e50;
        text-align: center;
    }
    
    .content-section p {
        font-size: 0.95rem;
        line-height: 1.6;
        color: #555;
        margin-bottom: 1rem;
    }
    
    /* Mobile research items */
    .research-item {
        padding: 1rem;
        margin: 0.75rem 0;
        background: #f8f9fa;
        border-radius: 12px;
        border-left: none;
    }
    
    .research-item h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        color: #2c3e50;
    }
    
    .research-item p {
        font-size: 0.9rem;
        line-height: 1.5;
        color: #666;
    }
    
    /* Mobile education items */
    .education-item {
        padding: 1rem;
        margin: 0.75rem 0;
        background: #f8f9fa;
        border-radius: 12px;
        border-left: none;
    }
    
    .education-item h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        color: #2c3e50;
    }
    
    .education-item .institution {
        font-size: 0.9rem;
        color: #666;
        font-weight: 500;
        margin-bottom: 0.25rem;
    }
    
    .education-item .duration {
        font-size: 0.85rem;
        color: #666;
        margin-bottom: 0.5rem;
    }
    
    .education-item p {
        font-size: 0.9rem;
        line-height: 1.5;
        color: #555;
    }
    
    /* Mobile publication items */
    .publication-item {
        padding: 1rem;
        margin: 0.75rem 0;
        background: #f8f9fa;
        border-radius: 12px;
        border-left: none;
    }
    
    .publication-item h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        color: #2c3e50;
    }
    
    .publication-item .authors {
        font-size: 0.9rem;
        color: #666;
        font-weight: 500;
        margin-bottom: 0.25rem;
    }
    
    .publication-item .venue {
        font-size: 0.85rem;
        color: #666;
        margin-bottom: 0.5rem;
    }
    
    .publication-item p {
        font-size: 0.9rem;
        line-height: 1.5;
        color: #555;
    }
    
    /* Prevent any element from causing horizontal scroll */
    * {
        box-sizing: border-box;
    }
    
    .container {
        width: 100%;
        overflow-x: auto;
    }
    
    .center-panel {
        width: 100%;
        padding: 0.5rem;
        overflow-x: auto;
    }
    
    .content-card {
        width: 100%;
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Gallery Styles */
.gallery-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 2rem 0;
}

.gallery-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 1rem 0;
    scrollbar-width: thin;
    scrollbar-color: #4a90e2 #f0f0f0;
}

.gallery-scroll::-webkit-scrollbar {
    height: 8px;
}

.gallery-scroll::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.gallery-scroll::-webkit-scrollbar-thumb {
    background: #4a90e2;
    border-radius: 4px;
}

.gallery-scroll::-webkit-scrollbar-thumb:hover {
    background: #357abd;
}

.gallery-item {
    flex: 0 0 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e0e0e0;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-image img {
    transform: scale(1.05);
}

.gallery-content {
    padding: 1.5rem;
}

.gallery-content h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

.gallery-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

.gallery-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.scroll-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    pointer-events: all;
    color: #4a90e2;
    font-size: 1.1rem;
}

.scroll-btn:hover {
    background: #4a90e2;
    color: white;
    transform: scale(1.1);
}

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

.prev-btn {
    margin-left: 1rem;
}

.next-btn {
    margin-right: 1rem;
}

/* Enhanced mobile gallery */
@media (max-width: 768px) {
    .gallery-controls {
        display: none;
    }
    
    .gallery-item {
        flex: 0 0 280px;
        margin: 0 0.5rem;
    }
    
    .gallery-scroll {
        gap: 1rem;
        padding: 1rem 0.5rem;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }
    
    .gallery-item {
        scroll-snap-align: start;
    }
    
    .gallery-image {
        height: 180px;
    }
    
    .gallery-content {
        padding: 1.25rem;
    }
    
    .gallery-content h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .gallery-content p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .gallery-item {
        flex: 0 0 260px;
        margin: 0 0.25rem;
    }
    
    .gallery-scroll {
        gap: 0.75rem;
        padding: 0.75rem 0.25rem;
    }
    
    .gallery-image {
        height: 160px;
    }
    
    .gallery-content {
        padding: 1rem;
    }
    
    .gallery-content h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .gallery-content p {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    /* Enhanced touch scrolling for mobile */
    .gallery-scroll {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }
    
    .gallery-item {
        scroll-snap-align: center;
        transition: transform 0.2s ease;
    }
    
    .gallery-item:active {
        transform: scale(0.98);
    }
}