:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --accent-color: #2563eb;
    --secondary-bg: #f8f9fa;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --gradient-start: #2563eb;
    --gradient-end: #7c3aed;
}

/* Cursor Glow */
.cursor-glow {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    position: fixed;
    pointer-events: none;
    z-index: -1;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --accent-color: #3b82f6;
    --secondary-bg: #1e293b;
    --border-color: #334155;
    --card-bg: #1e293b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --gradient-start: #60a5fa;
    --gradient-end: #a78bfa;
}

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

html {
    background-color: var(--bg-color);
    transition: background-color 0.3s;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: transparent;
    color: var(--text-color);
    line-height: 1.6;
    transition: color 0.3s;
    overflow-x: hidden;
    position: relative;
}

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

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

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

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

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    width: auto;
    transition: opacity 0.3s;
}

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

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    transition: transform 0.2s;
}

#theme-toggle:hover {
    transform: scale(1.1);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

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

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

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

/* Hero Section */
.hero {
    padding-top: 120px;
    padding-bottom: 4rem;
    text-align: center;
}

.title {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.gradient-text {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.authors {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.affiliations {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-color);
    line-height: 1.6;
}

.author-block {
    display: inline-block;
}

.author a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

.author a:hover {
    opacity: 0.8;
}

.links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
}

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

/* Sections */
.section {
    padding: 4rem 0;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

.content-box {
    background-color: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    max-width: 900px;
    margin: 0 auto;
}

.content-box p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-align: justify;
}

.content-box p:last-child {
    margin-bottom: 0;
}

/* Images */
.image-container {
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.teaser-img,
.method-img {
    width: 100%;
    height: auto;
    display: block;
}

.caption {
    text-align: center;
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.95rem;
    max-width: 800px;
    margin: 1rem auto 0;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown button {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
    color: var(--text-color);
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
}

.dropdown button:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.2));
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.dropdown button i {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.dropdown:hover button i {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--secondary-bg);
    min-width: fit-content;
    max-width: 300px;
    width: max-content;
    box-shadow: var(--shadow);
    z-index: 1000;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    /* Position with small gap for visual appeal */
    top: calc(100% + 0.25rem);
}

/* Create invisible bridge between button and menu */
.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0.25rem;
    background: transparent;
    display: none;
}

.dropdown:hover::after {
    display: block;
}

.dropdown-content a:first-child {
    margin-top: 0;
}

.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s;
}

.dropdown-content a:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

.dropdown-content a:last-child {
    border-radius: 0 0 0.5rem 0.5rem;
}

