/* ===== Pro-Pose Project Page — Clean Academic Style ===== */

:root {
    --primary: #1a1a2e;
    --secondary: #555770;
    --accent: #5e60ce;
    --accent-light: #7b7fda;
    --accent-bg: #f0f0ff;
    --bg: #ffffff;
    --bg-alt: #fafafe;
    --border: #e8e8ef;
    --text: #2b2d42;
    --text-light: #6c6f85;
    --font: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --heading-font: 'Google Sans', 'Noto Sans', sans-serif;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --max-width: 980px;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px 40px;
}

/* ===== Tab Bar ===== */
.tab-bar {
    display: flex;
    justify-content: center;
    gap: 2px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    padding: 10px 0 0;
    margin: 24px 0 0;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    font-family: var(--heading-font);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
    border-radius: 6px 6px 0 0;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--accent);
    background: var(--bg-alt);
}

.tab-btn.tab-active {
    color: var(--accent);
    font-weight: 700;
}

.tab-btn.tab-active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    border-radius: 3px 3px 0 0;
}

/* Tab panels */
.tab-panel {
    display: none;
}

.tab-panel.tab-visible {
    display: block;
}

/* ===== Typography ===== */

h1, h2, h3 {
    font-family: var(--heading-font);
    color: var(--primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.25;
    color: var(--primary);
}

/* ===== Header / Authors ===== */

.authors {
    text-align: center;
    margin-top: 20px;
    font-size: 1.05rem;
    line-height: 2;
}

.author {
    margin: 0 6px;
    display: inline-block;
    white-space: nowrap;
}

.author a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.author a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.affiliations {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-light);
    margin-top: 8px;
    margin-bottom: 28px;
}

/* ===== Buttons ===== */

.links {
    text-align: center;
    margin-bottom: 48px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #fff;
    padding: 10px 22px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.2s, transform 0.15s;
    border: none;
}

.btn:hover {
    background: #2e2e4a;
    transform: translateY(-1px);
}

.btn.disabled {
    background: var(--bg-alt);
    color: #aaa;
    cursor: not-allowed;
    pointer-events: none;
    border: 1px solid var(--border);
}

.btn i {
    margin-right: 2px;
    font-size: 0.9em;
}

/* ===== Teaser ===== */

.teaser {
    text-align: center;
    margin-bottom: 56px;
}

.teaser img {
    max-width: 100%;
    border-radius: var(--radius);
}

.caption {
    margin-top: 14px;
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    line-height: 1.6;
}

/* ===== Sections ===== */

.section {
    margin-bottom: 56px;
    padding: 0;
}

.section-title {
    font-size: 1.6rem;
    margin-bottom: 24px;
    text-align: center;
    position: relative;
    width: 100%;
    display: block;
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--accent);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* ===== Abstract & Method text ===== */

.abstract p, .method p {
    text-align: justify;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 16px;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Instruction Box ===== */

.instruction-box {
    background-color: var(--accent-bg);
    border: 1px solid #d8d8f0;
    padding: 12px 24px;
    margin: 20px auto 10px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    color: var(--text-light);
    text-align: center;
    max-width: 700px;
    width: fit-content;
}

.instruction-box strong {
    color: var(--text);
}

/* ===== Tables (kept for fallback) ===== */

.table-container {
    margin: 0 auto 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background-color: var(--bg);
    overflow: hidden;
    max-width: 100%;
    width: 100%;
}

.table-container h3 {
    margin: 20px 0 0;
    text-align: center;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--primary);
}

.hover-hint {
    display: none;
}

.table-content {
    max-height: none;
    overflow-x: auto;
    padding: 0 12px 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    background-color: var(--bg);
}

th, td {
    padding: 10px 14px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    color: var(--text-light);
    background-color: var(--bg-alt);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: var(--bg-alt);
}

.highlight-row td {
    background-color: var(--accent-bg);
    font-weight: 600;
    color: var(--accent);
}

.highlight-row:hover td {
    background-color: #e4e4fa;
}

td.best {
    font-weight: 700;
    color: #c0392b;
}

td.second-best {
    font-weight: 700;
    color: var(--accent);
}

.table-caption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 8px;
    font-style: italic;
}

/* ===== Results Charts ===== */

.results-charts {
    max-width: 100%;
    margin: 0 auto 40px;
}

.dataset-tabs {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 28px;
    background: var(--bg-alt);
    border-radius: 8px;
    padding: 4px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.dataset-tab {
    padding: 9px 24px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-light);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}

.dataset-tab:hover {
    color: var(--text);
}

.dataset-tab.active {
    background: var(--bg);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 600;
}

/* Chart table layout: method labels + 4 metric columns per row */
.chart-row {
    display: grid;
    grid-template-columns: 130px repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 700px) {
    .chart-row {
        grid-template-columns: 100px repeat(4, 1fr);
        gap: 6px;
    }
}

