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

:root {
    /* Enhanced Academic Color Palette */
    --primary: #2563eb;        /* Modern blue */
    --primary-light: #3b82f6;  /* Lighter blue */
    --primary-dark: #1d4ed8;   /* Darker blue */
    --accent: #64748b;         /* Slate gray */
    --accent-light: #94a3b8;   /* Light slate */
    --text-primary: #0f172a;   /* Rich black */
    --text-secondary: #475569; /* Dark slate */
    --text-muted: #64748b;     /* Slate */
    --bg-primary: #ffffff;     /* Pure white */
    --bg-secondary: #f8fafc;   /* Subtle gray */
    --bg-tertiary: #f1f5f9;    /* Light gray */
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --border: #e2e8f0;         /* Clean border */
    --border-light: #f1f5f9;   /* Very light border */
    --success: #059669;        /* Modern green */
    --warning: #d97706;        /* Modern orange */
    --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);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.65;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-weight: 400;
    font-feature-settings: 'kern' 1, 'liga' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

h1 { 
    font-size: 3rem; 
    font-weight: 800;
    letter-spacing: -0.05em;
}
h2 { 
    font-size: 2.25rem; 
    font-weight: 700;
}
h3 { 
    font-size: 1.5rem; 
    font-weight: 600;
}
h4 { 
    font-size: 1.25rem; 
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

code {
    font-family: 'JetBrains Mono', Monaco, Consolas, monospace;
    font-size: 0.875rem;
    background: #f8fafc;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    border: 1px solid #e2e8f0;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 5rem 0;
}

.section.bg-light {
    background-color: #f8fafc;
}

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

.section-title {
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto;
    font-weight: 400;
    line-height: 1.7;
}

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

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.nav-logo i {
    color: var(--primary);
}

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

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s ease;
    padding: 0.5rem 0;
    position: relative;
    font-size: 0.875rem;
}

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

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

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

.github-link {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white !important;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.github-link:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 0.25rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #64748b;
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 6rem 0 4rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-align: center;
}

.main-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 2.5rem;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    letter-spacing: -0.05em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.title-primary {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1em;
}

.authors {
    margin-bottom: 2rem;
}

.author {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-right: 2.5rem;
    display: inline-block;
    position: relative;
}

.author:last-child {
    margin-right: 0;
}

.author-links {
    display: inline-flex;
    gap: 0.5rem;
    margin-left: 0.75rem;
    align-items: center;
}

.author-links a {
    color: var(--primary);
    background: var(--bg-secondary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.author-links a:hover {
    color: white;
    background: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.affiliations {
    margin-bottom: 3rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.affiliation {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.6;
    font-weight: 450;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    padding: 1rem 2.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.05rem;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.btn-paper {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.btn-paper:hover {
    background: #b91c1c;
    color: white;
    border-color: #b91c1c;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-code {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
}

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

.btn-gallery {
    background: #059669;
    color: white;
    border-color: #059669;
}

.btn-gallery:hover {
    background: #047857;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: #047857;
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-style: italic;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Abstract Section */
.abstract-content {
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.7;
}

.abstract-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    text-align: justify;
}

.abstract-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

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

.feature-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.method-image-container {
    margin: 2rem 0;
    text-align: center;
}

.method-image {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

/* Gallery/Carousel Section */
.gallery-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.gallery-nav-btn {
    width: 50px;
    height: 50px;
    border: 2px solid var(--border);
    background: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    font-size: 1.25rem;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.gallery-nav-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.gallery-wrapper {
    flex: 1;
    overflow: hidden;
    border-radius: 0.75rem;
}

.gallery-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-slide {
    min-width: 100%;
    padding: 0.5rem;
}

.slide-content {
    text-align: center;
}

.gallery-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 0.5rem;
    cursor: pointer;
}

.gallery-caption {
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* Image Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 1200px;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
}

#modalImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

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

/* Usage & Code Blocks */
.code-block {
    background: #1e293b;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    text-align: left;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #334155;
    border-bottom: 1px solid #475569;
}

.code-header span {
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
}

.copy-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color 0.2s ease;
}

.copy-btn:hover {
    color: white;
}

.code-block pre {
    margin: 0;
    padding: 1.5rem;
    overflow-x: auto;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.code-block code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
}

/* Footer */
.footer {
    background: #1e293b;
    color: #f8fafc;
    padding: 3rem 0;
    text-align: center;
}

.footer h4 {
    color: #f8fafc;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.footer-content {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer a {
    color: #cbd5e1;
}

.footer a:hover {
    color: white;
}

.footer p {
    color: #e2e8f0;
}

/* Responsive */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    .nav-menu {
        display: none; /* Simplification for mobile, or use toggle logic */
    }
}
