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

:root {
    /* Light theme colors */
    --primary: #2563eb;
    --primary-foreground: #ffffff;
    --secondary: #f1f5f9;
    --secondary-foreground: #0f172a;
    --background: #ffffff;
    --foreground: #0f172a;
    --muted: #f8fafc;
    --muted-foreground: #64748b;
    --border: #e2e8f0;
    --card: #ffffff;
    --card-foreground: #0f172a;
    --accent: #f1f5f9;
    --accent-foreground: #0f172a;
    
    /* Spacing */
    --container-padding: 1rem;
    --section-padding: 5rem 0;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    --font-size-6xl: 3.75rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Border radius */
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Transitions */
    --transition: all 0.2s ease-in-out;
    --transition-slow: all 0.3s ease-in-out;
}

/* Dark theme */
[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-foreground: #ffffff;
    --secondary: #1e293b;
    --secondary-foreground: #f8fafc;
    --background: #0f172a;
    --foreground: #f8fafc;
    --muted: #1e293b;
    --muted-foreground: #94a3b8;
    --border: #334155;
    --card: #1e293b;
    --card-foreground: #f8fafc;
    --accent: #334155;
    --accent-foreground: #f8fafc;
}

/* Alternative dark class for compatibility */
.dark {
    --primary: #3b82f6;
    --primary-foreground: #ffffff;
    --secondary: #1e293b;
    --secondary-foreground: #f8fafc;
    --background: #0f172a;
    --foreground: #f8fafc;
    --muted: #1e293b;
    --muted-foreground: #94a3b8;
    --border: #334155;
    --card: #1e293b;
    --card-foreground: #f8fafc;
    --accent: #334155;
    --accent-foreground: #f8fafc;
}

body {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    transition: var(--transition);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.header.scrolled {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

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

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--foreground);
    text-decoration: none;
    transition: var(--transition);
}

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

.nav-brand i {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--muted-foreground);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-size-sm);
    border-radius: var(--radius);
    transition: var(--transition);
}

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

.nav-link i {
    width: 1rem;
    height: 1rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle {
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--background);
    color: var(--foreground);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: var(--accent);
}

.theme-toggle i {
    width: 1rem;
    height: 1rem;
    transition: var(--transition);
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

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

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

.nav-toggle {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: none;
    color: var(--foreground);
    cursor: pointer;
}

.nav-toggle i {
    width: 1.25rem;
    height: 1.25rem;
}

/* Page Section */
.page-section {
    padding-top: 8rem;
    padding-bottom: 4rem;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 6rem 0 4rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary)/5 0%, var(--background) 100%);
    z-index: 1;
}

#vortex-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: block;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: var(--font-size-5xl);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    color: var(--muted-foreground);
    margin-bottom: 2rem;
}

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

.hero-image {
    display: flex;
    justify-content: center;
}

.hero-avatar {
    position: relative;
    width: 20rem;
    height: 20rem;
    border-radius: 50%;
    overflow: hidden;
    border: 8px solid var(--card);
    box-shadow: var(--shadow-lg);
}

.hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn i {
    width: 1rem;
    height: 1rem;
}

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

.btn-primary:hover {
    background-color: var(--primary);
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--background);
    color: var(--foreground);
    border: 1px solid var(--border);
}

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

.btn-outline {
    background-color: transparent;
    color: var(--foreground);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background-color: var(--accent);
}

