/* Academic Paper Style CSS */

:root {
    --primary-color: #0066cc;
    --primary-dark: #004c99;
    --secondary-color: #6c757d;
    --bg-color: #ffffff;
    --bg-alt: #f8f9fa;
    --text-color: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
}

* {
    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: var(--text-color);
    background-color: var(--bg-alt);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Paper Header */
.paper-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0 3rem;
    text-align: center;
}

.paper-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.paper-subtitle {
    font-size: 1.3rem;
    font-weight: 400;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.authors {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.author {
    display: inline-block;
    margin: 0 0.5rem;
}

.author sup {
    font-size: 0.75em;
    margin-left: 2px;
}

.affiliations {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.affiliation {
    margin: 0.3rem 0;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Main Content */
main {
    background: var(--bg-color);
    padding: 3rem 0;
}

.section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.section-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Abstract */
.abstract-section {
    background: var(--bg-alt);
    padding: 2rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

.abstract-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: justify;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    background: var(--bg-alt);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.info-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.info-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.info-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Method Section */
.method-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.method-content > p {
    font-size: 1.05rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.method-phases {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.phase-card {
    display: flex;
    gap: 1.5rem;
    background: var(--bg-alt);
    padding: 2rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

.phase-number {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.phase-content h4 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.phase-content ul {
    list-style: none;
    padding: 0;
}

.phase-content li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.phase-content li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Company Tabs */
.company-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    background: var(--bg-alt);
    padding: 1rem;
    border-radius: 12px;
}

.tab-button {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.tab-button:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.tab-button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tab-icon {
    font-size: 1.5rem;
}

.tab-label {
    font-weight: 500;
}

/* Company Content */
.company-content {
    background: var(--bg-alt);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.company-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.data-section {
    margin-bottom: 2.5rem;
}

.data-section h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.data-content {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    white-space: pre-wrap;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
    overflow-x: auto;
    word-wrap: break-word;
    /* No max-height - show all content */
}

/* Remove collapsible content styles */

.data-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.data-content::-webkit-scrollbar-track {
    background: var(--bg-alt);
    border-radius: 4px;
}

.data-content::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

/* Output Tabs */
.output-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.output-tab {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.output-tab:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.output-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.output-content {
    display: none;
}

.output-content.active {
    display: block;
}

/* BibTeX Section */
.bibtex-section {
    background: var(--bg-alt);
    padding: 2rem;
    border-radius: 12px;
}

.bibtex-container {
    position: relative;
    background: #282c34;
    border-radius: 8px;
    overflow: hidden;
}

.bibtex-container pre {
    margin: 0;
    padding: 1.5rem;
    overflow-x: auto;
}

.bibtex-container code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.9rem;
    color: #abb2bf;
    line-height: 1.6;
}

.copy-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.copy-btn.copied {
    background: #27ae60;
    border-color: #27ae60;
}

/* Footer */
.footer {
    background: #343a40;
    color: #adb5bd;
    padding: 3rem 0;
    text-align: center;
    margin-top: 4rem;
}

.footer p {
    margin: 0.5rem 0;
}

.footer a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer a:hover {
    opacity: 0.8;
}

.footer-links {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.footer-links a {
    margin: 0 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .paper-title {
        font-size: 1.75rem;
    }

    .paper-subtitle {
        font-size: 1.1rem;
    }

    .authors {
        font-size: 1rem;
    }

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

    .tab-button {
        min-width: 100%;
    }

    .phase-card {
        flex-direction: column;
    }

    .paper-links {
        flex-direction: column;
    }

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

    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.loading:after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Print Styles */
@media print {
    .paper-links,
    .footer,
    .copy-btn {
        display: none;
    }
    
    body {
        background: white;
    }
}

.gh-links-panel {
        background: white;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
        padding: 30px;
        margin: 30px 0;
    }

.gh-links-panel h3 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
}

.gh-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.gh-link-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.gh-link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.gh-link-card small {
    display: block;
    font-size: 11px;
    opacity: 0.8;
    margin-top: 5px;
}