/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Avenir', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 180px;
    padding-top: 90px; /* space for header area */
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.9));
    border-right: 1px solid #e5e7eb;
    z-index: 900;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
}

.sidebar a {
    display: block;
    padding: 0.4rem 0.75rem;
    color: #334155;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.sidebar a:hover { background: #eef2ff; color: #1e3a8a; }
.sidebar a.active { background: #e0e7ff; color: #1d4ed8; }
.sidebar a.sub { padding-left: 1.5rem; font-weight: 500; font-size: 0.85rem; }

@media (min-width: 1024px) {
    body { padding-left: 180px; }
}

@media (max-width: 1023px) {
    .sidebar { display: none; }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 3rem;
}

/* Header */
header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    padding: 1.5rem 0;
    text-align: center;
}

/* Give the header a bit more horizontal room so authors fit one row */
header .container { padding: 0 1.5rem; }

header h1 {
    font-size: 2.1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
    font-family: 'Avenir', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.authors {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-family: 'Avenir', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.authors span {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.affiliations {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    font-family: 'Avenir', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.conference {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 800;
    color: #1f2937;
    background: #facc15;
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    margin-left: 1rem;
    font-family: 'Avenir', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    box-shadow: 0 2px 0 #fde68a, inset 0 0 0 2px #ca8a04;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
}

/* Author list styling */
.author-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1rem;
    margin: 0.75rem 0 0.75rem 0;
}

.author-list li { text-align: center; }
.author-name { color: #fff; font-weight: 600; display: block; }
.author-affil { color: rgba(255,255,255,0.85); font-size: 0.85rem; display: block; }

/* Hero icon links */
/* Slim hero links (icon + label, no cards) */
.hero-links.slim {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    margin-top: 0.6rem;
}

.hero-link-slim {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: #fff;
    text-decoration: none;
}

.hero-link-slim .icon {
    width: 40px;
    height: 40px;
}

.hero-link-slim span { font-weight: 700; }

.hero-link-slim:hover { opacity: 0.9; transform: translateY(-1px); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: #ffffff;
    color: #1f2937;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1.05rem;
    border: 1px solid #e5e7eb;
    font-family: 'Avenir', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.btn:hover { background: #f8fafc; }

.btn:active { background: #eef2ff; }

/* Dataset section buttons */
/* Intentionally keep buttons consistent; no dataset-specific overrides */

/* Sections */
section {
    padding: 2.5rem 0;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

section:nth-child(even) {
    background: white;
}

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

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.8rem;
    text-align: left;
    letter-spacing: -0.01em;
    position: relative;
    display: inline-block;
    width: 100%;
}

h2::after { display: none; }

h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.6rem;
}

/* Teaser section */
.teaser {
    background: linear-gradient(to bottom, white 0%, #fafafa 100%);
    padding: 2rem 0;
    position: relative;
}

.teaser::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #4f46e5 50%, transparent 100%);
    opacity: 0.3;
}

.teaser-image {
    text-align: center;
    margin-bottom: 2rem;
}

.teaser-image img {
    max-width: 85%;
    height: auto;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.teaser-image img:hover {
    transform: translateY(-2px);
}

.teaser-caption {
    font-size: 1rem;
    color: #555;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

/* Abstract section */
.abstract {
    background: #f8fafc;
}

.abstract p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #374151;
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    padding: 1.5rem 0;
}

.abstract p strong {
    color: #4f46e5;
    font-weight: 600;
}

/* Problem section */
.problem-content {
    max-width: 900px;
    margin: 0 auto;
}

.problem-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 1.5rem;
    text-align: justify;
}

/* Method section */
.method {
    background: linear-gradient(135deg, #fafafa 0%, #f1f5f9 50%, #fafafa 100%);
    position: relative;
}

.method::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(79, 70, 229, 0.3) 50%, transparent 100%);
}

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

.method-image img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.method-image img:hover {
    transform: translateY(-2px);
}

.method-caption {
    font-size: 1rem;
    color: #555;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

/* Dataset section */
.dataset {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    position: relative;
    overflow: hidden;
}

.dataset::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -30%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.03) 0%, transparent 70%);
    animation: float 25s ease-in-out infinite reverse;
}

.dataset-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.dataset-text {
    max-width: 500px;
    background: rgba(255, 255, 255, 0.7);
    padding: 2rem;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.dataset-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 1.5rem;
    text-align: justify;
}

.dataset-image {
    text-align: center;
}

.dataset-image img {
    max-width: 95%;
    height: auto;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dataset-image img:hover {
    transform: translateY(-2px);
}

.dataset-caption {
    font-size: 1rem;
    color: #555;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

/* Results section */
.results {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #ffffff 100%);
    position: relative;
}

.results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(79, 70, 229, 0.2) 50%, transparent 100%);
}

.results-content {
    margin-bottom: 3rem;
}

.results-image {
    text-align: center;
    margin-bottom: 2rem;
}

.results-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.results-caption {
    font-size: 1rem;
    color: #555;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.results-bias {
    margin-bottom: 3rem;
}

.bias-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.bias-item {
    max-width: 400px;
    text-align: center;
}

.bias-item img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.bias-item p {
    font-size: 0.95rem;
    color: #555;
}

.key-findings {
    max-width: 900px;
    margin: 2rem auto;
    position: relative;
}

.key-findings::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #4f46e5, #7c3aed);
    border-radius: 2px;
}

.key-findings ul {
    list-style: none;
    padding: 0;
}

.key-findings li {
    background: rgba(255, 255, 255, 0.9);
    padding: 1.8rem;
    margin-bottom: 1.2rem;
    border-radius: 16px;
    border-left: 4px solid #4f46e5;
    font-size: 1.05rem;
    line-height: 1.6;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(79, 70, 229, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
}

.key-findings li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.02), rgba(124, 58, 237, 0.02));
    border-radius: 16px;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.key-findings li:hover {
    transform: translateX(12px) translateY(-2px);
    border-left-width: 6px;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.15);
}

.key-findings li:hover::before {
    opacity: 1;
}

/* Citation section */
.citation {
    background: #f8fafc;
}

.citation-box {
    background: #1f2937;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    position: relative;
}

.citation-box pre {
    margin: 0;
}

.citation-box code {
    color: #e5e7eb;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ffffff;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.copy-btn.copied {
    background: #dcfce7;
    border-color: #86efac;
    color: #065f46;
}

.citation .links {
    margin-top: 2rem;
}

/* Footer */
footer {
    background: #1f2937;
    color: #9ca3af;
    text-align: center;
    padding: 2rem 0;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem auto 2rem;
}

.tab-btn {
    background: #eef2ff;
    color: #1e293b;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    cursor: pointer;
}

.tab-btn:hover {
    background: #e0e7ff;
}

.tab-btn.active {
    background: #1d4ed8;
    color: #fff;
    border-color: #1d4ed8;
}

.tab-panels { max-width: 1000px; margin: 0 auto; }

.tab-panel { animation: fadeIn 180ms ease; }
.tab-panel[hidden] { display: none; }

.results-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(79, 70, 229, 0.1);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.results-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.02), rgba(124, 58, 237, 0.02));
    transition: opacity 0.3s ease;
    opacity: 0;
}

