/* CSS Variables for Theming */
:root[data-theme="dark"] {
    --bg-primary: #0a0e27;
    --bg-secondary: #151932;
    --bg-card: #1a1f3a;
    --text-primary: #e0e6ed;
    --text-secondary: #a0aec0;
    --accent-primary: #00d4ff;
    --accent-secondary: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --ai-gradient: linear-gradient(135deg, #00d4ff 0%, #7c3aed 50%, #ec4899 100%);
    --shadow: rgba(0, 212, 255, 0.2);
    --card-hover: #222749;
}

:root[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-primary: #0ea5e9;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --ai-gradient: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 50%, #ec4899 100%);
    --shadow: rgba(14, 165, 233, 0.15);
    --card-hover: #f1f5f9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px var(--shadow);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
    transition: background 0.3s ease;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo {
    height: 50px;
    width: auto;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px var(--shadow);
}

.logo:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px var(--shadow);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:hover {
    color: var(--accent-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--ai-gradient);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-card);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(20deg);
    box-shadow: 0 0 20px var(--shadow);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.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(8px, -8px);
}

/* Hero Section */
.hero {
    background: var(--ai-gradient);
    color: white;
    padding: 150px 0 100px;
    margin-top: 60px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 212, 255, 0.03) 2px, rgba(0, 212, 255, 0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(124, 58, 237, 0.03) 2px, rgba(124, 58, 237, 0.03) 4px);
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.hero .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4rem;
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1;
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 20px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: white;
    color: var(--accent-secondary);
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.cta-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* Neural Network Animation */
.ai-animation {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.neural-network {
    position: relative;
    width: 400px;
    height: 400px;
}

/* Hero Logo in Center */
.hero-logo-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.hero-logo {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5), 
                0 0 60px rgba(124, 58, 237, 0.3);
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(0, 212, 255, 0.5), 
                    0 0 60px rgba(124, 58, 237, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 212, 255, 0.8), 
                    0 0 80px rgba(124, 58, 237, 0.5);
    }
}

.node {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    animation: pulse 2s ease-in-out infinite;
    z-index: 1;
}

.node:nth-child(2) {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0s;
}

.node:nth-child(3) {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    animation-delay: 0.5s;
}

.node:nth-child(4) {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    animation-delay: 1s;
}

.node:nth-child(5) {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 1.5s;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0);
    }
}

/* Services Section */
.services {
    padding: 80px 0;
    background: var(--bg-primary);
}

.services h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    background: var(--ai-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 25px var(--shadow);
    transition: all 0.3s;
    text-align: center;
    border: 1px solid rgba(0, 212, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--ai-gradient);
    opacity: 0;
    transition: opacity 0.3s;
}

