/* Base Styles */
:root {
    --accent: #007bff;
    --accent-dark: #0056b3;
}
* {
    box-sizing: border-box;
}
body {
    font-family: "Titillium Web", "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
    font-weight: 300;
    font-size: 17px;
    margin-left: auto;
    margin-right: auto;
    max-width: 1000px;
    padding-left: 20px;
    padding-right: 20px;
}
h1 {
    font-weight: 500;
    line-height: 1.15em;
    font-size: 36px;
    text-align: center;
}
h2 {
    font-size: 1.5em;
    font-weight: 400;
    margin: 16px 0px 4px 0px;
    text-align: center;
}
a:link, a:visited {
    color: #1772d0;
    text-decoration: none;
}
a:hover {
    color: #f09228;
}
p {
    line-height: 1.5;
}
hr {
    height: 1px;
    border: 0;
    border-top: 1px solid #ddd;
    margin: 0;
}
.text-center {
    text-align: center;
}

/* Layout */
.container {
    margin-left: auto;
    margin-right: auto;
}
.paper-title {
    padding: 16px 0px 16px 0px;
}
section {
    margin: 72px 0px 72px 0px;
    text-align: justify;
    clear: both;
    scroll-margin-top: 28px;  /* room above a section that the sidebar jumps to */
}

/* Top Navigation */
.topnav {
    overflow: hidden;
    background-color: #EEEEEE;
}
.topnav a {
    float: left;
    color: black;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    font-size: 18px;
}

/* Author & Affiliation Rows */
.author-row {
    overflow: auto;
    font-size: 18px;
    font-weight: 400;
    text-align: center;
}
.venue-row {
    overflow: auto;
    font-size: 24px;
    font-weight: 400;
    text-align: center;
}
.affil-row {
    overflow: auto;
    font-size: 18px;
    text-align: center;
}

/* Grid Columns */
.col-5 {
    width: 20%;
    float: left;
}
.col-3 {
    width: 33%;
    float: left;
}
.col-2 {
    width: 50%;
    float: left;
}
.col-1 {
    width: 100%;
    float: left;
}

/* Buttons */
.paper-btn-parent {
    display: flex;
    justify-content: center;
    margin: 16px 0px;
}
.supp-btn {
    background-color: #fff;
    border: 1.5px solid #000;
    color: #000 !important;
    font-size: 16px;
    padding: 12px 24px;
    border-radius: 50px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    transition-duration: 0.4s;
    cursor: pointer;
    letter-spacing: 1px;
    margin: 8px;
    width: fit-content;
    font-weight: 400;
}
.supp-btn:hover {
    background-color: #000;
    color: #fff !important;
}
.supp-btn-disabled {
    background-color: #f0f0f0 !important;
    border-color: #b0b0b0 !important;
    color: #888 !important;
    cursor: not-allowed !important;
    pointer-events: none;
    opacity: 0.7;
}
.supp-btn-disabled:hover {
    background-color: #f0f0f0 !important;
    color: #888 !important;
}
.material-icons {
    vertical-align: -6px;
}
/* Scene Pill Navigation */
.nav {
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}
.nav-pills {
    cursor: pointer;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.nav-pills > li {
    float: left;
    position: relative;
    display: inline-block;
}
.new-center-pills {
    cursor: pointer;
    display: flex;
    justify-content: center;
    gap: 10px;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}
.dataset-pill {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
    padding: 6px 12px;
}
.dataset-pill a {
    padding: 8px 16px;
    font-weight: 500;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
}
.dataset-pill.active {
    background-color: var(--accent);
    border-color: var(--accent);
}
.dataset-pill.active a {
    color: white !important;
}
.dataset-pill:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
}
.dataset-pill.active:hover {
    background-color: var(--accent-dark);
}

/* Dataset Description Box: as wide as the text column, also inside a wider block of videos */
.dataset-description {
    max-width: 960px;
    margin: 20px auto;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}
.dataset-desc {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
}

/* Videos */
.video-tile {
    position: relative;
    margin-top: 20px;
    background: #f5f5f5;
    overflow: hidden;
    border-radius: 8px;
}
.video-tile video {
    width: 100%;
    height: auto;
    display: block;
}
/* Label of a video, in its top left corner */
.video-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
    padding: 1px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.45);
    color: white;
    font-size: 13px;
    font-weight: 400;
    text-align: left;
    pointer-events: none;
}
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
}
.video-grid.pairs {
    grid-template-columns: repeat(2, 1fr);
}
.video-grid .video-tile {
    margin-top: 0;
}
/* From Comparison on, the blocks of videos (and the rule under the heading of their section) are wider than
   the text column (960px) where the window has the room. The opening video stays as wide as the text. */
@media (min-width: 1280px) {
    .wide {
        width: 1200px;
        margin-left: -120px;
    }
}

