/* Global Styles - Nerfies Inspired */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    font-size: 16px;
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 40px;
}

.logo {
    max-width: 300px;
    width: 100%;
    height: auto;
    margin: 0 auto 30px;
    display: block;
}

.title {
    font-size: 2.2rem;
    font-weight: 400;
    margin-bottom: 30px;
    line-height: 1.3;
    color: #000;
}

.authors {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #333;
}

.author {
    margin: 0 8px;
    display: inline-block;
}

.author a {
    color: #4285f4;
    text-decoration: none;
}

.author a:hover {
    text-decoration: underline;
}

.affiliations {
    font-size: 1rem;
    margin-bottom: 25px;
    color: #666;
}

.affiliation {
    margin: 0 10px;
    display: inline-block;
}

.links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 25px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: #4285f4;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
    position: relative;
}

.btn:hover {
    background-color: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
}

.btn-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.btn-paper {
    background: #4285f4;
}

.btn-paper:hover {
    background: #3367d6;
}

.btn-video {
    background: #4285f4;
}

.btn-video:hover {
    background: #3367d6;
}

.btn-disabled {
    background-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-disabled:hover {
    background-color: #e0e0e0;
    transform: none;
    box-shadow: none;
}

.coming-soon {
    font-size: 0.75rem;
    background-color: rgba(255, 255, 255, 0.3);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    margin-left: 4px;
}

/* Sections */
section {
    margin-bottom: 60px;
}

section h2 {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 20px;
    text-align: center;
    color: #000;
}

section h3 {
    font-size: 1.4rem;
    font-weight: 400;
    margin: 30px 0 15px 0;
    color: #000;
}

section h4 {
    font-size: 1.2rem;
    font-weight: 400;
    margin: 25px 0 15px 0;
    color: #333;
}

section p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #333;
    margin-bottom: 15px;
}

/* Teaser */
.teaser {
    text-align: center;
    margin-bottom: 50px;
}

.teaser h2 {
    font-size: 1.3rem;
    font-weight: 400;
    color: #333;
    margin-bottom: 30px;
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
}

.teaser-image img {
    max-width: 80%;
    border-radius: 0;
    border: none;
}


/* Abstract & Method */
.abstract, .method {
    max-width: 900px;
    margin: 0 auto 60px;
    text-align: left;
}

.abstract h2, .method h2 {
    text-align: center;
}

.abstract p, .method p {
    text-align: justify;
}

.method-diagram img {
    width: 100%;
    border-radius: 4px;
    margin-top: 20px;
}


/* Experiments & Results */
.experiments {
    max-width: 1000px;
    margin: 0 auto;
}

.experiment-subsection {
    margin-bottom: 50px;
}

/* Tabs */
.tabs {
    margin-top: 30px;
}

.tab-buttons {
    display: flex;
    gap: 8px;
    background: #f8f9fa;
    padding: 6px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tab-button {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button:hover {
    color: #4285f4;
    background: rgba(66, 133, 244, 0.08);
}

.tab-button.active {
    color: white;
    background: #4285f4;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
    transform: translateY(-2px);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

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

.experiment-subsection:last-child {
    margin-bottom: 0;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    align-items: start;
}

.result-item img {
    width: 100%;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.video-item {
    text-align: center;
}

.video-item h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: #333;
}

.result-video {
    width: 100%;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #000;
}

.video-caption, .figure-caption {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* Video Comparison Layout - Shows RACE prominently */
.video-comparison-grid {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-top: 25px;
}

.video-item.featured {
    flex: 0 0 65%;
    position: relative;
}

.video-item-small {
    flex: 0 0 30%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.video-mini {
    position: relative;
}

.video-mini video {
    width: 100%;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.speed-badge-video {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #4285f4 0%, #3367d6 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.4);
}

.video-caption-small {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

.task-subtitle {
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: #333;
}

.task-description {
    font-size: 1rem;
    color: #666;
    margin-bottom: 20px;
    text-align: center;
}

/* Start Race Button */
.start-button-container {
    text-align: center;
    margin: 25px 0;
}

.start-race-btn {
    background: linear-gradient(135deg, #4285f4 0%, #3367d6 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.4);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.start-race-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.5);
    background: linear-gradient(135deg, #3367d6 0%, #2451b8 100%);
}

.start-race-btn:active {
    transform: translateY(0);
}

.start-race-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.start-icon {
    font-size: 1.2rem;
    line-height: 1;
}

/* Video Loading Indicator */
.video-item,
.video-mini {
    position: relative;
}

.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 0.95rem;
    display: none;
    z-index: 5;
    pointer-events: none;
}

.video-loading.show {
    display: block;
}

.video-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Dynamic task browser */
.dynamic-browser {
    margin-top: 30px;
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fafbff;
}


/* BibTeX */
.bibtex {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.bibtex h2 {
    margin-bottom: 20px;
}

.bibtex pre {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    text-align: left;
    overflow-x: auto;
    margin: 0 auto;
    max-width: 700px;
}

.bibtex code {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.5;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
    margin-top: 60px;
}

.footer p {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.footer a {
    color: #4285f4;
    text-decoration: none;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        max-width: 300px;
    }

    .title {
        font-size: 1.8rem;
    }

    .authors {
        font-size: 1rem;
    }

    .author {
        display: block;
        margin: 8px 0;
    }

    section h2 {
        font-size: 1.5rem;
    }

    section h3 {
        font-size: 1.2rem;
    }

    .results-grid, .video-grid {
        grid-template-columns: 1fr;
    }
    
    .video-comparison-grid {
        flex-direction: column;
    }
    
    .video-item.featured,
    .video-item-small {
        flex: 0 0 100%;
    }

    .container {
        padding: 15px;
    }

    .links {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }
}

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

    section h2 {
        font-size: 1.3rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Style */
::selection {
    background-color: #4285f4;
    color: white;
}