/* Sections */
section {
    padding: var(--section-padding);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h1,
.section-header h2 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: var(--font-size-lg);
    color: var(--muted-foreground);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* About Section */
.about {
    background-color: var(--muted);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text h3 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin-bottom: 1rem;
}

.about-text p {
    color: var(--muted-foreground);
    margin-bottom: 2rem;
}

.skills h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 1rem;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    padding: 0.5rem 1rem;
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.about-card .card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.about-card h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.timeline-item {
    margin-bottom: 1.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item h5 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline-item p {
    color: var(--muted-foreground);
    font-size: var(--font-size-sm);
}

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

.project-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition-slow);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-content p {
    color: var(--muted-foreground);
    margin-bottom: 1rem;
    line-height: 1.5;
}

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

.tag {
    padding: 0.25rem 0.75rem;
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    border-radius: var(--radius);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

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

/* CV Section */
.cv {
    background-color: var(--muted);
}

.cv-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
}

.cv-sidebar .card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.profile {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.profile h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.profile p {
    color: var(--muted-foreground);
}

.cv-section {
    margin-bottom: 2rem;
}

.cv-section:last-child {
    margin-bottom: 0;
}

.cv-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 1rem;
}

.cv-section i {
    width: 1rem;
    height: 1rem;
    color: var(--primary);
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skills-list span {
    padding: 0.25rem 0.75rem;
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    border-radius: var(--radius);
    font-size: var(--font-size-xs);
}

.languages {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.language {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.language span:last-child {
    color: var(--muted-foreground);
    font-size: var(--font-size-sm);
}

.cv-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.cv-main .card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.cv-main h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.cv-main h3 i {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--primary);
}

.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border);
}

.timeline .timeline-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 2rem;
}

.timeline .timeline-item::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0.5rem;
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
}

.timeline .timeline-item:last-child {
    margin-bottom: 0;
}

.timeline .timeline-item h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline .timeline-item p {
    color: var(--muted-foreground);
    margin-bottom: 0.25rem;
}

.timeline .timeline-item .date {
    color: var(--muted-foreground);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.timeline .timeline-item .description {
    margin-top: 0.5rem;
    line-height: 1.5;
}

.publication h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.publication p {
    color: var(--muted-foreground);
    margin-bottom: 0.25rem;
}

.publication .authors {
    font-style: italic;
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-item i {
    width: 2rem;
    height: 2rem;
    color: var(--primary);
    flex-shrink: 0;
}

.contact-item h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.contact-item p,
.contact-item a {
    color: var(--muted-foreground);
    text-decoration: none;
}

.contact-item a:hover {
    color: var(--primary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--foreground);
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--background);
    color: var(--foreground);
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary)/10;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Footer */
.footer {
    background-color: var(--card);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-section p {
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--accent);
    color: var(--accent-foreground);
    border-radius: var(--radius);
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.social-links i {
    width: 1.25rem;
    height: 1.25rem;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-nav a {
    color: var(--muted-foreground);
    text-decoration: none;
    transition: var(--transition);
}

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

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-bottom p {
    color: var(--muted-foreground);
    font-size: var(--font-size-sm);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 4rem;
        left: 0;
        right: 0;
        background-color: var(--background);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem;
        gap: 0.5rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-toggle {
        display: block;
    }

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

    .hero-title {
        font-size: var(--font-size-4xl);
    }

    .hero-avatar {
        width: 16rem;
        height: 16rem;
    }

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

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

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

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

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

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

    .section-header {
        margin-bottom: 2rem;
    }

    .section-header h1,
    .section-header h2 {
        font-size: var(--font-size-2xl);
    }
}

@media (max-width: 480px) {
    :root {
        --container-padding: 0.75rem;
        --section-padding: 3rem 0;
    }

    .hero {
        padding: 5rem 0 3rem;
    }

    .hero-title {
        font-size: var(--font-size-3xl);
    }

    .hero-avatar {
        width: 12rem;
        height: 12rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: var(--font-size-sm);
    }

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

    .project-card {
        margin: 0 -0.5rem;
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn:focus,
.nav-link:focus,
.theme-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary)/30;
}

/* Print styles */
@media print {
    .header,
    .nav-toggle,
    .theme-toggle,
    .footer {
        display: none;
    }
    
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }
    
    section {
        padding: 2rem 0;
        break-inside: avoid;
    }
    
    .project-card,
    .card {
        break-inside: avoid;
    }
}