/* ========================================
   Stiffness Copilot - Research Project Website
   Clean academic style
   ======================================== */

/* CSS Variables */
:root {
    --text-primary: #363636;
    --text-body: #4a4a4a;
    --text-light: #7a7a7a;
    --link-color: hsl(204, 86%, 53%);
    --link-hover: hsl(204, 86%, 43%);
    --bg-primary: #ffffff;
    --bg-light: #fafafa;
    --border-color: #dbdbdb;
    --max-width: 1024px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Google Sans', 'Noto Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-body);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========================================
   Page Header
   ======================================== */
.page-header {
    padding: 2.5rem 0 1.5rem;
    text-align: center;
}

.page-title {
    font-family: 'Google Sans', 'Inter', sans-serif;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    line-height: 1.2;
}

/* Authors */
.authors-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-bottom: 1rem;
}

.author-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 110px;
}

.author-avatar {
    width: 80px;
    height: 80px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    overflow: hidden;
}

.author-avatar a,
.author-avatar img {
    display: block;
    width: 100%;
    height: 100%;
}

.author-avatar img {
    object-fit: cover;
}

.author-name {
    font-size: 0.88rem;
    color: var(--text-body);
    line-height: 1.3;
    text-align: center;
}

.author-name a {
    color: var(--link-color);
    font-weight: 400;
}

.author-name sup {
    color: var(--text-light);
    font-weight: 400;
    font-size: 0.7rem;
}

.affiliations {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 0.4rem;
}

.affiliation {
    font-size: 0.9rem;
    color: var(--text-body);
}

.affiliation sup {
    color: var(--text-light);
    font-weight: 400;
    font-size: 0.7rem;
}

.internship-note {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
    margin-bottom: 1.25rem;
}

/* Header Buttons */
.header-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #fafafa;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
    text-decoration: none;
    background: #f0f0f0;
    border-color: #999;
}

.btn i {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Teaser Figure */
.teaser-figure {
    margin-top: 1.5rem;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

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

.teaser-caption {
    margin-top: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    text-align: justify;
}

.teaser-caption strong {
    color: var(--text-body);
}

/* ========================================
   Sections
   ======================================== */
.section {
    padding: 2.5rem 0;
}

.section-alt {
    background-color: var(--bg-light);
}

.section-title {
    font-family: 'Google Sans', 'Inter', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.section-description {
    text-align: center;
    color: var(--text-light);
    max-width: 800px;
    margin: -0.5rem auto 1.5rem;
    font-size: 1.0rem;
    line-height: 1.6;
}

/* ========================================
   Abstract
   ======================================== */
.abstract-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.8;
}

.abstract-content p {
    margin-bottom: 1rem;
    text-align: justify;
}

/* ========================================
   Visualizations
   ======================================== */
.visualization-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.tab-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 0.25rem;
}

.experiment-summary {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-body);
    margin: 0.25rem 0 0;
    font-style: italic;
}

.condition-description {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0.15rem 0 0.25rem;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    color: var(--text-body);
}

.tab-btn:hover {
    border-color: var(--link-color);
    color: var(--link-color);
}

.tab-btn.active {
    background: var(--link-color);
    border-color: var(--link-color);
    color: white;
}

/* Visualization Player */
.viz-player {
    background: #1a1a2e;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.viz-row {
    display: flex;
    gap: 2px;
    background: #2d2d3a;
}

.viz-row-main {
    display: grid;
    grid-template-columns: 0.7fr 1fr 1.15fr 1fr;
    gap: 2px;
}

.viz-panel {
    background: #1a1a2e;
    flex: 1;
    min-width: 0;
}

.viz-panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #252538;
    color: #9ca3af;
    font-size: 0.8rem;
    font-weight: 500;
    border-bottom: 1px solid #3d3d50;
    white-space: nowrap;
}

.viz-panel-header i {
    color: var(--link-color);
}

.viz-panel-hint {
    margin-left: auto;
    font-size: 0.7rem;
    color: #6b7280;
}

.viz-panel-content {
    position: relative;
    background: #0f0f1a;
}

