:root {
    /* Light Mode Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #4a5568;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --border-color: #cbd5e1;
    --shadow: rgba(0, 0, 0, 0.15);
    --card-bg: #ffffff;
    --neural-node: rgba(59, 130, 246, 0.8);
    --neural-line: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --border-color: #334155;
    --shadow: rgba(0, 0, 0, 0.5);
    --card-bg: #1e293b;
    --neural-node: rgba(96, 165, 250, 0.8);
    --neural-line: rgba(96, 165, 250, 0.25);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Neural Network Canvas */
#neural-network {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.5;
}

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

/* Header */
#header {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

[data-theme="dark"] #header {
    background: rgba(15, 23, 42, 0.9);
}

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

.logo img {
    height: 40px;
    width: auto;
}

.logo-light {
    display: none;
}

[data-theme="dark"] .logo-dark {
    display: none;
}

[data-theme="dark"] .logo-light {
    display: block;
}

/* Add light outline to portfolio logo only in dark mode */
[data-theme="dark"] .logo img {
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.9)) 
            drop-shadow(0 0 2px rgba(255, 255, 255, 0.8)) 
            drop-shadow(0 0 3px rgba(255, 255, 255, 0.6));
}

/* Light background for company/university logos in dark mode */
[data-theme="dark"] .company-logo,
[data-theme="dark"] .university-logo {
    background: rgba(255, 255, 255);
    backdrop-filter: blur(10px);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

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

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

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

.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    transform: rotate(20deg);
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

/* Intro Section */
.intro-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 4rem;
}

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

.greeting {
    display: block;
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
    animation: fadeInUp 0.6s ease;
}

.name {
    display: block;
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.intro-subtitle {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease 0.4s both;
}

.intro-summary {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease 0.6s both;
}

.intro-cta {
    display: flex;
    gap: 1rem;
    animation: fadeInUp 0.6s ease 0.8s both;
}

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

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px var(--shadow);
}

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

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

.avatar-wrapper {
    animation: fadeInRight 0.8s ease;
}

.avatar-placeholder {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    animation: float 3s ease-in-out infinite;
}

.avatar-image {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    box-shadow: 0 10px 30px var(--shadow);
    animation: float 3s ease-in-out infinite;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

/* Section Title */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #8b5cf6);
    border-radius: 2px;
}

/* Skills Section */
.skills-section {
    padding: 6rem 0;
    background: var(--bg-secondary);
}

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

.skill-category {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow);
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px var(--shadow);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

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

.skill-category ul {
    list-style: none;
}

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

.skill-category li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* Projects Section */
.projects-section {
    padding: 6rem 0;
}

.projects-carousel {
    position: relative;
    margin-top: 3rem;
}

.carousel-container {
    overflow: hidden;
    padding: 1rem 0;
}

.carousel-track {
    display: flex;
    gap: 2rem;
    transition: transform 0.5s ease;
}

.project-card {
    flex: 0 0 calc(50% - 1rem);
    background: var(--card-bg);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow);
}

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

.project-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.project-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-content {
    padding: 2rem;
}

.project-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tags span {
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

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

.carousel-btn.prev {
    left: -25px;
}

.carousel-btn.next {
    right: -25px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--primary-color);
    width: 30px;
    border-radius: 6px;
}

/* Experience Section */
.experience-section {
    padding: 6rem 0;
    background: var(--bg-secondary);
}

.experience-timeline {
    max-width: 900px;
    margin: 0 auto;
}

.experience-item {
    background: var(--card-bg);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow);
}

.experience-item:hover {
    box-shadow: 0 10px 30px var(--shadow);
}

.experience-header {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 1.5rem;
    align-items: center;
    cursor: pointer;
}

.company-logo {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    transition: background 0.3s ease;
}

.company-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
}

.experience-title-block h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.company-name {
    font-size: 1.125rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.experience-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.expand-btn {
    background: none;
    border: 2px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.expand-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.expand-btn svg {
    transition: transform 0.3s ease;
}

.experience-item.expanded .expand-btn svg {
    transform: rotate(180deg);
}

.experience-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    margin-top: 0;
}

.experience-item.expanded .experience-details {
    max-height: 1000px;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.experience-details ul {
    list-style: none;
}

.experience-details li {
    padding: 0.75rem 0;
    color: var(--text-secondary);
    line-height: 1.8;
    position: relative;
    padding-left: 2rem;
}

.experience-details li::before {
    content: '▹';
    position: absolute;
    left: 0.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Education Section */
.education-section {
    padding: 6rem 0;
}

.education-card {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 2rem;
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow);
}

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

.university-logo {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    transition: background 0.3s ease;
}

.university-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
}

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

.university-name {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.education-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Contact Section */
.contact-section {
    padding: 6rem 0;
    background: var(--bg-secondary);
}

.contact-intro {
    text-align: center;
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.contact-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    color: var(--text-primary);
    box-shadow: 0 2px 8px var(--shadow);
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px var(--shadow);
    border-color: var(--primary-color);
}

.contact-icon {
    display: inline-flex;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-secondary);
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.contact-card:hover .contact-icon {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.contact-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.contact-card p {
    color: var(--text-secondary);
    font-size: 1rem;
}

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

.footer-location {
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--primary-hover);
    transform: translateY(-5px);
}

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Responsive */
@media (max-width: 968px) {
    .intro-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .avatar-wrapper {
        order: -1;
    }
    
    .intro-cta {
        justify-content: center;
    }
    
    .nav-links {
        display: none;
    }
    
    .name {
        font-size: 3rem;
    }
    
    .project-card {
        flex: 0 0 100%;
    }
    
    .experience-header {
        grid-template-columns: 60px 1fr auto;
    }
    
    .company-logo {
        width: 60px;
        height: 60px;
    }
    
    .education-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .university-logo {
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }
    
    .name {
        font-size: 2.5rem;
    }
    
    .intro-subtitle {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .intro-cta {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .carousel-btn {
        display: none;
    }
}
