/* Custom styles for iREPA project page */

/* Jump to Sections - Icon Row (Cambrian style) */
.icon-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    padding: 20px;
    line-height: 1rem;
}

.icon-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: inherit;
    padding: 15px;
    margin: 10px;
    border: 3px solid #508af6;
    border-radius: 10px;
    background-color: #d6eefb;
    flex: 1 1 150px;
    min-height: 110px;
    max-width: 180px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.icon-link:hover {
    background-color: #88c2fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(80, 138, 246, 0.3);
}

.icon-link .icon {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    .icon-link {
        flex: 1 1 45%;
    }
}

/* Click Hint */
.click-hint {
    display: block;
    margin: 20px auto;
    width: 85%;
    font-size: 15px;
    color: #333333;
    border: 2px solid #cccccc;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.click-hint strong {
    color: #007bff;
}

.click-hint img {
    vertical-align: middle;
    margin-right: 8px;
}

/* Header Icon Container (like Cambrian) */
.header-content .icon-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.header-content .icon-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.header-content .icon-item img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.header-content .icon-item > div {
    flex: 1;
    font-size: 0.95em;
    line-height: 1.5;
}

.header-content .icon-item strong {
    font-weight: 600;
    color: #F7CC4F;
}

.header-content p {
    margin: 15px 0;
    font-size: 1.2rem;
    line-height: 1.6;
}

/* Responsive design for header icons */
@media (max-width: 768px) {
    .header-content .icon-container {
        gap: 10px;
    }

    .header-content .icon-item img {
        width: 20px;
        height: 20px;
    }
}

/* Teaser Figure - Simple like Cambrian */
#fig-teaser {
    width: 150%;
    margin-left: -20%;
}

#fig-teaser figure {
    width: 100% !important;
    margin: 0 !important;
}

#fig-teaser img {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
}

#fig-teaser figcaption {
    margin-top: 20px;
    font-size: 1em;
    line-height: 1.8;
    color: #444;
}

/* Key Takeaways Section */
.key-takeaways-block {
    padding: 40px 0;
    background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
}

.takeaway-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.takeaway-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.takeaway-number {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.takeaway-content {
    flex: 1;
}

.takeaway-content h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.3em;
    color: #333;
}

.takeaway-content p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

/* Responsive design */
@media (max-width: 768px) {
    .takeaway-item {
        flex-direction: column;
        text-align: center;
    }

    .takeaway-number {
        margin: 0 auto;
    }
}

/* Section styling */
.motivation-block,
.spatial-structure-block,
.method-block,
.results-block {
    margin-top: 40px;
    margin-bottom: 40px;
}

/* Figure captions */
d-figure figcaption {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
    line-height: 1.5;
}

/* Ordered and unordered lists in content */
.text ol,
.text ul {
    margin-left: 20px;
    line-height: 1.8;
}

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

/* Abstract styling */
.abstract {
    font-size: 1.05em;
    line-height: 1.8;
    color: #444;
}

/* BibTeX styling */
.bibtex {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    overflow-x: auto;
}

/* Finding box styling - minimalistic gray block for key findings */
.finding-box {
    background-color: rgba(240, 240, 240, 0.9); /* Soft gray background */
    border: 1.2pt solid rgba(25, 25, 25, 0.6); /* Dark border */
    border-radius: 10pt; /* Rounded corners */
    padding: 2pt 10pt; /* Compact padding */
    margin: 0.5em 0; /* Vertical spacing */
    box-shadow: 2px 2px 4px rgba(128, 128, 128, 0.3); /* Subtle shadow */
    box-sizing: border-box;
}

.finding-box ul {
    margin: 0.5em 0;
    padding-left: 1.2em;
    list-style-type: disc;
}

.finding-box li {
    margin-bottom: 0.5em;
    line-height: 1.5;
}

.finding-box li:last-child {
    margin-bottom: 0;
}

/* Configuration box styling - sidebar style with left accent */
.config-box {
    background-color: #fafbfc; /* Very light gray-blue background */
    border-left: 4px solid #508af6; /* Blue accent bar on left */
    border-radius: 4px;
    padding: 16px 20px;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Very subtle shadow */
}