.dropdown-content a:hover {
    background-color: var(--secondary-bg);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.result-item {
    background-color: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

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

.result-item.full-width {
    grid-column: 1 / -1;
}

.result-item h3 {
    font-family: 'Outfit', sans-serif;
    margin-bottom: 1rem;
    text-align: center;
}

.result-item img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    object-fit: contain;
}

/* Results Gallery - Single Column Layout */
.results-gallery {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding: 2rem 0;
    max-width: 900px;
    margin: 0 auto;
}

.gallery-item {
    background: var(--secondary-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    animation: fadeInUp 0.6s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.gallery-item h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    margin-top: 1rem;
    text-align: center;
}

/* Two-level title structure */
.gallery-item .item-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
}

.gallery-item img {
    width: 100%;
    height: auto;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: transform 0.3s;
    object-fit: contain;
}

.gallery-item img:hover {
    transform: scale(1.02);
}


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

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

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    /* Flexbox for centering */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.show {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    transition: transform 0.2s ease;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 2001;
}

.lightbox-close:hover {
    color: #bbb;
}

/* Lightbox Navigation Buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
}

/* Show navigation buttons on hover (desktop) */
.lightbox:hover .lightbox-nav {
    opacity: 1;
    pointer-events: auto;
}

/* Always show on mobile/touch devices */
@media (hover: none) and (pointer: coarse) {
    .lightbox-nav {
        opacity: 0.6;
        pointer-events: auto;
    }
    
    .lightbox-nav:active {
        opacity: 1;
    }
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

/* Lightbox Title */
.lightbox-title {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 2rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    z-index: 2001;
    max-width: 80%;
    text-align: center;
}

.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* BibTeX */
.code-block {
    background-color: var(--secondary-bg);
    padding: 2rem;
    border-radius: 1rem;
    position: relative;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    font-family: 'Consolas', 'Monaco', monospace;
}

.copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Copied success state with elegant animation */
.copy-btn.copied {
    background: linear-gradient(135deg, #10b981, #059669);
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.copy-btn.copied:hover {
    transform: scale(1.05);
}

pre {
    margin: 0;
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Footer */
.footer {
    padding: 3rem 0;
    text-align: left;
    /* Left align footer */
    background-color: var(--secondary-bg);
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.95rem;
}

.footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 99;
    width: 50px;
    height: 50px;
    border: none;
    outline: none;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Responsive */
/* Large tablets and small desktops */
@media (max-width: 1200px) {
    .title {
        font-size: 3rem;
    }

    .authors {
        font-size: 1rem;
    }

    .affiliations {
        font-size: 1rem;
    }
}

@media (max-width: 992px) {
    .title {
        font-size: 2.5rem;
    }

    .authors {
        font-size: 0.95rem;
    }

    .affiliations {
        font-size: 0.95rem;
    }
}

/* Hamburger menu only for very narrow screens */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .title {
        font-size: 2rem;
    }

    .authors {
        font-size: 0.9rem;
        gap: 0.75rem;
    }

    .affiliations {
        font-size: 0.9rem;
    }

    /* Show hamburger menu */
    .hamburger {
        display: flex;
    }

    /* Hide nav links by default, show as mobile menu */
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--bg-color);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        box-shadow: var(--shadow);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
        border-bottom: 1px solid var(--border-color);
        align-items: stretch;
    }

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

    .nav-links a {
        padding: 1rem 2rem;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links a:hover {
        background-color: var(--secondary-bg);
    }

    .dropdown {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .dropdown button {
        width: 100%;
        text-align: center;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem 2rem;
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
    }

    .dropdown button:hover {
        transform: none;
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.15));
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        padding-top: 0;
        background-color: var(--secondary-bg);
        width: 100%;
        max-width: none;
        min-width: 100%;
    }

    .dropdown.active .dropdown-content {
        max-height: 200px;
        display: block;
    }

    .dropdown-content a {
        padding: 0.75rem 2rem;
        border-bottom: 1px solid var(--border-color);
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }

    .dropdown-content a:first-child {
        border-radius: 0;
    }

    .dropdown-content a:last-child {
        border-radius: 0;
    }

    .dropdown-content a:hover {
        background-color: var(--border-color);
    }

    .dropdown::after {
        display: none;
    }

    #theme-toggle {
        width: 100%;
        text-align: center;
        padding: 1rem 2rem;
        border-radius: 0;
        justify-content: center;
        border-bottom: 1px solid var(--border-color);
    }

    /* Mobile button layout */
    .links {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        padding: 0 1rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 0.875rem 1.5rem;
    }

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

    /* Gallery already single column, just adjust spacing */
    .results-gallery {
        padding: 1rem 0;
    }

    .gallery-item {
        padding: 1rem;
    }

    /* Vertical Layout for Gallery on Small Screens */
    .horizontal-gallery {
        flex-direction: column;
        overflow-x: visible;
        align-items: center;
        padding: 1rem;
        gap: 1.5rem;
    }

    .gallery-item {
        width: 100%;
        padding: 1rem;
    }

    .gallery-item img {
        max-width: 100%;
        /* Constrain to card width */
        max-height: none;
        /* Remove height constraint on mobile */
        width: 100%;
        height: auto;
    }
}

/* For very small screens */
@media (max-width: 576px) {
    .title {
        font-size: 1.5rem;
    }

    .authors {
        font-size: 0.85rem;
        gap: 0.5rem;
    }

    .affiliations {
        font-size: 0.85rem;
    }
}

@media (max-width: 400px) {
    .title {
        font-size: 1.3rem;
    }

    .authors {
        font-size: 0.8rem;
        gap: 0.4rem;
    }

    .affiliations {
        font-size: 0.8rem;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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