/* ═══════════════════════════════════════════════════════
   ParetoSlider — Stylesheet
   Color palette: Light Gray + Pink & Blue accents
   --bg:          #f3f4f6   (light gray, everywhere)
   --pink:        #d64b7a   (titles, primary accent)
   --pink-dark:   #b83a64   (hover)
   --blue:        #4a7fd7   (secondary accent, interactive)
   --blue-dark:   #3968b8   (hover)
   --text-dark:   #1f2937   (headings)
   --text-body:   #374151   (body text)
   --text-muted:  #6b7280   (captions, subtitles)
   --border:      #e5e7eb   (subtle dividers)
═══════════════════════════════════════════════════════ */

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

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: #374151;
    background-color: #f3f4f6;
}

html {
    scroll-behavior: smooth;
}

/* ── Container ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ═══════════════════════════ HEADER ═══════════════════════════ */
.header {
    margin-top: -20px;
    margin-bottom: 40px;
    background-color: #f3f4f6;
    padding: 40px 0;
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 60px;
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    min-height: 500px;
}

.paper-details { flex: 1; text-align: left; }
.teaser-column  { flex: 1; text-align: center; }

/* ── Title ── */
.title {
    font-size: 2.2em;
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.3;
    color: #1f2937;
    text-align: left;
}

.pareto-slider {
    font-style: italic;
    font-weight: 700;
    color: #d64b7a;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.venue-text {
    color: #4a7fd7;
    font-size: 0.8em;
}

/* ── Authors & Affiliations ── */
.header-authors { margin: 15px 0; }

.header-author {
    display: inline-block;
    margin: 0 20px 8px 0;
    font-size: 1.15em;
    font-weight: 500;
    color: #1f2937;
    font-family: 'Georgia', 'Times New Roman', serif;
    letter-spacing: 0.3px;
}

.header-author a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(74, 127, 215, 0.35);
    transition: all 0.3s ease;
}

.header-author a:hover {
    color: #4a7fd7;
    border-bottom-color: #4a7fd7;
}

.header-affiliations { margin: 10px 0; }

.header-affiliation {
    color: #6b7280;
    font-style: italic;
    font-size: 1.05em;
}

/* ── TL;DR box ── */
.tldr-section {
    margin: 20px 0;
    padding: 15px 18px;
    background-color: rgba(74, 127, 215, 0.06);
    border-left: 4px solid #4a7fd7;
    border-radius: 0 8px 8px 0;
}

.tldr-title {
    color: #4a7fd7;
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 8px;
}

.tldr-content {
    color: #374151;
    font-size: 1.05em;
    line-height: 1.6;
    margin: 0;
    font-style: italic;
}

.highlight-text {
    color: #d64b7a;
    font-weight: 700;
    font-style: italic;
}

/* ── Link buttons ── */
.links { margin: 20px 0; text-align: left; }

.link-button {
    display: inline-block;
    padding: 10px 22px;
    margin: 0 10px 10px 0;
    background-color: transparent;
    color: #d64b7a;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 1.5px solid #d64b7a;
}

.link-button:hover {
    background-color: #d64b7a;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(214, 75, 122, 0.3);
}