.config-box p {
    margin: 0 0 12px 0;
    color: #333;
    font-weight: 600;
}

.config-box p strong {
    color: #508af6; /* Match the accent color */
}

.config-box ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: none; /* Remove bullets for cleaner look */
}

.config-box li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #555;
    position: relative;
    padding-left: 0;
}

.config-box li:last-child {
    margin-bottom: 0;
}

.config-box li strong {
    color: #333;
    font-weight: 600;
}

/* Quickstart Section Styles */
.quickstart-section {
    width: 150%;
    margin: 40px 0 40px -20%;
    padding: 30px 0;
}

.quickstart-section h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

/* Responsive: Reset width on mobile */
@media (max-width: 768px) {
    .quickstart-section {
        width: 100%;
        margin-left: 0;
    }
}

/* Tab Container */
.tab-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

/* Tab Buttons */
.tab-button {
    padding: 12px 24px;
    background-color: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: none;
    margin-bottom: -2px;
}

.tab-button:hover {
    background-color: #e8e8e8;
    color: #333;
}

.tab-button.active {
    background-color: #508af6;
    color: white;
    border-color: #508af6;
}

/* Tab Content Panels */
.tab-content {
    display: none;
    padding: 30px;
    background-color: #fafbfc;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 10px;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

/* Code Examples in Quickstart */
.quickstart-example {
    margin-bottom: 25px;
}

.quickstart-example h3 {
    color: #508af6;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.quickstart-example p {
    color: #555;
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Code block container with copy button */
.code-block-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.quickstart-example pre {
    background-color: #f6f8fa;
    color: #24292f;
    padding: 16px;
    padding-right: 45px; /* Space for copy icon */
    border: 1px solid #d0d7de;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.45;
    position: relative;
}

.quickstart-example code {
    background-color: transparent;
    color: #24292f;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Copy icon button - minimal style like markdown */
.copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
    background-color: transparent;
    border: none;
    color: #57606a;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.copy-button:hover {
    background-color: rgba(175, 184, 193, 0.2);
    color: #24292f;
}

.copy-button:active {
    background-color: rgba(175, 184, 193, 0.3);
}

.copy-button.copied {
    color: #1a7f37;
}

/* Icon using Unicode characters */
.copy-button::before {
    content: '📋';
    font-size: 16px;
}

.copy-button.copied::before {
    content: '✓';
    font-size: 18px;
    font-weight: bold;
}

/* Prism.js syntax highlighting customization - GitHub light theme */
code[class*="language-"],
pre[class*="language-"] {
    color: #24292f;
    background: #f6f8fa !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    word-wrap: normal;
    line-height: 1.45;
    tab-size: 4;
    hyphens: none;
}

code[class*="language-"] {
    background: transparent !important;
}

/* Keywords (def, import, from, class, return, etc.) */
.token.keyword {
    color: #cf222e;
}

/* Strings */
.token.string {
    color: #0a3069;
}

/* Comments */
.token.comment {
    color: #6e7781;
    font-style: italic;
}

/* Functions and method names */
.token.function {
    color: #8250df;
}

/* Class names */
.token.class-name {
    color: #953800;
}

/* Numbers */
.token.number {
    color: #0550ae;
}

/* Operators (=, +, -, etc.) */
.token.operator {
    color: #24292f;
}

/* Punctuation */
.token.punctuation {
    color: #24292f;
}

/* Built-in names */
.token.builtin {
    color: #0550ae;
}

/* Decorators */
.token.decorator {
    color: #8250df;
}

/* Installation Note */
.install-note {
    background-color: #fffbf0;
    border-left: 4px solid #ffd966;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.install-note strong {
    color: #856404;
}

/* Responsive Design for Tabs */
@media (max-width: 768px) {
    .tab-button {
        padding: 10px 16px;
        font-size: 0.85em;
    }

    .tab-content {
        padding: 20px;
    }

    .quickstart-example pre {
        font-size: 0.8em;
    }
}