/* Metafic JATS Viewer Styles */

/* Container and Layout */
.jats-viewer-container {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

/* Left Sidebar - Table of Contents */
.jats-toc-sidebar {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.jats-toc-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.jats-toc {
    font-size: 14px;
}

.jats-toc-list,
.jats-toc-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.jats-toc-sublist {
    margin-left: 15px;
    margin-top: 5px;
}

.jats-toc-item {
    margin-bottom: 8px;
}

.jats-toc-item a {
    color: #495057;
    text-decoration: none;
    display: block;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.jats-toc-item a:hover {
    background: #e9ecef;
    color: #212529;
}

.jats-toc-subsection a {
    font-size: 13px;
    padding-left: 20px;
}

/* Main Content Area */
.jats-main-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Article Header */
.jats-article-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.jats-journal-info {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 10px;
}

.jats-article-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 15px 0;
    color: #212529;
}

.jats-doi {
    font-size: 14px;
    margin-bottom: 10px;
}

.jats-doi a {
    color: #007bff;
    text-decoration: none;
}

.jats-doi a:hover {
    text-decoration: underline;
}

.jats-dates {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 15px;
}

.jats-date {
    margin-right: 20px;
    display: inline-block;
}

.jats-label {
    font-weight: 600;
}

/* Authors */
.jats-authors {
    margin: 20px 0;
}

.jats-author-name {
    color: #495057;
}

.jats-author-name sup {
    color: #007bff;
    font-size: 12px;
}

.jats-corresp-indicator {
    color: #dc3545;
    font-weight: bold;
}

.jats-orcid {
    display: inline-block;
    vertical-align: middle;
    margin-left: 5px;
}

.jats-orcid img {
    width: 16px;
    height: 16px;
}

.jats-affiliations {
    margin-top: 10px;
    font-size: 14px;
    color: #6c757d;
}

.jats-affiliation {
    margin-bottom: 5px;
}

.jats-affiliation sup {
    color: #007bff;
    font-weight: 600;
}

.jats-corresp {
    margin-top: 10px;
    font-size: 14px;
    color: #495057;
}

.jats-keywords {
    font-size: 14px;
    margin-top: 15px;
}

/* Abstract */
.jats-abstract {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
}

.jats-abstract h2 {
    font-size: 20px;
    margin: 0 0 15px 0;
    color: #212529;
}

.jats-abstract-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 10px 0 5px 0;
    color: #495057;
}

/* Body Content */
.jats-body {
    margin-bottom: 30px;
}

.jats-section {
    margin-bottom: 25px;
}

.jats-section h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 30px 0 15px 0;
    color: #212529;
}

.jats-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 25px 0 12px 0;
    color: #495057;
}

.jats-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 10px 0;
    color: #495057;
}

.jats-section p {
    margin-bottom: 15px;
    text-align: justify;
}

.jats-list {
    margin: 15px 0;
    padding-left: 25px;
}

.jats-list li {
    margin-bottom: 8px;
}

/* Figures and Tables */
.jats-figure,
.jats-table-wrap {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.jats-figure img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.jats-figure figcaption,
.jats-table-caption {
    font-size: 14px;
    margin-top: 10px;
    color: #495057;
}

.jats-figure-label,
.jats-table-label {
    font-weight: 600;
    color: #212529;
}

.jats-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.jats-table-wrap th,
.jats-table-wrap td {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    text-align: left;
}

.jats-table-wrap th {
    background: #e9ecef;
    font-weight: 600;
}

/* References */
.jats-references {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.jats-references h2 {
    font-size: 22px;
    margin-bottom: 20px;
}

.jats-reference-list {
    padding-left: 0;
    list-style: none;
    counter-reset: reference-counter;
}

.jats-reference {
    margin-bottom: 12px;
    padding-left: 30px;
    position: relative;
    counter-increment: reference-counter;
    font-size: 14px;
}

.jats-reference::before {
    content: counter(reference-counter) ".";
    position: absolute;
    left: 0;
    font-weight: 600;
}

/* Right Sidebar - Tabs */
.jats-tabs-sidebar {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.jats-tabs {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.jats-tab-buttons {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
}

.jats-tab-button {
    flex: 1;
    padding: 8px 12px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    transition: all 0.2s ease;
}

.jats-tab-button:hover {
    background: #e9ecef;
    color: #495057;
}

.jats-tab-button.active {
    background: #007bff;
    color: #fff;
}

.jats-tab-content {
    flex: 1;
    overflow-y: auto;
}

.jats-tab-panel {
    display: none;
}

.jats-tab-panel.active {
    display: block;
}

/* Tab Content Styles */
.jats-figures-list,
.jats-tables-list,
.jats-references-list {
    font-size: 14px;
}

.jats-figure-item,
.jats-table-item,
.jats-reference-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.jats-figure-item:last-child,
.jats-table-item:last-child,
.jats-reference-item:last-child {
    border-bottom: none;
}

.jats-figure-item h4,
.jats-table-item h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #212529;
}

.jats-figure-caption,
.jats-table-caption {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 5px;
}

.jats-figure-link,
.jats-table-link {
    font-size: 13px;
    color: #007bff;
    text-decoration: none;
}

.jats-figure-link:hover,
.jats-table-link:hover {
    text-decoration: underline;
}

.jats-references-count {
    font-weight: 600;
    margin-bottom: 15px;
    color: #495057;
}

.jats-reference-number {
    font-weight: 600;
    color: #007bff;
}

/* Info Tab */
.jats-info-content {
    font-size: 14px;
}

.jats-info-section {
    margin-bottom: 25px;
}

.jats-info-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #212529;
}

.jats-author-info {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.jats-author-info:last-child {
    border-bottom: none;
}

.jats-author-info p {
    margin: 5px 0;
}

.jats-author-links {
    font-size: 13px;
}

.jats-scopus {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    color: #495057;
}

.jats-author-affiliation {
    font-size: 13px;
    color: #6c757d;
    margin-top: 5px;
}

.jats-orcid-link {
    display: inline-block;
    vertical-align: middle;
}

/* Citation styles */
cite {
    font-style: normal;
    color: #007bff;
    cursor: pointer;
}

cite:hover {
    text-decoration: underline;
}

/* Error styles */
.metafic-jats-error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 20px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

.jats-no-content {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .jats-viewer-container {
        grid-template-columns: 220px 1fr 280px;
    }
}

@media (max-width: 992px) {
    .jats-viewer-container {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .jats-toc-sidebar,
    .jats-tabs-sidebar {
        position: static;
        max-height: none;
        margin-bottom: 20px;
    }
    
    .jats-toc-sidebar {
        display: none;
    }
    
    .jats-main-content {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .jats-article-title {
        font-size: 24px;
    }
    
    .jats-main-content {
        padding: 15px;
    }
    
    .jats-tab-buttons {
        flex-wrap: wrap;
    }
    
    .jats-tab-button {
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* Print styles */
@media print {
    .jats-toc-sidebar,
    .jats-tabs-sidebar {
        display: none;
    }
    
    .jats-viewer-container {
        grid-template-columns: 1fr;
    }
    
    .jats-main-content {
        box-shadow: none;
        padding: 0;
    }
}