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

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-accent: #e3f2fd;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --accent-primary: #1976d2;
    --accent-secondary: #0d47a1;
    --border-color: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.1);
}

body.dark-mode {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-accent: #1a237e;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --accent-primary: #42a5f5;
    --accent-secondary: #1976d2;
    --border-color: #333333;
    --shadow: rgba(255, 255, 255, 0.05);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.3s ease;
}

nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 2px 10px var(--shadow);
}

@media (max-width: 768px) {
    nav {
        padding: 0.6rem 0;
    }
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.logo {
    grid-column: 1;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--accent-primary);
    cursor: pointer;
    transition: opacity 0.3s;
    text-decoration: none;
}

.logo:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    grid-column: 2;
    justify-self: center;
}

@media (max-width: 1024px) {
    .nav-links {
        gap: 1rem;
    }
    
    .nav-links a {
        font-size: 0.9rem;
    }
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
    white-space: nowrap;
    font-size: 0.95rem;
}

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

.controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
    grid-column: 3;
    justify-self: end;
}

.btn-control {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

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

.menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--text-primary);
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px;
}

.hero-content {
    max-width: 800px;
}

.hero-image {
    margin-bottom: 2rem;
}

.hero-image img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 20px;
    object-fit: contain;
    box-shadow: 0 10px 30px var(--shadow);
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.hero .subtitle {
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero .description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.hero .location {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 1.25rem;
}

.social-btn:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow);
}

.social-btn.linkedin { color: #0077b5; }
.social-btn.github { color: #333; }
body.dark-mode .social-btn.github { color: #fff; }
.social-btn.orcid { color: #a6ce39; }
.social-btn.researchgate { color: #00d0b1; }

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

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.cta-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow);
}

.cta-btn.secondary {
    background: transparent;
    color: var(--accent-primary);
    border: 2px solid var(--accent-primary);
}

.cta-btn.secondary:hover {
    background: var(--accent-primary);
    color: white;
}

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

.card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 10px var(--shadow);
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px var(--shadow);
}

.card h3 {
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.card h4 {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.card-meta {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.card p {
    color: var(--text-primary);
    line-height: 1.8;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.skill-category h3 {
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    background: var(--bg-accent);
    color: var(--accent-primary);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 0.75rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px var(--shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

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

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    min-width: 0;
}

.form-group select option {
    padding: 0.5rem;
    white-space: nowrap;
}

#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent-primary);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

#backToTop.visible {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--shadow);
}

footer {
    background: var(--bg-secondary);
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

footer p {
    margin: 0.25rem 0;
}

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

    .logo {
        font-size: 1.1rem;
    }
    
    .nav-links a {
        font-size: 0.85rem;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--bg-primary);
        flex-direction: column;
        padding: 2rem;
        gap: 2rem;
        transition: left 0.3s;
        border-right: 1px solid var(--border-color);
    }

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

    .nav-links a {
        font-size: 1.1rem;
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .menu-btn {
        display: block;
    }

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

    .hero .subtitle {
        font-size: 1.2rem;
    }

    .hero .description {
        font-size: 1rem;
    }

    section {
        padding: 3rem 1.5rem;
    }

    section h2 {
        font-size: 2rem;
    }

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

    .cta-buttons {
        justify-content: center;
    }
    
    .hero-image {
        margin-top: 0.5rem;
    }
    
    .hero-image img {
        max-width: 300px;
    }

    #backToTop {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}
