/* CSS Variables for Theme */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --card-bg: rgba(255, 255, 255, 0.12);
    --card-border: rgba(255, 255, 255, 0.18);
    --backdrop-blur: blur(12px);
    --shadow: rgba(0, 0, 0, 0.15);
    --gradient-accent: linear-gradient(135deg, #4f46e5, #9333ea);
}

[data-theme="light"] {
    --primary-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(45, 55, 72, 0.08);
    --shadow: rgba(45, 55, 72, 0.12);
    --gradient-accent: linear-gradient(135deg, #4f46e5, #7c3aed);
}

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

body {
    font-family: 'Inter', 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--primary-gradient);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: all 0.3s ease;
    font-feature-settings: 'cv11', 'ss01';
    font-optical-sizing: auto;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: var(--backdrop-blur);
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px var(--shadow);
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 4rem 0;
    margin-bottom: 3rem;
}

.hero-content {
    backdrop-filter: var(--backdrop-blur);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 2rem;
    padding: 3rem 2rem;
    box-shadow: 0 8px 32px var(--shadow);
    transition: all 0.3s ease;
}

.avatar {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    border-radius: 50%;
    backdrop-filter: var(--backdrop-blur);
    box-shadow: 0 8px 32px var(--shadow);
    transition: all 0.3s ease;
}

.name {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #4f46e5, #9333ea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .name {
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.intro {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

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

.tag {
    background: rgba(79, 70, 229, 0.2);
    border: 1px solid rgba(79, 70, 229, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

/* Section Styling */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

section {
    margin-bottom: 4rem;
    backdrop-filter: var(--backdrop-blur);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 8px 32px var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    pointer-events: none;
}

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

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

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

.skill-item {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.15), rgba(79, 70, 229, 0.15));
    border: 1px solid rgba(147, 51, 234, 0.25);
    padding: 0.6rem 1.2rem;
    border-radius: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.skill-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.skill-item:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px var(--shadow);
    border-color: rgba(147, 51, 234, 0.4);
}

.skill-item:hover::before {
    left: 100%;
}

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

.project-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 2rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
    border-color: rgba(79, 70, 229, 0.3);
}

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

.project-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.project-link {
    color: var(--text-secondary);
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.project-link:hover {
    color: #4f46e5;
    transform: scale(1.1);
    box-shadow: 0 4px 15px var(--shadow);
    border-color: rgba(79, 70, 229, 0.3);
    background: var(--card-bg);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(147, 51, 234, 0.15));
    border: 1px solid rgba(79, 70, 229, 0.25);
    padding: 0.4rem 0.9rem;
    border-radius: 1.2rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tech-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.tech-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--shadow);
    border-color: rgba(79, 70, 229, 0.4);
}

.tech-tag:hover::before {
    left: 100%;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.contact-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow);
    border-color: rgba(79, 70, 229, 0.3);
}

.contact-item span:first-child,
.section-title span:first-child {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .hero-content {
        padding: 2rem 1.5rem;
    }
    
    .name {
        font-size: 2.5rem;
    }
    
    .intro {
        font-size: 1.1rem;
    }
    
    .tags {
        justify-content: center;
    }
    
    .tag {
        font-size: 0.8rem;
    }
    
    section {
        padding: 2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .hero-content {
        padding: 1.5rem 1rem;
    }
    
    .avatar {
        width: 80px;
        height: 80px;
        font-size: 3rem;
        margin-bottom: 1rem;
    }
    
    .name {
        font-size: 2rem;
    }
    
    .intro {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .tags {
        gap: 0.5rem;
    }
    
    .tag {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    section {
        padding: 1.5rem;
        margin-bottom: 3rem;
    }
    
    .section-title {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .project-card {
        padding: 1.5rem;
    }
    
    .project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .project-header h3 {
        font-size: 1.1rem;
    }
    
    .project-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .contact-item {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .footer {
        padding: 1.5rem;
        font-size: 0.8rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Animation for theme transition */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Keyframe animations for enhanced micro-interactions */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.avatar:hover {
    animation: pulse 2s ease-in-out infinite;
}

/* Add loading animation class */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Enhanced project card animations */
.project-card {
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px var(--shadow);
    border-color: rgba(79, 70, 229, 0.4);
}

/* Enhanced contact item animations */
.contact-item {
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.contact-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 24px var(--shadow);
    border-color: rgba(79, 70, 229, 0.4);
}

/* Smooth focus states for accessibility */
*:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
    border-radius: 4px;
}