.service-card:hover::before {
    opacity: 0.05;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px var(--shadow);
    border-color: var(--accent-primary);
    background: var(--card-hover);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

/* Experience Section */
.experience {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.experience h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    background: var(--ai-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timeline {
    max-width: 900px;
    margin: 0 auto;
}

.experience-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--accent-primary);
    box-shadow: 0 5px 25px var(--shadow);
    transition: all 0.3s;
}

.experience-card:hover {
    border-left-color: var(--accent-secondary);
    box-shadow: 0 10px 35px var(--shadow);
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.experience-card h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}

.experience-card h4 {
    font-size: 1.1rem;
    color: var(--accent-primary);
    font-weight: normal;
}

.date {
    color: var(--accent-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.experience-details {
    list-style: none;
    padding: 0;
}

.experience-details li {
    color: var(--text-secondary);
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.experience-details li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-size: 1.2rem;
}

/* Accordion Styles */
.accordion-item {
    overflow: hidden;
}

.accordion-header {
    transition: all 0.3s;
}

.accordion-header:hover {
    opacity: 0.8;
}

.accordion-toggle {
    background: var(--accent-primary);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: white;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.accordion-toggle:hover {
    background: var(--accent-secondary);
    transform: scale(1.1);
}

.accordion-icon {
    transition: transform 0.3s;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-item.active .accordion-content {
    margin-top: 1rem;
}

.accordion-item.active {
    border-left-color: var(--accent-secondary);
}

/* Open Source */
.opensource {
    max-width: 900px;
    margin: 3rem auto 0;
}

.opensource h3 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.opensource-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 15px;
    border-left: 4px solid var(--accent-secondary);
    box-shadow: 0 5px 25px var(--shadow);
}

.opensource-card h4 {
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.opensource-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 0.5rem;
}

.opensource-card a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.opensource-card a:hover {
    color: var(--accent-secondary);
}

/* Publications Section */
.publications {
    padding: 80px 0;
    background: var(--bg-primary);
}

.publications h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    background: var(--ai-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.publications-grid {
    display: grid;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.publication-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 15px;
    border-left: 4px solid var(--accent-secondary);
    box-shadow: 0 5px 25px var(--shadow);
    transition: all 0.3s;
    position: relative;
}

.publication-card:hover {
    box-shadow: 0 10px 35px var(--shadow);
    border-left-color: var(--accent-primary);
}

.publication-header {
    position: relative;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.publication-header .accordion-toggle {
    position: absolute;
    top: 0;
    right: 0;
}

.publication-header h4 {
    flex: 1;
    margin-right: 40px;
}

.pub-year {
    background: var(--ai-gradient);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.publication-card h4 {
    color: var(--text-primary);
    font-size: 1.2rem;
    margin-bottom: 0;
    line-height: 1.5;
}

.publication-content {
    margin-top: 0;
}

.publication-item.active .publication-content {
    margin-top: 1rem;
}

.authors {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.authors strong {
    color: var(--accent-primary);
}

.journal {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.doi {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.doi a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.doi a:hover {
    color: var(--accent-secondary);
}

.status {
    display: inline-block;
    background: rgba(124, 58, 237, 0.1);
    color: var(--accent-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Contact Section */
.contact {
    padding: 80px 0;
    background: var(--bg-secondary);
}

.contact h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.contact-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid rgba(0, 212, 255, 0.1);
    transition: all 0.3s;
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
    border-color: var(--accent-primary);
}

.contact-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.contact-item p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Social Media */
.social-media {
    text-align: center;
    margin-top: 3rem;
}

.social-media h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.social-link {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.social-link:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 30px var(--shadow);
}

.social-link.facebook:hover {
    background: #1877f2;
    color: white;
    border-color: #1877f2;
    box-shadow: 0 10px 30px rgba(24, 119, 242, 0.4);
}

.social-link.twitter:hover {
    background: #000000;
    color: white;
    border-color: #000000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.social-link.instagram:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
    border-color: #e6683c;
    box-shadow: 0 10px 30px rgba(225, 48, 108, 0.4);
}

.social-link.linkedin:hover {
    background: #0077b5;
    color: white;
    border-color: #0077b5;
    box-shadow: 0 10px 30px rgba(0, 119, 181, 0.4);
}

.social-link.github:hover {
    background: #333333;
    color: white;
    border-color: #333333;
    box-shadow: 0 10px 30px rgba(51, 51, 51, 0.4);
}

.social-link.scholar:hover {
    background: #4285f4;
    color: white;
    border-color: #4285f4;
    box-shadow: 0 10px 30px rgba(66, 133, 244, 0.4);
}

.social-link svg {
    width: 24px;
    height: 24px;
}

/* Footer */
footer {
    background: var(--bg-card);
    color: var(--text-primary);
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid rgba(0, 212, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Hamburger Menu */
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 60px;
        right: -100%;
        flex-direction: column;
        background: var(--bg-secondary);
        width: 70%;
        max-width: 300px;
        height: calc(100vh - 60px);
        padding: 2rem 0;
        gap: 0;
        border-left: 1px solid rgba(0, 212, 255, 0.1);
        box-shadow: -5px 0 20px var(--shadow);
        transition: right 0.3s ease;
        overflow-y: auto;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
        padding: 1rem 0;
        border-bottom: 1px solid rgba(0, 212, 255, 0.1);
    }
    
    .nav-links a {
        display: block;
        padding: 0.5rem 2rem;
    }
    
    .nav-links a::after {
        display: none;
    }
    
    .theme-toggle {
        width: 35px;
        height: 35px;
        margin: 1rem auto;
    }
    
    .hero .container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .ai-animation {
        margin-top: 2rem;
    }
    
    .neural-network {
        width: 280px;
        height: 280px;
    }
    
    .hero-logo {
        width: 150px;
        height: 150px;
        border-width: 4px;
    }
    
    .node {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .experience-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .experience-card {
        padding: 1.5rem;
    }
    
    .publication-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .publication-header .accordion-toggle {
        position: static;
    }
    
    .publication-header h4 {
        margin-right: 0;
    }
    
    .pub-year {
        margin-bottom: 0.5rem;
    }
    
    .contact-info {
        flex-direction: column;
        gap: 2rem;
    }
    
    .social-links {
        gap: 1rem;
    }
    
    .social-link {
        width: 45px;
        height: 45px;
    }
}
