/* static/css/main.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: white;
}

/* Layout Components */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.section-header {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.common-section {
    background: white;
    padding: 40px 0 30px 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 0;
    border-bottom: 1px solid #e9ecef;
}

.common-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* Logo and Title Container */
.logo-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 5px; 
}

.logo-img {
    width: 60px; 
    height: auto; 
    border-radius: 8px; 
    object-fit: contain; 
    max-height: 50px; 
}

.publication-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 5px 0; 
    letter-spacing: -0.02em;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    white-space: nowrap;
}

.publication-subtitle {
    font-size: 1.5rem;
    color: #333;
    font-weight: 400;
    margin-bottom: 20px; 
    line-height: 1.3; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}


.authors-section {
    text-align: center;
    margin: 20px 0; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}


.author-block {
    font-size: 0.98rem;
    color: #2c3e50;
    margin: 0 4px;
    font-weight: 500;
    line-height: 1.5; 
}


.author-notes {
    margin: 12px 0 8px 0; 
    font-size: 1.05rem;
    color: #141414;
    line-height: 1.4;
}

.affiliations {
    margin-top: 8px; 
    font-size: 1rem;
    color: #141414;
    font-style: italic;
}

.publication-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.line-break {
    flex-basis: 100%;
    height: 0;
}


.authors-section > div {
    margin: 3px 0;
}

.authors-section br {
    line-height: 0.8;
}

.link-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #333;
    color: white;
    text-decoration: none;
    border-radius: 30px;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.link-button:hover {
    background: #555;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.link-button i {
    font-size: 1.2rem;
}

header {
    background: #f8f9fa;
    padding: 15px 0 10px;
    margin-bottom: 15px;
    margin-top: 0;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
}

/* Main Content Layout */
.main-content {
    display: flex;
    gap: 30px;
    min-height: 600px; 
    align-items: flex-start; 
}

/* Tabs */
.tabs-container {
    flex: 0 0 300px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
    height: fit-content; 
    max-height: 80vh;  
    overflow-y: auto;  
    position: sticky; 
    top: 20px;
}

.tab {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.tab:hover {
    background: #f0f0f0;
}

.tab.active {
    background: #e3f2fd;
    border-color: #2196F3;
}

.tab-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.tab-description {
    font-size: 0.9rem;
    color: #666;
}

/* Content Area */
.content-area {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow-y: auto;
    border: 1px solid #e9ecef;
    min-height: 700px;
    max-height: 80vh;
}

.case-content {
    display: none;
}

.case-content.active {
    display: block;
}

.section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}


.image-container {
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container img {
    max-width: 100%;
    max-height: 500px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Question Box */
.question-box {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2196F3;
}

/* Thinking Process */
.thinking-process {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.8;
    white-space: pre-line;
    word-wrap: break-word;
}

.thinking-process code {
    background-color: #e8e8e8;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.answer-container {
    text-align: left; 
    margin-top: 20px;
}

.answer-box {
    background: #e8f5e9; 
    color: #2e7d32;
    padding: 20px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    display: inline-block;
    min-width: 100px;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
    text-align: center;
    border: 1px solid #a5d6a7;
    line-height: 1.6;
    max-width: 100%;
}

/* Code Container */
.code-container {
    margin-bottom: 20px;
    position: relative;
}

/* Result Images */
.result-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.result-image {
    border-radius: 8px;
    text-align: center;
}

.result-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
}

.result-image-caption {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0;
}

/* Result Item for text/number results */
.result-item {
    font-family: 'Courier New', Consolas, Monaco, monospace;
    text-align: left;
}

.result-item .code-block {
    font-size: 1.8rem;
    display: inline-block;
}

.code-container pre[class*="language-"] {
    background-color: #2d2d2d !important;
    color: #f8f8f2 !important;
}

.code-container code[class*="language-"] {
    background-color: transparent !important;
    color: inherit !important;
}

.abstract-section {
    background-color: #ffffff;
    padding: 30px 0;
    border-bottom: 1px solid #e0e0e0;
}

.abstract-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.abstract-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
}

.abstract-content {
    max-width: 930px;
    margin: 0 auto;
    text-align: justify;
    line-height: 1.8;
}

.abstract-content p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 15px;
}

.abstract-content p:last-child {
    margin-bottom: 0;
}

/* Citation Section Styles */
.citation-section {
    background-color: #f8f9fa;
    padding: 10px 0;
    margin-top: 0px;
    border-top: 1px solid #e0e0e0;
}

.citation-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.citation-title {
    text-align: center;
    font-size: 2.0rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
}

.citation-content {
    max-width: 900px;
    margin: 0 auto;
}

.citation-content pre {
    background-color: #2d2d2d;
    border-radius: 8px;
    padding: 10px;
    overflow-x: auto;
}

.citation-content code {
    color: #f8f8f2;
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre;
}

