/* Research Paper Styles */

/* Paper Hero */
.paper-hero {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: var(--spacing-08) 0 var(--spacing-06);
    border-bottom: 1px solid var(--color-border);
}

.paper-hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.paper-meta {
    display: flex;
    gap: var(--spacing-03);
    margin-bottom: var(--spacing-04);
    flex-wrap: wrap;
}

.paper-meta span {
    font-size: var(--text-body-small);
    color: var(--color-text-secondary);
}

.paper-category {
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.paper-hero .paper-title {
    font-size: var(--text-display);
    font-weight: var(--font-weight-light);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-04);
    line-height: 1.2;
}

.paper-abstract {
    font-size: var(--text-body-large);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-05);
}

/* Key Metrics */
.key-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-04);
    margin-top: var(--spacing-05);
}

.metric-card {
    background: white;
    border: 1px solid var(--color-border);
    padding: var(--spacing-04);
    text-align: center;
    border-left: 3px solid var(--color-primary);
}

.metric-card .metric-value {
    font-size: var(--text-heading-02);
    font-weight: var(--font-weight-light);
    color: var(--color-primary);
    margin-bottom: var(--spacing-02);
}

.metric-card .metric-label {
    font-size: var(--text-body-small);
    color: var(--color-text-secondary);
}

/* Table of Contents */
.toc-section {
    background: var(--color-background-subtle);
    padding: var(--spacing-05) 0;
    border-bottom: 1px solid var(--color-border);
    /* Remove sticky positioning to avoid overlap issues */
    /* position: sticky;
    top: 60px;
    z-index: 100; */
}

.toc-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.toc-wrapper h3 {
    font-size: var(--text-body);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--spacing-03);
    color: var(--color-text-secondary);
}

.toc {
    display: flex;
    gap: var(--spacing-04);
    flex-wrap: wrap;
}

.toc a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--text-body-small);
    padding: var(--spacing-02) 0;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-base);
}

.toc a:hover {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Content Sections */
.paper-content {
    padding: var(--spacing-07) 0;
    background: white;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.content-section {
    margin-bottom: var(--spacing-08);
}

.content-section h2 {
    font-size: var(--text-heading-02);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-04);
    padding-top: var(--spacing-05);
}

.content-section h3 {
    font-size: var(--text-heading-03);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
    margin-top: var(--spacing-05);
    margin-bottom: var(--spacing-03);
}

.content-section p {
    font-size: var(--text-body);
    line-height: 1.7;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-03);
}

/* Lists */
.research-list {
    list-style: none;
    padding: 0;
    margin: var(--spacing-04) 0;
}

.research-list li {
    position: relative;
    padding-left: var(--spacing-04);
    margin-bottom: var(--spacing-02);
    color: var(--color-text-primary);
}

.research-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
}

/* Highlight Box */
.highlight-box {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0ff 100%);
    border-left: 4px solid var(--color-primary);
    padding: var(--spacing-04);
    margin: var(--spacing-05) 0;
}

.highlight-box h4 {
    font-size: var(--text-body);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    margin-bottom: var(--spacing-02);
}

/* Data Table */
.data-table {
    overflow-x: auto;
    margin: var(--spacing-05) 0;
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid var(--color-border);
}

.data-table th {
    background: var(--color-background-subtle);
    padding: var(--spacing-03);
    text-align: left;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
    border-bottom: 2px solid var(--color-border);
}

.data-table td {
    padding: var(--spacing-03);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-primary);
}

.data-table .positive {
    color: #24a148;
    font-weight: var(--font-weight-medium);
}

/* Charts */
.chart-container {
    margin: var(--spacing-05) 0;
    padding: var(--spacing-04);
    background: var(--color-background-subtle);
    border: 1px solid var(--color-border);
}

.chart-caption {
    text-align: center;
    font-size: var(--text-body-small);
    color: var(--color-text-secondary);
    margin-top: var(--spacing-03);
    font-style: italic;
}

/* Principles Grid */
.principles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-04);
    margin: var(--spacing-05) 0;
}

.principle-card {
    background: white;
    border: 1px solid var(--color-border);
    padding: var(--spacing-04);
    text-align: center;
    transition: all var(--transition-base);
}

