/* ============================================
   S²AM3D Website Styles
   ============================================ */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --accent-color: #f59e0b;
    --bg-color: #fafafa;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #e8f4fc 0%, #dae8f5 50%, #e5eff8 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ============================================
   Header Section
   ============================================ */

.header-section {
    text-align: center;
    padding: 30px 0 40px;
}

.title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 600;
    margin-bottom: 32px;
    line-height: 1.3;
}

.title-method {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.title-method sup {
    font-size: 0.5em;
    vertical-align: super;
}

.title-separator {
    color: var(--text-primary);
}

.title-desc {
    color: var(--text-primary);
    font-weight: 500;
}

.author-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    margin-bottom: 16px;
}

.author {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.author sup {
    font-size: 0.7em;
    color: var(--primary-color);
    margin-left: 2px;
}

.affiliation {
    font-size: 1rem;
    color: var(--text-primary);
}

.affiliation sup {
    font-size: 0.8em;
    color: var(--primary-color);
    margin-right: 4px;
}

.corresponding-author {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-top: 8px;
}

/* ============================================
   Links Section
   ============================================ */

.links-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 50px;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.link-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.link-btn i {
    font-size: 1.2rem;
}

.link-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f3f4f6;
}

.link-btn.disabled:hover {
    border-color: var(--border-color);
    color: var(--text-secondary);
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* ============================================
   Section Styles
   ============================================ */

.section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
    display: inline-block;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.7;
}

/* ============================================
   Abstract Section
   ============================================ */

.abstract-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    text-align: justify;
}

.abstract-text strong {
    color: var(--primary-color);
    font-weight: 600;
}

.abstract-text em {
    font-style: italic;
    color: var(--text-primary);
}

/* ============================================
   Pipeline Section
   ============================================ */

.pipeline-container {
    margin: 20px 0;
    text-align: center;
}

.pipeline-img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.caption {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary-color);
}

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

.caption em {
    color: var(--primary-color);
    font-style: normal;
    font-weight: 500;
}

/* ============================================
   Demo Video Grid
   ============================================ */

.demo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .demo-grid {
        grid-template-columns: 1fr;
    }
}

.demo-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: #000;
}

.demo-item video {
    width: 100%;
    height: auto;
    display: block;
  }

/* ============================================
   3D Mesh Gallery
   ============================================ */

.mesh-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 1024px) {
    .mesh-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .mesh-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .mesh-gallery {
        grid-template-columns: 1fr;
    }
}

.mesh-gallery model-viewer {
    width: 100%;
    height: 220px;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    --poster-color: transparent;
    filter: saturate(2) contrast(1.15);
}

.mesh-gallery model-viewer:hover {
    box-shadow: var(--shadow-lg);
    transform: scale(1.02);
}

/* ============================================
   Scale Demo Section
   ============================================ */

.scale-demo-section {
    text-align: center;
}

.object-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.obj-btn {
    padding: 10px 24px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.obj-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.obj-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.scale-demo-viewer {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.scale-demo-viewer model-viewer {
    width: 100%;
    max-width: 500px;
    height: 400px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    filter: saturate(1.4) contrast(1.15);
}

.scale-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.scale-btn {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scale-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.scale-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.scale-hint {
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 8px;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (max-width: 768px) {
    .scale-demo-viewer model-viewer {
        height: 300px;
    }
    
    .object-selector {
        gap: 8px;
    }
    
    .obj-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .scale-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* ============================================
   Dataset Section
   ============================================ */

.dataset-container {
    text-align: center;
        margin-top: 20px;
}

.dataset-img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   Citation Section
   ============================================ */

.citation-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.citation-note {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.citation-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 24px;
    border-radius: var(--radius-md);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

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

.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

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

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

@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }

    .section {
        padding: 24px 20px;
    }

    .header-section {
        padding: 40px 0 30px;
    }

    .author-list {
        gap: 4px 16px;
    }

    .author {
        font-size: 1rem;
    }

    .links-section {
        gap: 12px;
    }

    .link-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* ============================================
   Animations
   ============================================ */

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

.section {
    animation: fadeInUp 0.6s ease-out;
}

.header-section {
    animation: fadeInUp 0.8s ease-out;
}

/* Staggered animation for mesh gallery */
.mesh-gallery model-viewer {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.mesh-gallery model-viewer:nth-child(1) { animation-delay: 0.05s; }
.mesh-gallery model-viewer:nth-child(2) { animation-delay: 0.1s; }
.mesh-gallery model-viewer:nth-child(3) { animation-delay: 0.15s; }
.mesh-gallery model-viewer:nth-child(4) { animation-delay: 0.2s; }
.mesh-gallery model-viewer:nth-child(5) { animation-delay: 0.25s; }
.mesh-gallery model-viewer:nth-child(6) { animation-delay: 0.3s; }
.mesh-gallery model-viewer:nth-child(7) { animation-delay: 0.35s; }
.mesh-gallery model-viewer:nth-child(8) { animation-delay: 0.4s; }
.mesh-gallery model-viewer:nth-child(9) { animation-delay: 0.45s; }
.mesh-gallery model-viewer:nth-child(10) { animation-delay: 0.5s; }
.mesh-gallery model-viewer:nth-child(11) { animation-delay: 0.55s; }
.mesh-gallery model-viewer:nth-child(12) { animation-delay: 0.6s; }
.mesh-gallery model-viewer:nth-child(13) { animation-delay: 0.65s; }
.mesh-gallery model-viewer:nth-child(14) { animation-delay: 0.7s; }
.mesh-gallery model-viewer:nth-child(15) { animation-delay: 0.75s; }
.mesh-gallery model-viewer:nth-child(16) { animation-delay: 0.8s; }