.viz-panel-note {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.3rem 0.6rem;
    background: rgba(37, 37, 56, 0.88);
    color: #9ca3af;
    font-size: 0.7rem;
    line-height: 1.4;
}

.viz-panel-content video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.video-crop-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.video-crop-wrapper video {
    width: 150%;
    height: 100%;
    margin-left: -25%;
    object-fit: cover;
}

.video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    color: #4b5563;
}

.viz-row-main .viz-panel-content {
    height: 280px;
}

.video-placeholder i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.video-placeholder p {
    font-size: 0.85rem;
    margin: 0;
}

/* 3D View */
#viz-3d-container {
    width: 100%;
    height: 100%;
    background: #1a1a2e;
}

#viz-3d-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Force Chart */
.viz-panel-chart .viz-panel-content {
    padding: 0.25rem 0.25rem 0.25rem 0;
}

#viz-force-chart {
    width: 100%;
    height: 100%;
}

/* Timeline Bar */
.viz-timeline-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #252538;
    border-top: 1px solid #3d3d50;
}

.viz-controls-left,
.viz-controls-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.viz-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--link-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.viz-btn:hover {
    background: var(--link-hover);
}

.viz-btn i {
    font-size: 0.8rem;
}

.viz-time {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: #9ca3af;
    min-width: 110px;
}

.viz-timeline-wrapper {
    flex: 1;
    padding: 0 0.5rem;
}

.viz-timeline {
    position: relative;
    height: 6px;
    background: #3d3d50;
    border-radius: 3px;
    cursor: pointer;
}

.viz-timeline-track {
    position: absolute;
    inset: 0;
    border-radius: 3px;
}

.viz-timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--link-color);
    border-radius: 3px;
    width: 0%;
    transition: width 0.05s linear;
}

.viz-timeline-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    cursor: grab;
}

.viz-timeline-handle:hover {
    transform: translate(-50%, -50%) scale(1.15);
}

.viz-timeline-handle:active {
    cursor: grabbing;
}

.viz-speed-control {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #9ca3af;
    font-size: 0.8rem;
}

.viz-speed-control select {
    background: #3d3d50;
    border: 1px solid #4b5563;
    border-radius: 4px;
    color: white;
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.viz-speed-control select:focus {
    outline: none;
    border-color: var(--link-color);
}

/* Instructions */
.viz-instructions {
    margin-top: 1rem;
    text-align: center;
}

.viz-instructions p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.85rem;
}

.viz-instructions kbd {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.75rem;
    background: #eee;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.viz-instructions i {
    color: var(--link-color);
    margin-right: 0.25rem;
}

/* ========================================
   Citation
   ======================================== */
.citation-box {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1.25rem;
    max-width: 700px;
    margin: 1rem auto 0;
    position: relative;
}

.citation-box pre {
    margin: 0;
    overflow-x: auto;
}

.citation-box code {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.825rem;
    color: var(--text-body);
    line-height: 1.6;
    display: block;
    white-space: pre-wrap;
}

.copy-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.35rem 0.75rem;
    background: white;
    color: var(--text-body);
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: background 0.15s;
}

.copy-btn:hover {
    background: #eee;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    padding: 1.5rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer p {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.4rem;
    }

    .authors-row {
        gap: 16px;
    }

    .author-block {
        width: 85px;
    }

    .author-avatar {
        width: 64px;
        height: 64px;
    }

    .author-name {
        font-size: 0.78rem;
    }

    .affiliations {
        flex-direction: column;
        gap: 0.2rem;
    }

    .section {
        padding: 2rem 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

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

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

    .viz-row-main {
        grid-template-columns: 1fr 1fr;
    }

    .viz-timeline-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .viz-controls-left {
        order: 1;
    }

    .viz-timeline-wrapper {
        order: 3;
        width: 100%;
        flex: none;
    }

    .viz-controls-right {
        order: 2;
        margin-left: auto;
    }

    .viz-time {
        min-width: auto;
        font-size: 0.7rem;
    }

    #viz-3d-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .page-title {
        font-size: 1.15rem;
    }
}
