/* ==========================================================================
   Base Styles and Variables
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;1,600&display=swap');

:root {
    /* Color Palette - Premium Dark Theme as base */
    --color-bg: #0f172a; /* Slate 900 */
    --color-surface: #1e293b; /* Slate 800 */
    --color-surface-hover: #334155; /* Slate 700 */
    --color-primary: #3b82f6; /* Blue 500 */
    --color-primary-hover: #2563eb; /* Blue 600 */
    --color-secondary: #8b5cf6; /* Violet 500 */
    --color-accent: #f59e0b; /* Amber 500 */
    --color-text: #f8fafc; /* Slate 50 */
    --color-text-muted: #94a3b8; /* Slate 400 */
    --color-border: rgba(255, 255, 255, 0.1);
    
    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    --space-6: 3rem;
    --space-8: 4rem;
    --space-12: 6rem;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Effects */
    --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.5);
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
}

/* Light Theme Variables */
[data-theme="light"] {
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-surface-hover: #f1f5f9;
    --color-text: #0f172a;
    --color-text-muted: #475569;
    --color-border: rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    transition: background-color var(--transition-base), color var(--transition-base);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--space-3);
    color: var(--color-text);
}

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

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* ==========================================================================
   Layout & Container
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.section {
    padding: var(--space-12) 0;
}

/* ==========================================================================
   Glassmorphism Utilities
   ========================================================================== */
.glass {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
}

[data-theme="light"] .glass {
    background: rgba(255, 255, 255, 0.7);
}

.glass-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: var(--space-3) 0;
    transition: padding var(--transition-base), background var(--transition-base);
}

.navbar.scrolled {
    padding: var(--space-2) 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
}

[data-theme="light"] .navbar.scrolled {
    background: rgba(248, 250, 252, 0.85);
}

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

.brand {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.brand-dot {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    display: inline-block;
}

.nav-links {
    display: flex;
    gap: var(--space-5);
    align-items: center;
}

.nav-link {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    padding-bottom: var(--space-1);
}

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

.nav-link:hover, .nav-link.active {
    color: var(--color-text);
}

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

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2) 0;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 1000;
}

[data-theme="dark"] .dropdown-menu {
    background: rgba(15, 23, 42, 0.95);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    display: block;
    padding: var(--space-2) var(--space-4);
    color: var(--color-text-muted);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.dropdown-item:hover, .dropdown-item.active {
    color: var(--color-primary);
    background: var(--color-surface-hover);
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    font-size: 1.2rem;
    padding: var(--space-2);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

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

.lang-toggle {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.lang-toggle:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-text-muted);
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-base);
    gap: var(--space-2);
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    color: white;
}

.btn-outline {
    background: transparent;
    border-color: var(--color-border);
    color: var(--color-text);
}

.btn-outline:hover {
    border-color: var(--color-text);
    background: var(--color-surface);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--space-12);
}

.hero-bg-glow {
    position: absolute;
    top: 20%;
    right: 10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, rgba(139,92,246,0) 70%);
    border-radius: 50%;
    z-index: -1;
    filter: blur(60px);
}

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: var(--space-8);
    align-items: center;
}

.hero-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-primary);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--space-4);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.hero-title {
    font-size: 4rem;
    margin-bottom: var(--space-3);
    background: linear-gradient(to right, var(--color-text), var(--color-text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-title span {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-5);
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: var(--space-3);
}

.hero-image-wrapper {
    position: relative;
}

.hero-image {
    width: 100%;
    border-radius: var(--radius-lg);
    z-index: 1;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.hero-image-backdrop {
    position: absolute;
    top: 20px;
    left: -20px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-lg);
    z-index: 0;
}

/* ==========================================================================
   Section Headers
   ========================================================================== */
.section-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: var(--space-2);
}

.section-subtitle {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   Feature Cards / Info Boxes
   ========================================================================== */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-5);
}

.icon-box {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--space-4);
}

/* ==========================================================================
   Lab Section (Home Preview)
   ========================================================================== */
.lab-preview {
    background: linear-gradient(to right, var(--color-surface), transparent);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    position: relative;
    overflow: hidden;
}

.lab-preview::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 50%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(139,92,246,0.1) 0%, transparent 70%);
    z-index: 0;
}

.lab-preview-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

/* ==========================================================================
   Publication List
   ========================================================================== */
.pub-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.pub-item {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    transition: transform var(--transition-fast);
}

.pub-item:hover {
    transform: translateX(5px);
    border-color: var(--color-primary);
}

.pub-year {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    min-width: 80px;
}

.pub-details h4 {
    margin-bottom: var(--space-1);
    font-family: var(--font-sans);
    font-size: 1.1rem;
}

.pub-authors {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-2);
}

.pub-journal {
    font-style: italic;
    color: var(--color-text);
    font-size: 0.9rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: var(--space-8) 0 var(--space-4);
    margin-top: var(--space-12);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.footer-col h4 {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    margin-bottom: var(--space-4);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.footer-links a {
    color: var(--color-text-muted);
}

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

.footer-bottom {
    text-align: center;
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   Animations
   ========================================================================== */
.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

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

/* ==========================================================================
   CV Timeline
   ========================================================================== */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-4) 0;
}

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

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 100%;
    margin-bottom: var(--space-6);
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    right: auto;
    background-color: var(--color-bg);
    border: 3px solid var(--color-primary);
    top: 15px;
    left: 12px;
    border-radius: 50%;
    z-index: 1;
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.timeline-item:hover::after {
    background-color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary);
}

.timeline-content {
    padding: var(--space-4);
    background-color: var(--color-surface);
    position: relative;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.timeline-year {
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--color-primary);
    font-size: 1.25rem;
    margin-bottom: var(--space-2);
}

.timeline-title {
    font-size: 1.25rem;
    margin-bottom: var(--space-1);
    color: var(--color-text);
}

.timeline-org {
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
    font-size: 0.95rem;
}

.timeline-desc {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.timeline-desc ul {
    list-style-type: disc;
    padding-left: var(--space-4);
    margin-top: var(--space-2);
}

.timeline-desc li {
    margin-bottom: var(--space-1);
}

@media screen and (min-width: 768px) {
    .timeline::after {
        left: 50%;
    }
    
    .timeline-item {
        width: 50%;
    }
    
    .timeline-item:nth-child(even) {
        left: 50%;
    }
    
    .timeline-item:nth-child(odd) {
        left: 0;
    }
    
    .timeline-item:nth-child(even)::after {
        left: -8px;
    }
    
    .timeline-item:nth-child(odd)::after {
        left: auto;
        right: -8px;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 992px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-image-wrapper {
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: var(--space-4);
        box-shadow: var(--shadow-md);
        border-bottom: 1px solid var(--color-border);
        align-items: center;
        gap: var(--space-4);
    }

    [data-theme="dark"] .nav-links {
        background: rgba(15, 23, 42, 0.98);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        background: transparent !important;
        padding: 0;
        opacity: 1;
        visibility: visible;
        display: none;
        text-align: center;
        width: 100%;
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-item {
        padding: var(--space-2) 0;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .section {
        padding: var(--space-8) 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
}
