/* 
 * Main stylesheet for the Target-Bench website.
 * Defines global styles, layout structure, typography, and specific component styles 
 * including the evaluation pipeline and video comparison sections.
 */

/* Reset and Base Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: 'Noto Sans', sans-serif;
    font-size: 16px;
    line-height: 1.6; 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0;
    background: #fff;
    color: #4a4a4a;
}

a {
    color: #3273dc;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #363636;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: #363636;
    font-weight: 600;
    line-height: 1.125;
    font-family: 'Google Sans', sans-serif;
}

h1 { font-size: 2.5rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.75rem; margin-top: 3rem; margin-bottom: 1.5rem; text-align: center; }
h3 { font-size: 1.25rem; margin-bottom: 1rem; }
h4 { font-size: 1rem; letter-spacing: 0.5px; text-transform: uppercase; color: #7a7a7a; }

/* Header / Hero Section */
.header {
    text-align: center;
    padding: 3rem 1.5rem;
    background-color: #fff;
    margin-bottom: 2rem;
}

.title-section {
    margin-bottom: 2rem;
}

.title-row-1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 1rem;
}

.title-icon {
    height: 64px;
    width: auto;
    padding-bottom: 10px;
}

.title-row-1 .title-highlight {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(to right, #ff6600, #ff8533);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.3;
    padding-bottom: 10px;
}

.title-row-2 {
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.3;
    max-width: 900px;
    margin: 0 auto;
}

/* Authors and Affiliations */
.authors {
    margin-top: 1.5rem;
}

.author-names {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.author {
    color: #3273dc;
    cursor: pointer;
}

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

.affiliations {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 1.5rem 0 1rem 0;
    font-size: 1.2rem;
    color: #666;
}

.equal-contribution {
    margin: 1rem 0;
    font-size: 0.9rem;
    font-style: italic;
    color: #888;
}

/* Links / Buttons */
.links {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.links a {
    padding: 0.5rem 1.25rem;
    background-color: #363636;
    color: #fff;
    border-radius: 2rem; /* Rounded pill shape */
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center; /* 确保图标和文字在按钮内居中对齐 */
    gap: 8px;
    width: 125px; /* 固定宽度使所有按钮一致 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.links a:hover {
    background-color: #4a4a4a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    color: #fff;
}

.github-icon {
    fill: currentColor;
}

/* Main Content Container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Teaser Video Section */
.hero.teaser {
    padding-top: 0;
    margin-top: -2rem; /* Pull it up a bit towards the header */
}

.teaser .hero-body {
    padding-top: 0;
    padding-bottom: 3rem;
    text-align: center;
}

#teaser-video {
    max-width: 85%;
    margin: 0 auto;
    display: block;
    border: none;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    width: 100%;
}

/* Video Comparison Section */
.video-comparison {
    display: grid;
    grid-template-columns: 350px 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
    align-items: stretch;
    background: #fff;
}

.task-column {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.task-column img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    border-radius: 6px;
    border: none;
    margin-top: 10px;
}

.task-text {
    font-size: 1rem;
    line-height: 1.5;
    color: #4a4a4a;
    margin-bottom: 15px;
}

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

.video-column video {
    width: 100%;
    height: 180px;
    background: #000;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.video-column select {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    font-size: 1rem;
    border: 1px solid #dbdbdb;
    border-radius: 6px;
    background-color: #fff;
    box-shadow: inset 0 1px 2px rgba(10,10,10,0.1);
}

/* Custom Controls */
.controls {
    text-align: center;
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.controls button {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    cursor: pointer;
    background-color: #3273dc;
    color: #fff;
    border: none;
    border-radius: 6px;
    transition: background-color 0.2s;
    font-family: 'Google Sans', sans-serif;
    font-weight: 500;
}

.controls button:hover {
    background-color: #276cda;
}

.controls button:disabled {
    background-color: #b5b5b5;
    cursor: not-allowed;
}

#prevBtn, #nextBtn {
    background-color: #ff6600;
}

#prevBtn:hover, #nextBtn:hover {
    background-color: #e65c00;
}

.sample-info {
    text-align: center;
    margin: 1rem 0;
    font-size: 1.1rem;
    color: #666;
    font-weight: 500;
}

/* Video Player Controls (Mini) */
.video-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 6px;
}

.play-btn {
    min-width: 32px;
    height: 32px;
    padding: 0;
    background: #363636;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

.play-btn:hover {
    transform: scale(1.1);
    background: #4a4a4a;
}

.progress-bar {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #dbdbdb;
    cursor: pointer;
}

.time-display {
    font-size: 0.8rem;
    font-family: monospace;
    color: #666;
}

/* Evaluation Pipeline */
.evaluation-pipeline {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #dbdbdb;
}

.pipeline-wrapper {
    display: flex;
    gap: 20px;
    align-items: stretch; /* Ensures equal height for sidebar and content */
}

.section-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1), 0 0px 0 1px rgba(10, 10, 10, 0.02);
    padding: 30px;
}

