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

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --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);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Theme Variations */
[data-theme="dark"] {
    --primary-color: #3b82f6;
    --secondary-color: #2563eb;
    --accent-color: #60a5fa;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-light: #9ca3af;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-dark: #000000;
    --border-color: #374151;
}

[data-theme="green"] {
    --primary-color: #10b981;
    --secondary-color: #059669;
    --accent-color: #34d399;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f0fdf4;
    --bg-dark: #064e3b;
    --border-color: #d1fae5;
}

[data-theme="purple"] {
    --primary-color: #8b5cf6;
    --secondary-color: #7c3aed;
    --accent-color: #a78bfa;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #faf5ff;
    --bg-dark: #581c87;
    --border-color: #e9d5ff;
}

[data-theme="orange"] {
    --primary-color: #f97316;
    --secondary-color: #ea580c;
    --accent-color: #fb923c;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #fff7ed;
    --bg-dark: #9a3412;
    --border-color: #fed7aa;
}

[data-theme="cyberpunk"] {
    --primary-color: #ff0080;
    --secondary-color: #e6007a;
    --accent-color: #00ffff;
    --text-primary: #00ff00;
    --text-secondary: #ffff00;
    --text-light: #ff00ff;
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-dark: #1a0033;
    --border-color: #330066;
}