/* Play bar under a row of videos that play as one: pause / play, position, time */
.sync-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 560px;
    margin: 10px auto 0;
}
.sync-toggle {
    flex: none;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    background: white;
    color: #495057;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sync-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.sync-seek {
    flex: 1;
    height: 4px;
    accent-color: var(--accent);
    cursor: pointer;
}
.sync-time {
    flex: none;
    min-width: 78px;
    color: #666;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

/* Tabs: a row of pills, one panel per pill */
.tab-pills {
    margin-top: 20px;
}
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

/* Carousel: the examples of a tab side by side on a track, one shows at a time */
.carousel {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    column-gap: 12px;
    align-items: center;
}
.carousel-window {
    overflow: hidden;
    border-radius: 8px;
}
.carousel-track {
    display: flex;
    align-items: center;
    transition: transform 0.35s ease;
}
.carousel-track .video-tile {
    flex: 0 0 100%;
    margin-top: 0;
    border-radius: 0;
}
.carousel-arrow {
    width: 44px;
    height: 44px;
    padding: 0 0 4px;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    background: white;
    color: #495057;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}
.carousel-arrow:hover {
    background: #e9ecef;
}
.carousel-dots,
.carousel-speed {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.carousel-dots {
    gap: 9px;
    margin-top: 14px;
}
.carousel-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #ced4da;
    cursor: pointer;
}
.carousel-dot.active {
    background: var(--accent);
}
/* Speed buttons of a full rollout; the row keeps its height when it is empty */
.carousel-speed {
    gap: 6px;
    min-height: 30px;
    margin-top: 12px;
    visibility: hidden;
}
.carousel-speed.on {
    visibility: visible;
}
.speed-label {
    margin-right: 4px;
    color: #666;
    font-size: 14px;
}
.speed-button {
    padding: 3px 12px;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    background: #f8f9fa;
    color: #495057;
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
}
.speed-button.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Caption */
.caption-center {
    font-size: 16px;
    color: #666;
    text-align: center;
    margin-top: 8px;
    margin-bottom: 16px;
}

/* Citation */
#bibtex pre {
    font-size: 14px;
    background-color: #eee;
    padding: 16px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
}

/* M2R additions to the template */
.figure {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 20px;
}
.figure-narrow {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.affil-row sup,
.author-row sup {
    line-height: 0;
}
.affil-note {
    margin-left: 24px;
    white-space: nowrap;
}
#teaser {
    margin-top: 16px;
}
/* What the method does in two sentences, above the opening video */
.lead {
    margin: 28px 0 24px;
    color: #222;
    font-size: 19px;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    text-wrap: balance;
}
h2 {
    margin-bottom: 8px;
}

/* Section list. The page stays centred; the list shows only where the window has room for it left of the
   1200px video blocks (from 1540px on). */
#sidebar {
    display: none;
}
@media (min-width: 1540px) {
    #sidebar {
        display: block;
        position: fixed;
        top: 50%;
        left: 20px;
        width: 140px;
        transform: translateY(-50%);
        border-left: 1px solid #e2e2e2;
    }
    #sidebar a {
        display: block;
        margin-left: -1px;
        padding: 6px 0 6px 14px;
        border-left: 2px solid transparent;
        color: #777;
        font-size: 15px;
        font-weight: 400;
        line-height: 1.3;
    }
    #sidebar a:hover {
        color: #222;
    }
    #sidebar a.active {
        border-left-color: var(--accent);
        color: var(--accent);
        font-weight: 600;
    }
}
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}
#hero-video {
    aspect-ratio: 1924 / 1060;
    background: #000;
}
#hero-pills {
    margin-top: 16px;
}
/* Two rows of pills: rollouts with one camera, and below them the ones with a camera per agent */
#hero-pills .new-center-pills {
    margin: 0;
}
#hero-pills .new-center-pills + .new-center-pills {
    margin-top: 10px;
}
#hero-pills .dataset-pill {
    margin: 0;
}
#hero-pills .dataset-pill a {
    padding: 8px 10px;
}
.new-center-pills {
    flex-wrap: wrap;
}
/* A paragraph on the left, its figure on the right */
.side-by-side {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-top: 36px;
}
.side-by-side p {
    flex: 5;
    margin: 0;
}
.side-by-side .figure {
    flex: 6;
    min-width: 0;
    margin-top: 0;
}
/* Marks the rollouts with several agents */
.pill-tag {
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 6px;
    background-color: #76b900;
    color: white;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    vertical-align: 2px;
}

/* Narrow windows: the paragraph goes above its figure, and the video grids lose a column */
@media (max-width: 900px) {
    .side-by-side {
        display: block;
    }
    .side-by-side .figure {
        max-width: 640px;
        margin: 20px auto 0;
    }
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .video-grid.pairs {
        grid-template-columns: 1fr;
    }
    /* the three looks of one mesh stay in one row */
    .video-grid.looks {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

/* Phones: the template's fixed columns wrap */
@media (max-width: 700px) {
    h1 {
        font-size: 26px;
    }
    .topnav {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
    }
    .topnav a {
        float: none;
        padding: 8px 10px;
        font-size: 15px;
    }
    .author-row,
    .affil-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    .col-5,
    .col-3,
    .col-2 {
        width: auto;
        float: none;
        padding: 0 10px;
    }
    section {
        margin: 48px 0;
        text-align: left;
    }
    .lead {
        font-size: 18px;
    }
    .paper-btn-parent {
        flex-wrap: wrap;
    }
    .dataset-pill {
        margin: 0;
        padding: 4px 6px;
    }
    .dataset-pill a {
        padding: 4px 8px;
        font-size: 14px;
    }
    .carousel {
        grid-template-columns: 30px minmax(0, 1fr) 30px;
        column-gap: 6px;
    }
    .carousel-arrow {
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
}