/* The method labels column */
.chart-methods {
    display: flex;
    flex-direction: column;
    padding-top: 32px; /* align with bars below headers */
}

.chart-method-label {
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-size: 0.73rem;
    color: var(--text-light);
    margin-bottom: 4px;
    white-space: nowrap;
}

.chart-method-label.method-ours {
    color: var(--accent);
    font-weight: 700;
}

/* Individual metric column */
.metric-col {
    display: flex;
    flex-direction: column;
}

.metric-col-header {
    font-family: var(--heading-font);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    text-align: center;
    margin-bottom: 8px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.metric-col-header .arrow-up { color: #27ae60; }
.metric-col-header .arrow-down { color: #c0392b; }

.metric-bar-row {
    height: 22px;
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.metric-bar-track {
    flex: 1;
    height: 18px;
    background: var(--bg-alt);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.metric-bar-fill {
    height: 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: #c8c8d4;
}

.metric-bar-fill.fill-ours {
    background: var(--accent);
}

.metric-bar-fill.fill-best {
    background: var(--primary);
}

.metric-bar-fill.fill-ours.fill-best {
    background: var(--accent);
}

.metric-bar-val {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text);
    pointer-events: none;
}

.metric-bar-fill.fill-best ~ .metric-bar-val,
.metric-bar-fill.fill-ours ~ .metric-bar-val {
    color: #fff;
}

/* ===== BibTeX ===== */

.bibtex {
    text-align: left;
    background-color: #1e1e2e;
    color: #cdd6f4;
    padding: 20px 24px;
    border-radius: var(--radius);
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.82rem;
    overflow-x: auto;
    white-space: pre;
    border: 1px solid #313244;
    line-height: 1.6;
    position: relative;
}

/* ===== Method / Analysis Blocks ===== */

.method-block, .analysis-block {
    background-color: var(--bg);
    border: 1px solid var(--border);
    padding: 28px;
    margin-bottom: 32px;
    border-radius: var(--radius);
    transition: box-shadow 0.2s;
}

.method-block:hover, .analysis-block:hover {
    box-shadow: var(--shadow-md);
}

/* Deep-dive identity section after charts */
.identity-deep-dive {
    margin-top: 40px;
    padding: 28px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.identity-deep-dive .subsection-title {
    font-family: var(--heading-font);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 14px;
}

.identity-deep-dive p {
    text-align: justify;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.identity-deep-dive .figure-container {
    margin: 20px 0;
}

.method-block p, .analysis-block p {
    text-align: justify;
    max-width: 100%;
    font-size: 0.95rem;
    line-height: 1.7;
}

.analysis-block h3 {
    font-size: 1.15rem;
    margin-bottom: 12px;
}

.analysis-block ul {
    text-align: left;
    max-width: 100%;
    margin: 16px auto;
    padding-left: 20px;
    line-height: 1.7;
}

.analysis-block li {
    margin-bottom: 8px;
    color: var(--text);
}

/* ===== Images / Figures ===== */

.image-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.image-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.image-col img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius);
}

.figure-container {
    text-align: center;
    margin: 24px auto 12px;
    max-width: 100%;
}

.figure-container img {
    height: 380px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.figure-container.full-width-figure img {
    height: auto;
    width: 100%;
}

/* Dual figure layout */
.dual-figure-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 8px;
}

.dual-figure-item {
    display: flex;
    flex-direction: column;
}

.fig-item-1 { flex: 1.0; }
.fig-item-2 { flex: 1.47; }

.dual-figure-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius);
    margin-bottom: 4px;
}

.sub-caption {
    text-align: center;
    font-weight: 600;
    color: var(--primary);
    font-size: 1rem;
    margin-top: 4px;
}

.figure-container img.tall-image {
    height: 580px;
}

.figure-container .caption {
    font-size: 0.88rem;
    color: var(--text-light);
    text-align: justify;
    margin-top: 8px;
    padding: 0 20px;
    line-height: 1.55;
}

.figure-container .caption strong {
    color: var(--primary);
}

/* ===== Footer ===== */

footer {
    text-align: center;
    margin-top: 64px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    color: var(--text-light);
    font-size: 0.88rem;
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
    .container {
        padding: 32px 16px 24px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .links {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .dual-figure-row {
        flex-direction: column;
    }

    .figure-container img {
        height: auto;
        width: 100%;
    }

    .figure-container img.tall-image {
        height: auto;
    }

    .figure-container .caption {
        padding: 0;
    }
}

/* ===== Highlight Colors ===== */

.highlight-red {
    color: #c0392b;
    font-weight: 700;
}

.highlight-blue {
    color: var(--accent);
    font-weight: 700;
}