/* Theme Selector Styles */
.theme-selector {
    position: relative;
    margin-left: 1rem;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    font-size: 0.9rem;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.theme-toggle i:last-child {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.theme-toggle.active i:last-child {
    transform: rotate(180deg);
}

.theme-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: var(--shadow-xl);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

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

.theme-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
    margin: 0.25rem;
}

.theme-option:hover {
    background: var(--bg-secondary);
    transform: translateX(5px);
}

.theme-option.active {
    background: var(--primary-color);
    color: white;
}

.theme-preview {
    display: flex;
    gap: 0.25rem;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.theme-option span {
    font-weight: 500;
    font-size: 0.9rem;
}

html {
    scroll-behavior: smooth;
    /* Prevent horizontal scroll on mobile */
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-size: clamp(14px, 2.5vw, 16px);
    /* Prevent horizontal scroll on mobile */
    overflow-x: hidden;
    /* Improve text rendering on mobile */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo h2 {
    color: var(--primary-color);
    font-weight: 700;
    font-size: clamp(1.2rem, 3.5vw, 1.5rem);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.5rem 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
}

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

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

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.hamburger:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

.hamburger.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    min-height: 100svh;
    /* Use small viewport height for mobile */
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
    padding-top: 70px;
    /* Account for fixed navbar */
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="rgba(255,255,255,0.05)" points="0,1000 1000,0 1000,1000"/></svg>');
    background-size: cover;
}

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

.hero-content {
    display: flex;
    align-items: center;
    gap: 4rem;
    width: 100%;
    animation: fadeInUp 1s ease-out;
}

.hero-text {
    flex: 1;
    max-width: 600px;
}

.hero-avatar {
    flex: 0 0 300px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-image {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.avatar-image:hover {
    transform: scale(1.05);
}

.avatar-ring {
    position: absolute;
    width: 320px;
    height: 320px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0;
    }
}

.hero-title {
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #ffffff, #e0e7ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: #e0e7ff;
    min-height: 2rem;
    display: flex;
    align-items: center;
    gap: 0.1rem;
}

.typing-cursor {
    animation: blink 1s infinite;
    font-weight: 400;
    color: #a5b4fc;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.hero-description {
    font-size: clamp(1rem, 3vw, 1.1rem);
    margin-bottom: 2rem;
    color: #c7d2fe;
    line-height: 1.7;
}

.hero-quote {
    font-size: clamp(1rem, 3vw, 1.1rem);
    margin-bottom: 2.5rem;
    padding: 1rem 0;
    border-left: 3px solid #a5b4fc;
    padding-left: 1.5rem;
    color: #e0e7ff;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.btn {
    padding: clamp(0.6rem, 2vw, 0.75rem) clamp(1.5rem, 4vw, 2rem);
    border: none;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

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

.btn-primary:hover {
    background-color: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

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

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

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    min-width: 44px;
    min-height: 44px;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

/* Sections */
section {
    padding: clamp(3rem, 8vw, 5rem) 0;
}

.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    font-weight: 700;
    margin-bottom: clamp(2rem, 5vw, 3rem);
    color: var(--text-primary);
    position: relative;
}

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

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

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

.about-text {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    line-height: 1.8;
    color: var(--text-secondary);
}

.about-text p {
    margin-bottom: 1.5rem;
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.stat {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.stat:hover {
    transform: translateY(-5px);
}

.stat h3 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Experience Section */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--accent-color));
    border-radius: 1.5px;
}

.timeline-item {
    display: flex;
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item:nth-child(odd) {
    flex-direction: row;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-date {
    flex: 0 0 150px;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    height: fit-content;
    margin: 0 2rem;
    position: relative;
    z-index: 2;
}

.timeline-content {
    flex: 1;
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    margin: 0 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.timeline-content h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.timeline-content ul {
    list-style: none;
    padding-left: 0;
}

.timeline-content li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.timeline-content li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-size: 0.8rem;
}

/* Education Section */
.education {
    background-color: var(--bg-primary);
}

.education-timeline {
    max-width: 800px;
    margin: 0 auto;
}

.education-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 3rem;
    gap: 3rem;
}

.education-date {
    flex: 0 0 180px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
}

.education-content {
    flex: 1;
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid #10b981;
}

.education-content:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

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

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

.education-status {
    display: inline-block;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.education-content p:not(.education-status) {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
}

/* Projects Section */
.projects {
    background-color: var(--bg-secondary);
    position: relative;
    z-index: 1;
    clear: both;
    overflow: hidden;
    contain: layout style;
}

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

.project-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    will-change: transform;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.5s ease;
}

.project-card:hover::before {
    left: 100%;
}

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

.project-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

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

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

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: var(--secondary-color);
}

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

.skill-category {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.skill-category:hover {
    transform: translateY(-5px);
}

.skill-category h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    overflow-y: auto;
    flex: 1;
    padding-right: 0.5rem;
    align-content: flex-start;
}

.skills-list::-webkit-scrollbar {
    width: 6px;
}

.skills-list::-webkit-scrollbar-track {
    background: rgba(229, 231, 235, 0.5);
    border-radius: 3px;
}

.skills-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
    opacity: 0.7;
}

.skills-list::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.skill-tag {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    font-weight: 500;
    transition: transform 0.3s ease;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.skill-tag:hover {
    transform: scale(1.05);
}

/* Publications Section */
.publications {
    background-color: var(--bg-secondary);
}

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

.publication-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

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

.publication-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
    font-size: 1.5rem;
}

.publication-card h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.publication-status {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.publication-card p:not(.publication-status) {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Contact Section */
.contact {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1f2937 100%);
    color: white;
}

.contact .section-title {
    color: white;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.contact-info h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
}

.contact-info p {
    color: #d1d5db;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    color: #d1d5db;
}

.contact-item i {
    width: 20px;
    color: var(--accent-color);
}

.contact-item a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.contact-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(10px);
}

.contact-link i {
    font-size: 1.5rem;
    color: var(--accent-color);
}

/* Footer */
.footer {
    background-color: var(--bg-dark);
    color: #9ca3af;
    text-align: center;
    padding: 2rem 0;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .about-stats {
        flex-direction: row;
        justify-content: space-around;
        gap: 1rem;
    }

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

    .timeline::before {
        left: 40px;
    }

    .timeline-item {
        flex-direction: column !important;
        align-items: flex-start;
        padding-left: 90px;
    }

    .timeline-date {
        position: absolute;
        left: -70px;
        top: 0;
        margin: 0;
        width: 140px;
        font-size: 0.8rem;
    }

    .timeline-content {
        margin: 0;
        margin-top: 0.5rem;
    }

    .hero-content {
        flex-direction: column;
        gap: 3rem;
        text-align: center;
    }

    .hero-avatar {
        flex: none;
        order: 1;
    }

    .hero-text {
        order: 2;
        max-width: 100%;
    }

    .avatar-image {
        width: 250px;
        height: 250px;
    }

    .avatar-ring {
        width: 290px;
        height: 290px;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .theme-selector {
        margin-left: 0.5rem;
    }

    .theme-toggle span {
        display: none;
    }

    .theme-toggle {
        padding: 0.5rem;
        min-width: 44px;
        justify-content: center;
    }

    .theme-dropdown {
        right: -50px;
        min-width: 180px;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--bg-primary);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-md);
        padding: 2rem 0;
        z-index: 999;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

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

    .nav-menu li {
        margin: 0.5rem 0;
    }

    .nav-link {
        padding: 1rem 2rem;
        width: 100%;
        justify-content: center;
        border-radius: 0;
        transition: background-color 0.3s ease, color 0.3s ease;
    }

    .nav-link:hover {
        background-color: rgba(37, 99, 235, 0.1);
    }

    .hero-container {
        padding: 0 1rem;
    }

    .hero-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .hero-text {
        order: 2;
        max-width: 100%;
    }

    .hero-avatar {
        order: 1;
        flex: none;
        margin-bottom: 1rem;
    }

    .avatar-image {
        width: 200px;
        height: 200px;
    }

    .avatar-ring {
        width: 240px;
        height: 240px;
    }

    .hero-subtitle {
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    .typing-cursor {
        display: inline;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        width: 100%;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .social-links {
        justify-content: center;
        gap: 1.5rem;
        margin-top: 1rem;
    }

    .social-link {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .about-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        padding-left: 70px;
    }

    .timeline-date {
        left: -60px;
        width: 120px;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .timeline-content {
        padding: 1.5rem;
    }

    .education-item {
        flex-direction: column;
        gap: 1.5rem;
    }

    .education-date {
        flex: none;
        align-self: flex-start;
        width: 100%;
        max-width: 200px;
    }

    .education-content {
        padding: 1.5rem;
    }

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

    .project-card {
        padding: 2rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .skill-category {
        padding: 1.5rem;
        max-height: 350px;
    }

    .skills-list {
        max-height: 200px;
    }

    .publications-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .publication-card {
        padding: 2rem;
    }

    .contact-links {
        gap: 1.5rem;
    }

    .contact-link {
        padding: 1.2rem 1.5rem;
        font-size: 1.1rem;
    }
}

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

    .hero-container {
        padding: 0 1rem;
    }

    .hero-content {
        text-align: center;
        gap: 1.5rem;
    }

    .hero-subtitle {
        align-items: center;
    }

    .hero-buttons {
        align-items: center;
    }

    .avatar-image {
        width: 150px;
        height: 150px;
    }

    .avatar-ring {
        width: 180px;
        height: 180px;
    }

    .about-stats {
        gap: 1rem;
    }

    .stat {
        padding: 1.5rem 1rem;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        padding-left: 50px;
    }

    .timeline-date {
        left: -50px;
        width: 100px;
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    .timeline-content {
        padding: 1rem;
    }

    .education-content {
        padding: 1rem;
    }

    .project-card {
        padding: 1.5rem;
    }

    .skill-category {
        padding: 1rem;
        max-height: 300px;
    }

    .skills-list {
        max-height: 180px;
    }

    .publication-card {
        padding: 1.5rem;
    }

    .contact-info {
        text-align: center;
    }

    .contact-item {
        justify-content: center;
        font-size: 0.9rem;
    }

    .contact-link {
        padding: 1rem;
        font-size: 1rem;
        justify-content: center;
    }

    .hero-quote {
        text-align: center;
        border-left: none;
        border-top: 3px solid #a5b4fc;
        padding-left: 0;
        padding-top: 1rem;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .timeline::before {
        display: none;
    }

    .timeline-item {
        padding-left: 0;
    }

    .timeline-date {
        position: static;
        margin-bottom: 1rem;
        width: 100%;
    }

    .social-links {
        gap: 1rem;
    }

    .social-link {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* Improve touch targets and accessibility */
@media (hover: none) and (pointer: coarse) {
    .nav-link {
        min-height: 48px;
        padding: 1rem;
    }

    .btn {
        min-height: 48px;
        padding: 1rem 2rem;
    }

    .social-link {
        min-width: 48px;
        min-height: 48px;
    }

    .hamburger {
        min-width: 48px;
        min-height: 48px;
        padding: 1rem;
    }

    .skill-tag {
        min-height: 40px;
        padding: 0.75rem 1.5rem;
    }

    .project-link {
        min-height: 44px;
        padding: 0.75rem 1rem;
        display: inline-flex;
        align-items: center;
    }

    .contact-link {
        min-height: 48px;
    }
}

/* Focus styles for accessibility */
.nav-link:focus,
.btn:focus,
.social-link:focus,
.hamburger:focus,
.project-link:focus,
.contact-link:focus,
.contact-item a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Update hero section for dark theme compatibility */
.hero {
    background: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

[data-theme="cyberpunk"] .hero {
    background: linear-gradient(135deg, #1a0033 0%, #000000 50%, #0a0a0a 100%);
    position: relative;
}

[data-theme="cyberpunk"] .hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(255, 0, 128, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 0, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

/* Ensure proper contrast in dark theme */
[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

[data-theme="dark"] .navbar {
    background: rgba(17, 24, 39, 0.95);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .nav-menu {
    background-color: var(--bg-primary);
}

/* Dark theme card backgrounds */
[data-theme="dark"] .stat,
[data-theme="dark"] .timeline-content,
[data-theme="dark"] .education-content,
[data-theme="dark"] .project-card,
[data-theme="dark"] .skill-category,
[data-theme="dark"] .publication-card {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .theme-dropdown {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

/* Cyberpunk theme card backgrounds and effects */
[data-theme="cyberpunk"] .stat,
[data-theme="cyberpunk"] .timeline-content,
[data-theme="cyberpunk"] .education-content,
[data-theme="cyberpunk"] .project-card,
[data-theme="cyberpunk"] .skill-category,
[data-theme="cyberpunk"] .publication-card {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.1);
}

[data-theme="cyberpunk"] .theme-dropdown {
    background: var(--bg-secondary);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.2);
}

/* Cyberpunk special effects */
[data-theme="cyberpunk"] .hero-title {
    background: linear-gradient(45deg, #ff0080, #00ffff, #ffff00, #ff0080);
    background-size: 400% 400%;
    animation: cyberpunk-glow 3s ease-in-out infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(255, 0, 128, 0.5);
}

@keyframes cyberpunk-glow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

[data-theme="cyberpunk"] .skill-tag {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    box-shadow: 0 0 10px rgba(255, 0, 128, 0.3);
    border: 1px solid var(--accent-color);
}

[data-theme="cyberpunk"] .project-card:hover {
    box-shadow: 0 0 30px rgba(255, 0, 128, 0.3);
    transform: translateY(-10px);
}

[data-theme="cyberpunk"] .timeline-content h3,
[data-theme="cyberpunk"] .education-content h3,
[data-theme="cyberpunk"] .project-card h3,
[data-theme="cyberpunk"] .skill-category h3,
[data-theme="cyberpunk"] .publication-card h3 {
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

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