:root {
    --primary-color: #2b2d42;
    --accent-color: #6c63ff;
    --text-color: #2b2d42;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --gradient: linear-gradient(135deg, #6c63ff 0%, #3b82f6 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation Styles */
nav {
    padding: 1.5rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

nav.scrolled {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    padding: 4px;
    z-index: 1000;
}

.hamburger span {
    display: block;
    width: 30px;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
}

.nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: var(--gradient);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Dropdown Styles */
.nav-links > li {
    position: relative; /* Needed for positioning the dropdown */
}

.dropdown {
    display: none; /* Hide dropdown by default */
    position: absolute; /* Position it below the parent */
    top: 100%; /* Align it directly below the parent item */
    left: 0; /* Align to the left */
    background: rgba(255, 255, 255, 0.9); /* Match the navbar background */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1); /* Add shadow for depth */
    z-index: 1000; /* Ensure it appears above other content */
    padding: 0;
    margin: 0;
    border-radius: 4px; /* Optional: round the corners */
    list-style: none; /* Remove bullet points */
}

/* Dropdown items */
.dropdown li {
    width: 100%; /* Make dropdown items full width */
}

.dropdown a {
    display: block; /* Make links block elements */
    padding: 0.75rem 1.5rem; /* Add padding for dropdown items */
    color: var(--text-color); /* Use the same text color */
    font-weight: 500; /* Match font weight */
    text-decoration: none; /* Remove underline */
    transition: background 0.3s ease; /* Smooth background transition */
}

/* Show dropdown on hover */
.nav-links > li:hover .dropdown {
    display: block; /* Show dropdown on hover */
}

/* Change background color on hover */
.dropdown a:hover {
    background: var(--gradient); /* Change background on hover */
    color: white; /* Change text color on hover */
}

/* Header Styles */
header {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--white);
    position: relative;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    padding: 2rem 0;
    transition: opacity 0.3s ease, transform 0.3s ease; 
}

.profile-text {
    flex: 1;
}

.profile-image-container {
    flex: 1;
    position: relative;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.profile-image {
    width: 400px;
    height: 500px;
    object-fit: cover;
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.profile-image:hover {
    transform: translateY(-10px);
}

.profile-text h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.profile-text h2 {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 0;
}

/* Sections */
section {
    padding: 8rem 0;
    position: relative;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gradient);
}

/* Research Grid */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.research-item {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.research-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.research-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Publications */
/* Add these styles to your CSS file */
.publication-list {
    margin: 2rem 0;
    padding: 1rem;
}

.publication-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.publication-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.publication-year {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.publication-item h3 {
    margin: 0.5rem 0;
    color: #333;
}

.publication-item h3 a {
    color: #2c5282;
    text-decoration: none;
}

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

.publication-item .journal {
    color: #4a5568;
    font-weight: 500;
    margin: 0.5rem 0;
}

.publication-item .citation {
    color: #718096;
    font-size: 0.9rem;
    margin: 0.25rem 0;
    font-style: italic;
}

.abstract-toggle {
    background-color: #2c5282;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin: 0.5rem 0;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.abstract-toggle:hover {
    background-color: #2a4365;
}

.abstract {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f7fafc;
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4a5568;
}

/* Contact Section */
.contact-section {
    background: var(--light-bg);
    position: relative;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 4rem;
    align-items: center;
}

.contact-info {
    text-align: left;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.contact-links a {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    text-decoration: none;
    transition: transform 0.3s ease, background 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.contact-links a:hover {
    transform: translateY(-5px);
    background: var(--gradient);
    color: var(--white);
}

.cv-button {
    display: inline-block;
    margin-top: 2rem;
    padding: 1rem 2rem;
    background: var(--gradient);
    color: var(--white);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 500;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 20px rgba(108, 99, 255, 0.2);
}

.cv-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(108, 99, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.3s ease;
        gap: 2rem;
    }

    .nav-links.active {
        right: 0;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .header-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2rem;
    }

    .profile-image {
        width: 300px;
        height: 400px;
    }

    .profile-text h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding-top: 80px;
    }

    .profile-image {
        width: 280px;
        height: 350px;
    }

    .profile-text h1 {
        font-size: 2rem;
    }

    .profile-text h2 {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 2rem;
    }

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

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

.animate-fade-in {
    animation: fadeIn 1s ease forwards;
}

.scholar-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin: 2em 0;
}

.stat-box {
    text-align: center;
    padding: 1em;
    margin: 1em;
    background: #f5f5f5;
    border-radius: 8px;
    min-width: 150px;
}

.update-time {
    width: 100%;
    text-align: center;
    font-size: 0.8em;
    color: #666;
}

.experience-section {
    padding: 80px 2rem 0;
    max-width: 900px;
    margin: 0 auto;
}

.experience-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-left: 3px solid #2c3e50;
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.experience-item:hover {
    transform: translateX(5px);
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.company-info {
    flex: 1;
}

.company-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.job-title {
    font-size: 1.1rem;
    color: #34495e;
    font-weight: 500;
    margin-left: 40px;
}

.employment-period {
    color: #7f8c8d;
    font-size: 0.9rem;
    white-space: nowrap;
}

.job-description {
    color: #555;
    line-height: 1.6;
}

.responsibilities {
    margin-top: 1rem;
    padding-left: 1.2rem;
}

.responsibilities li {
    margin-bottom: 0.5rem;
    position: relative;
}

.responsibilities li::before {
    content: "•";
    color: #2c3e50;
    position: absolute;
    left: -1.2rem;
}

@media (max-width: 768px) {
    .experience-header {
        flex-direction: column;
    }
    
    .employment-period {
        margin-top: 0.5rem;
    }
}

.education-section {
    padding: 80px 2rem 0;
    max-width: 900px;
    margin: 0 auto;
}

.education-item {
    margin-bottom: 0;
    padding: 1.5rem;
    border-left: 3px solid #3498db; /* Different color from experience section */
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.education-item:hover {
    transform: translateX(5px);
}

.degree-header {
    margin-bottom: 0;
}

.degree-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 0;
}

.degree-subject {
    font-size: 1.1rem;
    color: #34495e;
    font-weight: 500;
    margin-bottom: 0;
}

.university-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0;
}

.university-name {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 0;
}

.graduation-year {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.advisor-info {
    color: #555;
    font-style: italic;
    margin-top: 0;
    margin-bottom: 0;
}

.advisor-label {
    font-weight: 500;
}

@media (max-width: 768px) {
    .university-info {
        flex-direction: column;
    }
    
    .graduation-year {
        margin-top: 0.25rem;
    }
}


/* Loading Spinner */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    color: #d32f2f;
    text-align: center;
    padding: 1rem;
    background-color: #ffebee;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    header {
        transform: none !important;
    }
    
    #back-to-top {
        transition: none !important;
    }
}

/* Print Styles */
@media print {
    nav, .contact-section, .cv-button, #back-to-top {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    .experience-section, .education-section {
        page-break-inside: avoid;
    }
    
    .experience-item, .education-item {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    a {
        text-decoration: none;
        color: #000;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}