.principle-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.principle-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--spacing-03);
    color: var(--color-primary);
}

.principle-card h4 {
    font-size: var(--text-body);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-02);
}

.principle-card p {
    font-size: var(--text-body-small);
    color: var(--color-text-secondary);
}

/* Architecture Diagram */
.architecture-diagram {
    margin: var(--spacing-06) 0;
    padding: var(--spacing-04);
    background: var(--color-background-subtle);
    border: 1px solid var(--color-border);
    min-height: 400px;
}

/* Performance Grid */
.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-05);
    margin: var(--spacing-05) 0;
}

.performance-card {
    background: white;
    border: 1px solid var(--color-border);
    padding: var(--spacing-04);
}

.performance-list {
    list-style: none;
    padding: 0;
}

.performance-list li {
    padding: var(--spacing-02) 0;
    padding-left: var(--spacing-04);
    position: relative;
    color: var(--color-text-primary);
}

.performance-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

/* Case Studies */
.case-study {
    background: var(--color-background-subtle);
    border-left: 4px solid var(--color-primary);
    padding: var(--spacing-05);
    margin: var(--spacing-05) 0;
}

.case-study h3 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-03);
}

.case-study-metrics {
    display: flex;
    gap: var(--spacing-05);
    margin: var(--spacing-04) 0;
}

.case-study-metrics .metric {
    text-align: center;
}

.case-study-metrics .value {
    display: block;
    font-size: var(--text-heading-03);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    margin-bottom: var(--spacing-01);
}

.case-study-metrics .label {
    display: block;
    font-size: var(--text-body-small);
    color: var(--color-text-secondary);
}

/* Implementation Steps */
.implementation-steps {
    display: flex;
    justify-content: space-between;
    margin: var(--spacing-06) 0;
    position: relative;
}

.implementation-steps::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--color-border);
    z-index: 0;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-heading-03);
    font-weight: var(--font-weight-semibold);
    margin: 0 auto var(--spacing-03);
}

.step h4 {
    font-size: var(--text-body);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-02);
}

.step p {
    font-size: var(--text-body-small);
    color: var(--color-text-secondary);
}

/* Code Block */
.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: var(--spacing-04);
    border-radius: 4px;
    overflow-x: auto;
    margin: var(--spacing-05) 0;
}

.code-block pre {
    margin: 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* Conclusion Metrics */
.conclusion-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-05);
    margin: var(--spacing-06) 0;
}

.metric-highlight {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0ff 100%);
    padding: var(--spacing-04);
    border-left: 4px solid var(--color-primary);
}

.metric-highlight .metric-value {
    font-size: var(--text-display);
    font-weight: var(--font-weight-light);
    color: var(--color-primary);
    margin-bottom: var(--spacing-03);
}

.metric-highlight .metric-description {
    font-size: var(--text-body);
    color: var(--color-text-primary);
    line-height: 1.6;
}

/* Download Section */
.download-section {
    margin: var(--spacing-08) 0;
}

.download-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid var(--color-primary);
    padding: var(--spacing-06);
    text-align: center;
}

.download-card h3 {
    font-size: var(--text-heading-03);
    margin-bottom: var(--spacing-03);
}

.download-buttons {
    display: flex;
    gap: var(--spacing-03);
    justify-content: center;
    margin-top: var(--spacing-04);
}

/* Related Research */
.related-section {
    margin-top: var(--spacing-08);
    padding-top: var(--spacing-06);
    border-top: 1px solid var(--color-border);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-04);
    margin-top: var(--spacing-04);
}

.related-card {
    background: var(--color-background-subtle);
    padding: var(--spacing-04);
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

.related-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.related-card h4 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-02);
}

.related-card p {
    color: var(--color-text-secondary);
    font-size: var(--text-body-small);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .paper-hero .paper-title {
        font-size: var(--text-heading-01);
    }
    
    .key-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .toc {
        flex-direction: column;
        gap: var(--spacing-02);
    }
    
    .implementation-steps {
        flex-direction: column;
        gap: var(--spacing-04);
    }
    
    .implementation-steps::before {
        display: none;
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .case-study-metrics {
        flex-direction: column;
        gap: var(--spacing-03);
    }
}