/* Modern Academic Website Styling */

:root {
    --primary-color: #0366d6;
    --secondary-color: #28a745;
    --accent-color: #6f42c1;
    --text-color: #24292e;
    --bg-color: #ffffff;
    --light-bg: #f6f8fa;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    text-align: center;
    padding: 3rem 2rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

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

.institution {
    font-size: 0.9rem;
    opacity: 0.9;
}

nav {
    background: var(--text-color);
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 0.7;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    margin-bottom: 4rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

#hero {
    background: var(--light-bg);
    padding: 3rem;
    border-radius: 12px;
    margin-bottom: 3rem;
}

.hero-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.stat-box {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-box h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.two-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.result-card {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

.result-card h3 {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.impact-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

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

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

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

pre {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 6px;
    overflow-x: auto;
}

code {
    font-family: "Courier New", monospace;
    font-size: 0.9rem;
}

.figure {
    margin: 2rem 0;
    text-align: center;
}

.figure img {
    max-width: 85%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.caption {
    margin-top: 1rem;
    font-style: italic;
    color: #586069;
}

footer {
    background: var(--text-color);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

footer a {
    color: white;
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
    }
}

/* Video Styling */
.video-container {
    margin: 2rem 0;
    text-align: center;
}

.video-container video {
    max-width: 100%;
    width: 800px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.video-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.video-item {
    text-align: center;
}

.video-item h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.video-item video {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.video-item video:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.caption {
    margin-top: 1rem;
    font-style: italic;
    color: #586069;
    font-size: 0.95rem;
}

/* Responsive video layout */
@media (max-width: 768px) {
    .video-comparison {
        grid-template-columns: 1fr;
    }
    
    .video-container video {
        width: 100%;
    }
}

/* Motivation Image Specific Styling */
.figure.motivation-figure {
    max-width: 600px;
    margin: 2rem auto;
}

.figure.motivation-figure img {
    max-width: 100%;
    height: auto;
}

/* Responsive sizing */
@media (max-width: 1024px) {
    .figure.motivation-figure {
        max-width: 700px;
    }
}

@media (max-width: 768px) {
    .figure.motivation-figure {
        max-width: 100%;
        padding: 0 1rem;
    }
}

/* Minimal Tagline Styling */
.tagline {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 3rem 0;
}

/* Responsive tagline */
@media (max-width: 768px) {
    .tagline {
        font-size: 1.5rem;
    }
}

/* Calibration Challenge Section */
#calibration-challenge {
    background: var(--light-bg);
    padding: 3rem;
    border-radius: 12px;
    margin-bottom: 4rem;
}

.policy-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
    margin: 3rem 0;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.policy-item {
    text-align: center;
}

.policy-item img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: transform 0.3s;
}

.policy-item img:hover {
    transform: scale(1.05);
}

.policy-label {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.sublabel {
    display: block;
    font-size: 0.9rem;
    font-weight: 400;
    color: #586069;
    margin-top: 0.5rem;
}

.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-divider span {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-color);
    background: var(--light-bg);
    padding: 1rem 1.5rem;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
}

.challenge-explanation {
    margin: 3rem 0;
}

.challenge-explanation h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.mismatch-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 6px;
}

.mismatch-box h4 {
    color: #856404;
    margin-bottom: 0.5rem;
}

.mismatch-box p {
    margin: 0;
    color: #856404;
}

.why-calibrate {
    margin: 3rem 0;
}

.why-calibrate h3 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.calibration-benefits {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.calibration-benefits li {
    padding: 0.75rem 0;
    padding-left: 2rem;
    position: relative;
}

.calibration-benefits li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

.highlight-text {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(3, 102, 214, 0.1));
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    margin: 2rem 0;
}

.prm-advantage {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
}

.prm-advantage ul {
    margin-top: 1rem;
    padding-left: 1.5rem;
}

.prm-advantage li {
    margin: 0.5rem 0;
}

/* Responsive design for policy comparison */
@media (max-width: 768px) {
    .policy-comparison {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .vs-divider {
        transform: rotate(90deg);
    }
    
    .policy-item img {
        max-width: 200px;
    }
}

/* Error Histogram Styling - Smaller and Side-by-Side */
.error-histograms {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.histogram-item {
    flex: 0 1 400px;  /* Each item max 400px */
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.histogram-item img {
    width: 100%;
    max-width: 350px;  /* Limit individual image size */
    height: auto;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.histogram-item .caption {
    font-size: 0.85rem;  /* Slightly smaller text */
    line-height: 1.5;
    color: #586069;
    margin: 0;
}

.histogram-item .caption strong {
    color: var(--text-color);
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.key-insight {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    margin-top: 2rem;
    border-radius: 4px;
    color: #856404;
}

.key-insight strong {
    color: #856404;
}

/* Stack on mobile */
@media (max-width: 900px) {
    .error-histograms {
        grid-template-columns: 1fr;  /* Single column on mobile */
    }
}

/* Calibration Comparison - Single Row */
.calibration-comparison {
    display: grid;
    grid-template-columns: repeat(4, 1fr);  /* 4 columns, equal width */
    gap: 1rem;
    margin: 2rem auto;
    max-width: 1200px;
}

.comparison-item {
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-item img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Responsive: Stack on smaller screens */
@media (max-width: 1024px) {
    .calibration-comparison {
        grid-template-columns: repeat(2, 1fr);  /* 2 columns on tablets */
    }
}

@media (max-width: 600px) {
    .calibration-comparison {
        grid-template-columns: 1fr;  /* Single column on mobile */
    }
}

/* Optional: Add hover effect */
.comparison-item {
    transition: transform 0.2s, box-shadow 0.2s;
}

.comparison-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Header Button Styling */
.header-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-text {
    font-size: 1rem;
}

/* Individual button colors (optional accent on hover) */
.btn-paper:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-arxiv:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-code:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-data:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive design */
@media (max-width: 600px) {
    .header-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-btn {
        justify-content: center;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

/* Innovation Section Flow */
.innovation-flow {
    margin: 2rem 0 3rem 0;
}

/* Calibrated Confidence Box (Blue theme) */
.calibration-box {
    background: linear-gradient(135deg, rgba(3, 102, 214, 0.05), rgba(3, 102, 214, 0.02));
    border: 2px solid rgba(3, 102, 214, 0.2);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.calibration-box h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.calibration-box > p {
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Smart Allocation Box (Green theme) */
.allocation-box {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.05), rgba(40, 167, 69, 0.02));
    border: 2px solid rgba(40, 167, 69, 0.2);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.allocation-box h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.allocation-box > p {
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* PRM Diagram inside box */
.calibration-box .prm-diagram {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 2rem auto 0 auto;
    text-align: center;
    max-width: 800px;
}

.prm-diagram img {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 8px;
    margin: 0 auto;
    display: block;
}

.prm-diagram .caption {
    margin-top: 1.5rem;
    text-align: left;
    max-width: 100%;
    font-size: 0.95rem;
    line-height: 1.6;
}

.prm-diagram .caption strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

/* Video comparison inside allocation box */
.allocation-box .video-comparison {
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .calibration-box,
    .allocation-box {
        padding: 1.5rem;
    }
    
    .prm-diagram {
        padding: 1rem;
    }
}

/* youtube */
.youtube-container {
    width: 100%;
    max-width: 900px;
    margin: 3rem auto 0;
    padding: 0 1rem;
}

.youtube-container iframe {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.youtube-container .caption {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
}