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

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --accent-color: #0ea5e9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --background-primary: #ffffff;
    --background-secondary: #f8fafc;
    --border-color: #e2e8f0;
    --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-large: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: #f8fafc;
    --footer-text: #1e293b;
    --footer-text-muted: #64748b;
    --footer-social-bg: rgba(30, 41, 59, 0.1);
    --footer-social-hover: #1e293b;
    --logo-bg: var(--background-secondary);
    --logo-filter: none;
}

/* Automatic dark mode based on system preference */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #3b82f6;
        --secondary-color: #9ca3af;
        --accent-color: #06b6d4;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-light: #94a3b8;
        --background-primary: #0f172a;
        --background-secondary: #1e293b;
        --border-color: #334155;
        --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
        --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
        --shadow-large: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
        --navbar-bg: rgba(15, 23, 42, 0.95);
        --footer-bg: #1e293b;
        --footer-text: #ffffff;
        --footer-text-muted: #cbd5e1;
        --footer-social-bg: rgba(255, 255, 255, 0.1);
        --footer-social-hover: #ffffff;
        --logo-bg: rgba(255, 255, 255, 0.95);
        --logo-filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-primary);
    scroll-behavior: smooth;
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--navbar-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.nav-logo a {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.nav-logo a:hover {
    color: var(--primary-color);
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 400;
    position: relative;
    transition: var(--transition);
}

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

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -0.5rem;
    left: 50%;
    background-color: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger .bar {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    margin: 3px 0;
    transition: var(--transition);
}

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

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

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

/* Removed theme toggle styles - using automatic system detection only */

/* Main Content */
.main-content {
    margin-top: 4rem;
}

.section {
    padding: 5rem 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.section:nth-child(even) {
    background-color: var(--background-secondary);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* Home Section */
.home-section {
    padding: 8rem 0 5rem;
    background: linear-gradient(135deg, var(--background-primary) 0%, var(--background-secondary) 100%);
}

.home-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.home-title {
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.home-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.4;
}

.home-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.home-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: 2px solid transparent;
    cursor: pointer;
    min-width: 140px;
}

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

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.home-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.profile-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 1rem;
    box-shadow: var(--shadow-large);
    transition: var(--transition);
}

.profile-image:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Education Section */
.education-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.education-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    padding: 2rem;
    background: var(--background-primary);
    border-radius: 1rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.education-item:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.education-year {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.125rem;
}

.education-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.university-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 0.75rem;
    background: var(--logo-bg);
    padding: 0.75rem;
    box-shadow: var(--shadow-light);
    filter: var(--logo-filter);
    transition: var(--transition);
}

.education-text {
    flex: 1;
}

.education-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.institution {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.description,
.advisor {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

/* Research Section */
.research-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
}

.research-interests h3,
.publications h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.interests-list {
    list-style: none;
}

.interests-list li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.interests-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.publication-item {
    margin-bottom: 2rem;
}

.publication-item h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.paper {
    padding: 1.5rem;
    background: var(--background-primary);
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-light);
}

.paper-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.paper-authors {
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.paper-venue,
.paper-status {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Experience Section */
.experience-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.experience-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    padding: 2rem;
    background: var(--background-primary);
    border-radius: 1rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.experience-item:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.experience-year {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.125rem;
}

.experience-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.company {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.company a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.company a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.company-description {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-style: italic;
    line-height: 1.4;
}

.company-description a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.company-description a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.responsibilities {
    list-style: none;
}

.responsibilities li {
    padding: 0.25rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.responsibilities li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.responsibilities li a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.responsibilities li a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Experience Header Styling */
.experience-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.experience-text {
    flex: 1;
}

.company-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 0.75rem;
    background: var(--logo-bg);
    padding: 0.75rem;
    box-shadow: var(--shadow-light);
    filter: var(--logo-filter);
    transition: var(--transition);
}

.company-logo:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.role-progression {
    margin-top: 1rem;
}

.role {
    margin-bottom: 2rem;
}

.role:last-child {
    margin-bottom: 0;
}

.role h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.role-dates {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-light);
    font-style: italic;
}

/* Teaching Section */
.teaching-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.teaching-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    padding: 2rem;
    background: var(--background-primary);
    border-radius: 1rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.teaching-item:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.teaching-year {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.125rem;
}

.teaching-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.teaching-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.teaching-text {
    flex: 1;
}

.course {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

/* Certificates Section */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.certificate-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    background: var(--background-primary);
    border-radius: 1rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.certificate-item:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.certificate-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.certificate-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.certificate-issuer {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.certificate-year {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* CV Section */
.cv-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.cv-preview p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.cv-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Footer */
.footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 0;
    margin-top: 5rem;
    transition: var(--transition);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.footer-info p {
    margin-bottom: 0.5rem;
    color: var(--footer-text-muted);
}

.footer-social {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--footer-text-muted);
    background-color: var(--footer-social-bg);
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
    padding: 10px;
}

.social-link:hover {
    color: var(--footer-social-hover);
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 4rem;
        flex-direction: column;
        background-color: var(--background-primary);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: var(--shadow-medium);
        padding: 2rem 0;
        gap: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    /* Removed mobile theme toggle styles - using automatic system detection only */

    .container {
        padding: 0 1rem;
    }

    .home-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .home-title {
        font-size: 2.5rem;
    }

    .home-subtitle {
        font-size: 1.25rem;
    }

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

    .education-item,
    .experience-item,
    .teaching-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .education-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .university-logo {
        width: 56px;
        height: 56px;
    }

    .role h4 {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .experience-header,
    .teaching-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .company-logo {
        width: 56px;
        height: 56px;
    }

    .research-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

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

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }

    .footer-social {
        justify-content: center;
    }

    .home-buttons {
        justify-content: center;
    }

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

    .btn {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 1rem;
    }

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

    .home-subtitle {
        font-size: 1.125rem;
    }

    .section {
        padding: 3rem 0;
    }

    .certificate-item {
        flex-direction: column;
        text-align: center;
    }
}

/* Smooth animations for scroll-triggered elements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

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

::-webkit-scrollbar-track {
    background: var(--background-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1d4ed8;
}