/* CSS Variables & Reset */
:root {
    /* Primary Colors - Vibrant Academic Palette */
    --primary-hue: 220;
    --primary-sat: 90%;
    --primary-light: 40%;

    --color-primary: hsl(var(--primary-hue), var(--primary-sat), var(--primary-light));
    --color-primary-dark: hsl(var(--primary-hue), var(--primary-sat), 30%);
    --color-primary-light: hsl(var(--primary-hue), 80%, 96%);

    --color-accent: hsl(190, 85%, 45%);
    --color-accent-2: hsl(280, 70%, 55%);
    --color-gradient-1: linear-gradient(135deg, hsl(220, 90%, 50%), hsl(190, 85%, 50%));
    --color-gradient-2: linear-gradient(135deg, hsl(280, 70%, 55%), hsl(320, 80%, 60%));

    /* Neutral Colors */
    --color-bg: #ffffff;
    --color-bg-alt: #f8fafc;
    --color-surface: #ffffff;
    --color-text-main: #0f172a;
    --color-text-muted: #475569;
    --color-border: #e2e8f0;

    /* Shadows */
    --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-glow: 0 0 20px rgba(59, 130, 246, 0.3);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease-in-out;
}

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

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--color-text-main);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.nav-brand {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-primary);
}

.brand-title {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

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

.nav-links button {
    font-weight: 500;
    color: var(--color-text-muted);
    font-size: 0.95rem;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s;
}

.nav-links button:hover,
.nav-links li.active button {
    color: var(--color-primary);
}

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

.nav-links button:hover::after,
.nav-links li.active button::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    color: var(--color-text-main);
}

/* Main Content */
main {
    flex: 1;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem 5%;
}

/* Tab Animation System */
.tab-content {
    display: none;
    /* Hidden by default */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.5s forwards;
}

.indented {
  padding-left: 40px;  /* controls indentation */
}

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

/* Hero Section */
.hero-section {
    display: flex;
    align-items: center;
    gap: 4rem;
    margin-bottom: 4rem;
    min-height: 60vh;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -2rem;
    left: -5%;
    right: -5%;
    bottom: -2rem;
    background: url('../images/hero-bg.png') center/cover no-repeat;
    opacity: 0.03;
    z-index: -1;
    border-radius: 24px;
}

.profile-image-wrapper {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--color-bg);
    box-shadow: 0 0 0 4px var(--color-border), 0 20px 40px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

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

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: white;
}

.hero-text h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.highlight {
    color: var(--color-primary);
    position: relative;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 12px;
    background-color: var(--color-accent);
    opacity: 0.2;
    z-index: -1;
    border-radius: 4px;
}

.tagline {
    font-size: 1.5rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.bio-summary {
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition-normal);
    text-align: center;
}

.btn.primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.1);
}

.btn.primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

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

.btn.secondary:hover {
    border-color: var(--color-text-main);
    background-color: var(--color-bg-alt);
}

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

.social-links-hero a {
    font-size: 1.5rem;
    color: var(--color-text-muted);
}

.social-links-hero a:hover {
    color: var(--color-primary);
    transform: scale(1.1);
}

/* Sections General */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

/* Cards & Grid */
.focus-grid,
.projects-grid,
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card,
.focus-card,
.project-card,
.team-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 2rem;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.focus-card {
    text-align: center;
}

.focus-card:hover,
.project-card:hover,
.team-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.focus-card i {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 1.5rem;
    background: var(--color-gradient-1);
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin-inline: auto;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.focus-card:hover i {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.focus-card:nth-child(2) i {
    background: var(--color-gradient-2);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2);
}

.focus-card:nth-child(2):hover i {
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
}

/* Research Specific */
.research-statement {
    margin-bottom: 3rem;
    background-color: var(--color-bg-alt);
    border: none;
}

.project-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--color-primary-light);
    color: var(--color-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.project-card h3 {
    margin-bottom: 1rem;
    padding-right: 2rem;
}

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

.tags span {
    background: var(--color-bg-alt);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Publications */
.pub-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    background: white;
    transition: var(--transition-fast);
}

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

.publications-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.pub-item {
    display: flex;
    gap: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    transition: var(--transition-fast);
}

.pub-item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.pub-year {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-muted);
    opacity: 0.5;
    min-width: 60px;
}

.pub-content {
    flex: 1;
}

.pub-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.pub-authors {
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.pub-venue {
    font-style: italic;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

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

.pub-link {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

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

.pub-abstract,
.pub-cite {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--color-bg-alt);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.pub-cite pre {
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'Courier New', Courier, monospace;
}

.pub-cite code {
    display: block;
}

.pub-abstract.hidden,
.pub-cite.hidden {
    display: none;
}

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

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

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 4px solid white;
    box-shadow: 0 0 0 1px var(--color-border);
}

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

/* Team */
.team-category {
    margin-bottom: 4rem;
}

.team-category h3 {
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-bg-alt);
    display: inline-block;
}

.team-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

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

.info-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-item i {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-top: 0.25rem;
}

.social-links-large {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 3rem;
}

.social-btn {
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: var(--transition-fast);
}

.social-btn:hover {
    background: var(--color-bg-alt);
    border-color: var(--color-text-main);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: inherit;
    transition: var(--transition-fast);
}

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

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--color-bg-alt);
}

/* Updates Section */
.updates-section {
    margin-top: 4rem;
    padding: 2rem;
    background: var(--color-bg-alt);
    border-radius: 16px;
    border: 1px solid var(--color-border);
}

.updates-section h2 {
    margin-bottom: 2rem;
    text-align: center;
}

.updates-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hidden-update {
    display: none !important;
}

.updates-toggle-container {
    text-align: center;
    margin-top: 2rem;
}

.btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.updates-list li {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.updates-list li:last-child {
    border-bottom: none;
}

.update-date {
    font-weight: 700;
    color: var(--color-primary);
    min-width: 100px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.update-text {
    color: var(--color-text-main);
    font-size: 1rem;
}

/* Experience Subsections */
.experience-subsections {
    display: flex;
    flex-direction: column;
    gap: 5rem;
}

.exp-group h3 {
    font-size: 1.75rem;
    margin-bottom: 2.5rem;
    color: var(--color-primary);
    position: relative;
    display: inline-block;
}

.exp-group h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--color-gradient-1);
    border-radius: 2px;
}

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

.teaching-card h4 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.semester {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 900px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .hero-actions,
    .social-links-hero {
        justify-content: center;
    }

    .contact-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Hide for now, straightforward mobile handling in JS needed to toggle */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-md);
        gap: 1rem;
    }

    .nav-links.mobile-open {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .updates-list li {
        flex-direction: column;
        gap: 0.5rem;
    }

    .update-date {
        min-width: auto;
    }
}