.pipeline-sidebar {
    width: 37%;
    flex-shrink: 0;
    position: relative; /* For potential absolute positioning if needed, but flex item usually fine */
}

.pipeline-sidebar img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensures image fits within the container without distortion */
    object-position: top; /* Aligns image to the top to remove visual top margin */
    border-radius: 12px;
    display: block;
}

.pipeline-content {
    width: 60%;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pipeline-step {
    margin-bottom: 50px;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1), 0 0px 0 1px rgba(10, 10, 10, 0.02);
}

.pipeline-step h3 {
    color: #363636;
    border-bottom: 2px solid #f5f5f5;
    padding-bottom: 10px;
    display: inline-block;
    margin-bottom: 25px;
}

.step-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px;
}

.step-header h3 {
    margin: 0; 
    padding: 0; 
    border: none;
}

.step-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.media-row-header {
    display: flex; 
    gap: 20px; 
    width: 100%; 
    margin-bottom: 10px;
}

.media-row-header p {
    flex: 1; 
    text-align: center;
}

.media-row {
    display: flex; 
    gap: 20px; 
    width: 100%;
}

.media-row .pipeline-image,
.media-row video {
    flex: 1; 
    width: 0; 
    object-fit: cover; 
    border-radius: 6px;
}


.pipeline-image {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    border-radius: 6px;
    border: none;
    box-shadow: none;
}

.action-btn {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    background-color: #48c774; /* Green for action */
    color: white;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    margin: 0;
    margin-bottom: 20px; /* Default margin, overridden in specific contexts if needed but safest to keep for standalone use */
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-weight: 600;
    width: 200px; /* Fixed width to ensure all pipeline buttons (Generate, Reconstruct, Extract) match the widest one */
    text-align: center;
}

.step-header .action-btn {
    margin-bottom: 0;
}

.action-btn:hover {
    background-color: #3ec46d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.action-btn:disabled {
    background-color: #b5b5b5;
    transform: none;
    box-shadow: none;
    cursor: default;
}

/* Result Containers */
.result-container {
    min-height: 100px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    border: 2px dashed #dbdbdb;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.result-container.empty {
    background: #fafafa;
}

#containerGenerate,
#containerReconstruct,
#containerExtract,
#containerEvaluate {
    height: 300px; /* Fixed height to maintain layout stability before/after generation as requested */
    min-height: 300px;
}

.result-container video,
.result-container img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.result-container model-viewer {
    width: 100%;
    height: 500px;
    background-color: #fafafa;
    border-radius: 8px;
}

.evaluation-score {
    font-size: 1.8rem;
    color: #209cee; /* Blue instead of green for better contrast */
    font-weight: 700;
    padding: 30px;
    border: 3px solid #209cee;
    border-radius: 15px;
    background: #f0f8ff;
    text-align: center;
    box-shadow: 0 4px 10px rgba(32, 156, 238, 0.2);
}

/* Responsive */
@media (max-width: 900px) {
    .video-comparison {
        grid-template-columns: 1fr;
    }
    
    .task-column {
        margin-top: 0;
    }
    
    .title-row-1 .title-highlight {
        font-size: 2rem;
    }
    
    .title-row-2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Pipeline Responsive */
    .pipeline-wrapper {
        flex-direction: column;
    }
    
    .pipeline-sidebar {
        width: 100%;
        height: auto;
        margin-bottom: 20px;
    }
    
    .pipeline-sidebar img {
        height: auto; /* Reset height constraint on mobile */
        max-height: 500px;
    }
    
    .pipeline-content {
        width: 100%;
    }
}