.results-card:hover {
    transform: translateY(-4px);
    border-color: rgba(79, 70, 229, 0.2);
    box-shadow: 0 20px 50px rgba(79, 70, 229, 0.1);
}

.results-card:hover::before {
    opacity: 1;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.gallery-item img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item img:hover {
    transform: translateY(-1px);
}

.gallery-item figcaption {
    font-size: 0.9rem;
    color: #555;
    margin-top: 0.5rem;
    text-align: center;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Interactive Table Styles */
table tr {
    transition: all 0.2s ease;
}

table tr:hover {
    background-color: #f8fafc !important;
}

table th {
    position: relative;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9) !important;
}

/* Staggered Animation Delays */
section:nth-child(1) { animation-delay: 0.1s; }
section:nth-child(2) { animation-delay: 0.2s; }
section:nth-child(3) { animation-delay: 0.3s; }
section:nth-child(4) { animation-delay: 0.4s; }
section:nth-child(5) { animation-delay: 0.5s; }
section:nth-child(6) { animation-delay: 0.6s; }
section:nth-child(7) { animation-delay: 0.7s; }

/* Loading Effect for Images */
.slide img,
.teaser-image img,
.method-image img,
.dataset-image img {
    opacity: 0;
    animation: imageLoad 0.6s ease forwards;
}

@keyframes imageLoad {
    from {
        opacity: 0;
        filter: blur(5px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.1s ease;
    z-index: 1000;
}

/* Carousel */
.carousel {
    position: relative;
    margin: 2rem auto 2rem;
    max-width: 1000px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.carousel-track {
    display: flex;
    overflow: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.slide {
    min-width: 100%;
    scroll-snap-align: center;
    padding: 0.25rem;
    text-align: center;
}

.slide img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide img:hover {
    transform: translateY(-1px);
}

/* Make bias carousel images same height */
.carousel[data-carousel="bias"] .slide img {
    height: 300px;
    object-fit: contain;
    object-position: center;
}

.slide figcaption {
    font-size: 0.95rem;
    color: #555;
    margin-top: 0.5rem;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    border: none;
    border-radius: 999px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
    z-index: 10;
}

.carousel-btn.prev { left: -12px; }
.carousel-btn.next { right: -12px; }

.carousel-btn:hover {
    background: rgba(15, 23, 42, 0.85);
    transform: translateY(-50%) scale(1.1);
}

@media (max-width: 640px) {
    .carousel-btn.prev { left: 6px; }
    .carousel-btn.next { right: 6px; }
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .authors {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .affiliations {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .dataset-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .bias-examples {
        flex-direction: column;
        align-items: center;
    }
    
    section {
        padding: 2rem 0;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .citation-box {
        padding: 1rem;
    }
    
    .citation-box code {
        font-size: 0.8rem;
    }
}
