/* ===================================
   ANALYSIS PAGE STYLES
   =================================== */

.analysis-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 10px;
    background: white;
}

/* .analysis-content > section:first-child p:first-child, 
.analysis-content > p:first-child {
    margin-top: 0; 
} */

.analysis-header {
    border-bottom: none; 
    padding-bottom: 15px;
    margin-bottom: 0;
    padding-top: 20px; 
}

.analysis-header h1 {
    font-size: 2.5em;
    line-height: 1.2;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.analysis-header .meta {
    color: #666;
    font-size: 0.95em;
    font-style: italic;
    margin-bottom: 0; 
    padding-bottom: 20px; 
    border-bottom: 1px solid #e0e0e0; 
}




.analysis-content {
    margin-top: 25px; 
}

.analysis-content > *:first-child {
    margin-top: 0 !important; 
}

.analysis-content > section:first-child {
    margin-top: 0 !important; 
}

.analysis-content > section:first-child > *:first-child {
    margin-top: 0 !important; 
}

.analysis-content p {
    margin-bottom: 20px;
    font-size: 1.05em;
    line-height: 1.8;
}


/* Stats Grid */
.key-stats {
    margin: 40px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* Chart Container */
.chart-container {
    margin: 50px 0;
    padding: 30px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.chart-container img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    margin-bottom: 15px;
}

.chart-caption {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
    text-align: center;
}

/* View Code Button */
.view-code-btn {
    background: transparent;
    color: #667eea;
    border: 1px solid #e0e0e0;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: none;
}

.view-code-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: none;
    box-shadow: none;
}

.view-code-btn:active {
    transform: none;
    background: #f0f0f0;
}

/* Code Section */
.code-section {
    margin-top: 20px;
    background: #282c34;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.code-section pre {
    margin: 0;
    color: #abb2bf;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Key Finding Box */
.key-finding {
    background: linear-gradient(135deg, #FFF5E6 0%, #FFE8CC 100%);
    border-left: 5px solid #B8704F;
    padding: 25px;
    margin: 40px 0;
    border-radius: 0 8px 8px 0;
    font-weight: 500;
}

/* Methodology Section */
.methodology {
    margin-top: 60px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.methodology summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s ease;
}

.methodology summary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
}

.methodology summary::-webkit-details-marker {
    display: none;
}

.methodology[open] summary {
    border-bottom: 2px solid #e0e0e0;
}

.methodology-content {
    padding: 30px;
    background: white;
}

.methodology h3 {
    color: #667eea;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.methodology h3:first-child {
    margin-top: 0;
}

.methodology ul {
    margin-left: 25px;
    margin-bottom: 20px;
}

.methodology li {
    margin-bottom: 10px;
}

.methodology .code-block {
    background: #282c34;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    overflow-x: auto;
}

.methodology .code-block pre {
    margin: 0;
    color: #abb2bf;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.6;
}

/* Pipeline Diagram */
.pipeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.pipeline-step {
    flex: 1;
    min-width: 150px;
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    font-weight: 600;
    color: #667eea;
}

.pipeline-arrow {
    font-size: 1.5em;
    color: #667eea;
}

/* Responsive */
@media (max-width: 768px) {
    .analysis-container {
        padding: 20px 15px;
    }

    .analysis-header h1 {
        font-size: 2em;
    }

    .analysis-content h2 {
        font-size: 1.5em;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .stat-value {
        font-size: 2em;
    }

    .chart-container {
        padding: 20px;
    }

    .pipeline {
        flex-direction: column;
    }

    .pipeline-arrow {
        transform: rotate(90deg);
    }

    .methodology-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .analysis-header h1 {
        font-size: 1.75em;
    }

    .analysis-content h2 {
        font-size: 1.35em;
    }

    .analysis-content p {
        font-size: 1em;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 1.75em;
    }
}

/* View Statistics Badge */

.view-stats {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    padding: 0;
    border: none;
}

.stat-icon {
    font-size: 0.9em; 
    opacity: 0.6;
}

.stat-number {
    font-size: 0.95em;
    font-weight: 600;
    color: #666;
}

.stat-label {
    font-size: 0.85em;
    color: #999;
    font-style: normal;
}

/* Sources Section */
.sources-list {
    margin-top: 30px;
}

.source-item {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.source-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.source-number {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1em;
    margin: 0;
    min-width: 25px;
}

.source-content {
    flex: 1;
}

.source-title {
    margin: 0 0 5px 0;
    font-size: 1em;
}

.source-title a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.source-title a:hover {
    color: #5568d3;
    text-decoration: underline;
}

.source-citation {
    margin: 0;
    font-size: 0.9em;
    color: #888;
    font-style: italic;
}


/* Architecture diagram styling - Lambda article only */
.analysis-container .diagram-container {
    text-align: center;
    margin: 2rem 0;
}

.analysis-container .architecture-diagram {
    max-width: 700px;
    width: 100%;
    height: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.analysis-container .diagram-caption {
    margin-top: 0.75rem;
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}
.analysis-content ul {
    padding-left: 2.5rem;
    margin: 1rem 0;
}

.analysis-content ul li {
    margin-bottom: 0.5rem;
}