/* Responsive Design */
@media (max-width: 768px) {
    .publication-title {
        font-size: 2.5rem;
    }

    .logo-title {
        flex-direction: column;
        gap: 10px;
    }

    .logo-img {
        width: auto;
        height: 50px; 
        max-width: 100px;
        border-radius: 6px;
    }

    .author-block {
        display: inline-block;
        margin: 3px;
        font-size: 1.1rem;
    }

    .publication-links {
        gap: 8px;
    }

    .link-button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    header {
        padding: 15px 0 10px;
        margin-bottom: 15px;
    }

    .main-content {
        flex-direction: column;
        min-height: auto;
    }

    .tabs-container {
        flex: none;
        width: 100%;
        max-height: 300px;
        position: static; 
        height: auto;
    }

    .content-area {
        min-height: 500px;
    }

    .image-container {
        min-height: 300px;
    }

    .image-container img {
        max-height: 400px;
    }

    h1 {
        font-size: 2rem;
    }

    .abstract-section {
        padding: 20px 0;
    }
    
    .abstract-section .container {
        padding: 0 20px;
    }
    
    .abstract-title {
        font-size: 2rem;
        margin-bottom: 20px;
    }
    
    .abstract-content p {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .citation-section {
        padding: 30px 0;
        margin-top: 20px;
    }
    
    .citation-section .container {
        padding: 0 20px;
    }
    
    .citation-title {
        font-size: 2rem;
        margin-bottom: 20px;
    }
    
    .citation-content code {
        font-size: 12px;
    }
}

@media (max-width: 1200px) {
    .abstract-section .container {
        max-width: 100%;
        padding: 0 60px;
    }
    
    .abstract-content {
        max-width: 100%;
    }

    .citation-section .container {
        max-width: 100%;
        padding: 0 60px;
    }
    
    .citation-content {
        max-width: 100%;
    }
}

/* Flexible Case Styles */
.case-container {
    width: 100%;
}

.section {
    margin-bottom: 30px;
}

.section:last-child {
    margin-bottom: 0;
}

.image-section .image-container {
    text-align: center;
}

.image-caption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.thinking-round {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.thinking-round-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.thinking-round .thinking-section {
    margin-bottom: 15px;
}

.thinking-round .thinking-section:last-child {
    margin-bottom: 0;
}


.error {
    color: #d32f2f;
    padding: 20px;
    text-align: center;
    background: #ffebee;
    border-radius: 8px;
}

.figure-section {
    background-color: #ffffff;
    padding: 15px 0 25px 0;
}

.figure-block {
    max-width: 1000px;
    margin: 0 auto 25px;
    padding: 0 0 25px 0;
    border-bottom: 1px solid #f0f0f0;
}

.figure-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.figure-block-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
    text-align: center;
}

.figure-content {
    text-align: center;
}

.figure-content img {
    width: 100%;
    max-width: 700px;
    height: auto;
    margin: 0 auto 20px;
    display: block;
}

.underline {
    text-decoration: underline;
}

.gold-text {
    color: #b8860b;
    font-weight: 500;
}

.figure-caption {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
    padding: 0 20px;
}

.figure-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 40px auto 0;
}

.figure-grid-item {
    text-align: center;
}

.figure-grid-item img {
    width: 100%;
    max-width: 250px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 0 auto 10px;
    display: block;
}

.figure-grid-item .caption {
    font-size: 0.95rem;
    font-weight: 500;
    color: #555;
    margin-top: 8px;
}

@media (max-width: 968px) {
    .figure-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    .figure-block {
        margin-bottom: 30px;
        padding-bottom: 30px;
    }
    
    .figure-block-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .figure-content img {
        max-width: 100%;
    }
    
    .figure-caption {
        font-size: 0.95rem;
        padding: 0 20px;
    }
    
    .figure-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        max-width: 400px;
    }
    
    .figure-grid-item img {
        max-width: 300px;
    }
}

/* Math and Table Styles */
.latex-table {
    border-collapse: collapse;
    margin: 15px auto;
    font-family: 'Times New Roman', serif;
    background: white;
}

.latex-table.bordered {
    border: 2px solid #333;
}

.latex-table th,
.latex-table td {
    padding: 8px 12px;
    text-align: center;
    vertical-align: middle;
}

.latex-table.bordered th,
.latex-table.bordered td {
    border: 1px solid #333;
}

.latex-table th {
    font-weight: bold;
    background-color: #f5f5f5;
}

/* Math expressions styling */
.tex2jax_process {
    font-family: 'Times New Roman', serif;
    line-height: 1.6;
}

/* Ensure math displays properly */
mjx-container {
    display: inline-block !important;
    margin: 0.1em 0;
}

mjx-container[display="true"] {
    display: block !important;
    text-align: center;
    margin: 1em 0;
}

.zoomable-image {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.zoomable-image:hover {
    opacity: 0.9;
}

.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.image-viewer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.image-viewer-container {
    position: relative;
    width: 90vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
}

.image-viewer-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    z-index: 10001;
}

.image-viewer-close:hover {
    color: #ccc;
}

.image-viewer-content {
    position: relative;
    overflow: hidden;
    background: black;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1; 
    min-height: 0; 
}

.image-viewer-content img {
    max-width: none;
    max-height: none;
    cursor: grab;
    transition: transform 0.1s ease;
    transform-origin: center center;
}

.image-viewer-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.image-viewer-controls button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.image-viewer-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
}