/* ═══════════════════════════ TEASER CONTAINER ═══════════════════════════ */
.teaser-container {
    background-color: #ffffff;
    border-radius: 14px;
    padding: 25px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.simple-instruction {
    color: #6b7280;
    font-size: 1.1em;
    font-style: italic;
    font-weight: 500;
    text-align: center;
    min-height: 2.5em;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ═══════════════════════════ SLIDER ═══════════════════════════ */
.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

.strength-label {
    font-size: 0.85em;
    color: #6b7280;
    font-weight: 500;
    min-width: 30px;
}

.strength-slider {
    flex: 1;
    height: 5px;
    background: linear-gradient(90deg, rgba(74, 127, 215, 0.2), rgba(214, 75, 122, 0.2));
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.strength-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #4a7fd7, #d64b7a);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(107, 75, 175, 0.35);
}

.strength-slider::-webkit-slider-thumb:hover {
    background: linear-gradient(135deg, #3968b8, #b83a64);
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(107, 75, 175, 0.45);
}

.strength-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #4a7fd7, #d64b7a);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ── Result image ── */
.edit-result { text-align: center; border-radius: 8px; }

.edit-result .result-img,
.example-result .result-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* ═══════════════════════════ ABSTRACT ═══════════════════════════ */
.abstract-section {
    margin: 40px 0;
    padding: 35px;
    background-color: #f3f4f6;
    border-radius: 12px;
    border-left: 4px solid #d64b7a;
}

.abstract-section h2 {
    color: #d64b7a;
    font-size: 1.8em;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.abstract-text {
    color: #374151;
    font-size: 1.05em;
    line-height: 1.75;
    text-align: justify;
}

.inline-teaser-container { text-align: center; margin: 40px 0 10px; }

.inline-teaser-video {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.teaser-caption {
    margin-top: 12px;
    color: #6b7280;
    font-size: 0.95em;
    line-height: 1.5;
    font-style: italic;
}

/* ═══════════════════════════ INTERACTIVE EXAMPLES ═══════════════════════════ */
.interactive-examples { margin: 50px 0; }

.interactive-examples h2 {
    color: #4a7fd7;
    font-size: 1.8em;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 600;
}

.section-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 1em;
    font-style: italic;
    margin-bottom: 20px;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.examples-grid-1x3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.examples-grid-1x4 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.example-tile {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.example-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(74, 127, 215, 0.12);
}

.example-instruction {
    color: #6b7280;
    font-size: 0.88em;
    font-style: italic;
    text-align: center;
    margin-bottom: 10px;
    min-height: 2em;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.example-slider-container { margin-bottom: 18px; }
.example-result { text-align: center; }

/* ── Edit tile: input + result side by side ── */
.edit-result-row {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.edit-input-col {
    flex: 0 0 38%;
    text-align: center;
}

.edit-output-col {
    flex: 1;
    text-align: center;
}

.edit-input-col .result-img,
.edit-output-col .result-img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

/* ── Video tiles: square aspect ratio ── */
.example-result video.result-img {
    aspect-ratio: 1 / 1;
    width: 100%;
    max-height: none;
    object-fit: cover;
    border-radius: 8px;
}

.edit-col-label {
    font-size: 0.72em;
    color: #6b7280;
    margin-bottom: 3px;
    font-style: italic;
}

/* ═══════════════════════════ METHOD ═══════════════════════════ */
.method-section {
    margin: 50px 0;
    padding: 40px;
    background-color: #f3f4f6;
    border-radius: 12px;
    border-left: 4px solid #4a7fd7;
}

.method-section h2 {
    color: #4a7fd7;
    font-size: 1.8em;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
}

.method-overview {
    color: #374151;
    font-size: 1.05em;
    line-height: 1.75;
    text-align: justify;
    margin-bottom: 20px;
}

.method-overview a { color: #d64b7a; text-decoration: underline; }
.method-overview strong { color: #1f2937; }

.method-img {
    max-width: 95%;
    height: auto;
    display: block;
    margin: 30px auto;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.method-caption {
    color: #6b7280;
    font-size: 0.95em;
    line-height: 1.6;
    text-align: center;
    margin-top: -10px;
    font-style: italic;
}

/* ── Small slider labels ── */
.strength-label.small-label {
    font-size: 0.78em;
    min-width: 60px;
    text-align: center;
}

/* ═══════════════════════════ CITATION FOOTER ═══════════════════════════ */
.citation-footer {
    background-color: #f3f4f6;
    border-top: 2px solid #e5e7eb;
    padding: 50px 0;
    margin-top: 60px;
}

.citation-footer .container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 40px;
}

.citation-footer h3 {
    color: #d64b7a;
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.bibtex-container {
    position: relative;
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.bibtex-code {
    background-color: #ffffff;
    padding: 30px;
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    overflow-x: auto;
    white-space: pre;
    border: none;
    text-align: left;
}

.copy-bibtex-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #4a7fd7, #d64b7a);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(107, 75, 175, 0.25);
    z-index: 10;
}

.copy-bibtex-btn:hover {
    background: linear-gradient(135deg, #3968b8, #b83a64);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(107, 75, 175, 0.35);
}

.copy-bibtex-btn:active { transform: translateY(0); }

/* ═══════════════════════════ RESPONSIVE ═══════════════════════════ */

/* Prevent horizontal overflow globally */
html, body { overflow-x: hidden; max-width: 100%; }

@media (max-width: 768px) {
    /* Prevent images/videos from overflowing */
    img, video { max-width: 100%; }

    /* Container */
    .container { padding: 15px; width: 100%; }

    /* Header: disable full-bleed trick on mobile, stack columns */
    .header { width: 100%; margin-left: 0; padding: 24px 0; }
    .header-content { flex-direction: column; gap: 24px; padding: 0 15px; min-height: auto; }
    .paper-details { text-align: center; width: 100%; }
    .teaser-column { width: 100%; }
    .teaser-container { margin-top: 10px; padding: 15px; }

    /* Typography */
    .title { font-size: 1.4em; text-align: center; line-height: 1.4; }
    .links { text-align: center; }
    .link-button { display: inline-block; margin: 6px 4px; width: auto; padding: 8px 16px; }
    .header-author { display: inline-block; margin: 4px 8px; font-size: 0.95em; }
    .header-affiliations { font-size: 0.9em; }
    .tldr-content { font-size: 0.95em; }

    /* Teaser image in header */
    .teaser-container .result-img { max-width: 100%; height: auto; }

    /* Teaser video */
    .inline-teaser-video { max-height: 220px; width: 100%; }
    .inline-teaser-container { margin: 20px 0; }

    /* Abstract */
    .abstract-section { padding: 18px 15px; margin: 20px 0; }
    .abstract-text { font-size: 0.95em; }

    /* Section headings */
    .interactive-examples h2 { font-size: 1.4em; }
    .interactive-examples { margin: 30px 0; }

    /* All example grids → single column */
    .examples-grid,
    .examples-grid-1x3,
    .examples-grid-1x4 { grid-template-columns: 1fr; gap: 14px; margin-top: 14px; }

    /* Slider labels: shrink so they don't overflow */
    .strength-label.small-label { font-size: 0.7em; min-width: 40px; }
    .slider-container { gap: 6px; }

    /* Edit tiles: stack input above output */
    .edit-result-row { flex-direction: column; gap: 8px; }
    .edit-input-col,
    .edit-output-col { flex: none; width: 100%; }

    /* Method */
    .method-section { padding: 20px 15px; margin: 30px 0; }
    .method-img { max-width: 100%; }
    .method-overview { font-size: 0.95em; }

    /* Comparisons: stack Pareto plot above baseline grid */
    .method-section .method-content > div:first-child {
        flex-direction: column !important;
        gap: 16px !important;
    }
    .method-section .method-content > div:first-child > div:first-child {
        flex: none !important;
        width: 100% !important;
    }
    /* Comparison tables: each row is its own scroll strip */
    .comparison-grid-wrapper { width: 100%; min-width: 0; overflow: hidden; }

    .comparison-grid-wrapper table,
    .comparison-grid-wrapper tbody { display: block; width: 100%; }

    .comparison-grid-wrapper tr {
        display: flex;
        align-items: center;
        gap: 3px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 6px;
    }

    /* Hide text label rows (Ep. 100 / Realistic etc.) */
    .comparison-grid-wrapper tr:last-child { display: none; }

    /* Method name labels: keep rotation, constrain to image height */
    .comparison-grid-wrapper td[style*="writing-mode"] {
        width: 20px !important;
        min-width: 20px !important;
        height: 60px !important;
        max-height: 60px !important;
        overflow: hidden;
        font-size: 0.58em !important;
        padding: 0 !important;
        flex-shrink: 0;
        align-self: center;
    }

    /* Image cells: fixed square size */
    .comparison-grid-wrapper td:not([style*="writing-mode"]) {
        flex-shrink: 0;
        width: 60px;
        min-width: 60px;
    }
    .comparison-grid-wrapper td img {
        width: 60px !important;
        height: 60px !important;
        max-width: none !important;
        object-fit: cover;
        display: block;
    }

    /* Citation */
    .citation-footer { padding: 30px 0; }
    .citation-footer .container { padding: 0 15px; }
    .citation-footer h3 { font-size: 1.4rem; }
    .bibtex-code { font-size: 10px; padding: 14px; }
    .copy-bibtex-btn { position: static; display: block; margin: 16px auto 0; width: fit-content; }
}

/* ── image placeholder ── */
img { background-color: #f3f4f6; }
