body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0; 
    background-color: #f8f9fa; 
    color: #343a40;
    line-height: 1.6;
}

header { 
    background-color: #343a40; 
    color: #fff; 
    padding: 1em; 
    text-align: center; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

header h1 {
    margin: 0;
    font-weight: 300;
    font-size: 1.8em; 
}

/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    gap: 10px;
}

.tab-button {
    padding: 0.6em 1.2em;
    font-size: 0.9em;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

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

/* Tab Content Styles */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

#toggleChainModeButton {
    padding: 0.5em 1em;
    font-size: 0.9em;
    color: #343a40;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 10px; 
}
#toggleChainModeButton:hover {
    background-color: #d3d9df;
}

.load-data-btn {
    padding: 0.5em 1em;
    font-size: 0.9em;
    color: #fff;
    background-color: #28a745;
    border: 1px solid #28a745;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 20px;
    transition: background-color 0.15s ease;
}
.load-data-btn:hover {
    background-color: #218838;
}
.load-data-btn:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
}

/* Species Profiling Styles */
.profiling-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.species-selector {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.species-selector h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #343a40;
}

.selector-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

#speciesSearchInput {
    flex: 1;
    min-width: 250px;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1rem;
}

#speciesDropdown {
    flex: 1;
    min-width: 250px;
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 1rem;
    background-color: #fff;
}

#analyzeSpeciesButton {
    padding: 10px 20px;
    font-size: 1rem;
    color: #fff;
    background-color: #007bff;
    border: 1px solid #007bff;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#analyzeSpeciesButton:hover {
    background-color: #0056b3;
}

.analysis-results {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.analysis-header {
    margin-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 20px;
}

.analysis-header h3 {
    margin: 0 0 20px 0;
    color: #343a40;
    font-size: 1.5em;
}

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

.summary-card {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.summary-card h4 {
    margin: 0 0 10px 0;
    color: #6c757d;
    font-size: 0.9em;
    text-transform: uppercase;
    font-weight: 600;
}

.summary-card span {
    font-size: 2em;
    font-weight: bold;
    color: #007bff;
}

.analysis-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.threat-exposure-section,
.impact-analysis-section,
.comprehensive-profile-section {
    background-color: #fdfdfd;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.threat-exposure-section h4,
.impact-analysis-section h4,
.comprehensive-profile-section h4 {
    margin: 0 0 20px 0;
    color: #007bff;
    font-size: 1.3em;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
}

.threat-clustering,
.threat-categories,
.impact-details,
.impact-visualization {
    margin-bottom: 25px;
}

.threat-clustering h5,
.threat-categories h5,
.impact-details h5,
.impact-visualization h5 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1em;
}

#threatClustersContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.threat-cluster {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.threat-cluster h6 {
    margin: 0 0 10px 0;
    color: #007bff;
    font-size: 1em;
}

.threat-cluster .cluster-items {
    font-size: 0.9em;
    color: #6c757d;
}

.threat-cluster .cluster-count {
    font-weight: bold;
    color: #495057;
    margin-top: 8px;
}

#impactAnalysisContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.impact-category {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.impact-category h6 {
    margin: 0 0 15px 0;
    color: #dc3545;
    font-size: 1.1em;
}

.impact-severity {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.severity-label {
    font-weight: 600;
    color: #495057;
}

.severity-indicator {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
}

.severity-high {
    background-color: #dc3545;
    color: white;
}

.severity-medium {
    background-color: #ffc107;
    color: #212529;
}

.severity-low {
    background-color: #28a745;
    color: white;
}

#speciesProfileContainer {
    background-color: #fff;
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 25px;
}

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

.profile-section h5 {
    margin: 0 0 15px 0;
    color: #007bff;
    font-size: 1.2em;
}

.threat-impact-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.matrix-cell {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    text-align: center;
}

.matrix-cell .threat-name {
    font-weight: bold;
    color: #495057;
    margin-bottom: 8px;
}

.matrix-cell .impact-probability {
    font-size: 1.2em;
    color: #007bff;
    font-weight: bold;
}

main { 
    padding: 20px; 
    max-width: 1200px;
    margin: 20px auto;
}

.search-container { 
    margin-bottom: 25px; 
    text-align: center; 
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#searchInput { 
    padding: 12px 15px; 
    width: 50%; 
    max-width: 500px;
    border-radius: 6px; 
    border: 1px solid #ced4da; 
    font-size: 1rem;
}
#searchInput:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

#searchButton {
    padding: 12px 20px;
    font-size: 1rem;
    color: #fff;
    background-color: #007bff;
    border: 1px solid #007bff;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}
#searchButton:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

#visualizationsSection {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

#visualizationsSection h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px;
    color: #343a40;
    font-weight: 400;
}

.charts-container {
    display: flex;
    flex-wrap: wrap; 
    gap: 20px; 
    justify-content: space-around; 
}

.chart-wrapper {
    flex: 1 1 400px; 
    min-width: 300px; 
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background-color: #fdfdfd;
    height: 400px; 
    position: relative; 
}

.chart-wrapper h3 {
    text-align: center;
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
    font-weight: 500;
}

/* Network Graph Section Styles REMOVED */

#chainBuilderSection {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

#chainBuilderSection h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    color: #343a40;
    font-weight: 400;
}

#chainDisplayArea {
    padding: 10px; /* Adjusted padding */
    background-color: #e9ecef;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 1.1em;
    text-align: center;
    min-height: 40px; /* Adjusted min-height */
    display: flex; /* For centering items */
    align-items: center; /* For centering items */
    justify-content: center; /* For centering items if only one item */
    flex-wrap: wrap; /* Allow items to wrap */
}

#chainDisplayArea .chain-item {
    display: inline-flex; /* Use inline-flex for better alignment */
    align-items: center; /* Vertically center content within the item */
    justify-content: center; /* Horizontally center content */
    padding: 6px 12px; /* Adjusted padding */
    margin: 3px 5px; /* Added vertical margin for wrapped items */
    border-radius: 4px;
    cursor: default; 
    line-height: 1.4; /* Adjusted line-height */
    text-align: center; /* Ensure text is centered */
}
#chainDisplayArea .chain-item.species {
    background-color: #007bff; 
    color: white;
}
#chainDisplayArea .chain-item.threat {
    background-color: #dc3545; 
    color: white;
    font-size: 0.9em; 
    max-width: 280px; /* Slightly reduced max-width */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap; /* Keep it nowrap for ellipsis to work */
    /* If text still seems high, ensure padding is symmetrical or adjust line-height */
}
#chainDisplayArea .chain-arrow {
    display: inline-flex; /* Use inline-flex */
    align-items: center; /* Vertically center arrow */
    margin: 0 5px;
    color: #6c757d;
}

#chainNextStepOptionsArea {
    padding: 15px;
    border: 1px dashed #ced4da;
    border-radius: 6px;
    background-color: #f8f9fa;
}

#chainNextStepOptionsArea h3 {
    margin-top: 0;
    font-size: 1.2em;
    color: #495057;
}

#chainNextStepOptionsArea ul {
    list-style-type: none;
    padding: 0;
}

#chainNextStepOptionsArea li {
    padding: 10px;
    margin-bottom: 8px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

#chainNextStepOptionsArea li:hover {
    background-color: #e9f5ff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#chainNextStepOptionsArea .option-species {
    font-weight: bold;
}
#chainNextStepOptionsArea .option-threat-desc {
    font-size: 0.9em;
    color: #555;
}

.triplets-grid { 
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.triplet-card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease-in-out;
}
.triplet-card:hover {
    box-shadow: 0 8px 12px rgba(0,0,0,0.1);
}

.triplet-card h3 { 
    margin-top: 0; 
    margin-bottom: 0.75rem;
    color: #0056b3; 
    font-size: 1.25rem;
}
.triplet-card p { 
    margin-bottom: 0.5rem; 
    font-size: 0.95rem;
}
.triplet-card .doi-link { 
    color: #007bff; 
    text-decoration: none; 
    font-size: 0.9em;
    font-weight: 500;
}
.triplet-card .doi-link:hover { text-decoration: underline; }

.similar-button, .explore-details-button, .start-chain-button { 
    display: inline-block;
    color: white; 
    padding: 8px 12px;
    border: none; 
    border-radius: 5px; 
    cursor: pointer; 
    font-size: 0.85em; 
    margin-top: 10px;
    text-align: center;
    transition: background-color 0.15s ease-in-out;
}

.similar-button {
    background-color: #28a745; 
}
.similar-button:hover { background-color: #218838; }

.explore-details-button {
    background-color: #17a2b8; 
    margin-left: 5px; 
}
.explore-details-button:hover { background-color: #117a8b; }

.start-chain-button { 
    background-color: #ffc107; 
    color: #212529;
    margin-left: 5px;
}
.start-chain-button:hover { background-color: #e0a800; }

.modal { 
    display: none; 
    position: fixed; 
    z-index: 1000;
    left: 0; top: 0; 
    width: 100%; height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.6);
    padding-top: 40px; 
}

.modal-content {
    background-color: #fefefe;
    margin: 3% auto; 
    padding: 25px;
    border: 1px solid #ccc; 
    width: 85%; 
    max-width: 800px; 
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    animation: fadeInModal 0.3s;
}

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

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    line-height: 1;
}
.close-button:hover, .close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#chainNextStepOptionsArea .option-species .linking-threat-statement {
    display: block; /* Make it appear on a new line */
    font-size: 0.85em;
    color: #495057; /* A slightly muted color */
    margin-top: 4px;
    font-style: italic;
}
#similarThreatsContent h2, #detailedInfoContent h2 {
    margin-top: 0;
    color: #333;
    font-weight: 500;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}
#similarThreatsContent ul {
    list-style-type: none;
    padding: 0;
}
#similarThreatsContent .similar-item {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}
#similarThreatsContent .similar-item:last-child { 
    border-bottom: none; 
}
#similarThreatsContent .score { 
    font-weight: bold; 
    color: #d9534f; 
    font-size: 0.9em;
    margin-top: 5px;
    display: block;
}

#detailedInfoContent .detail-section {
    margin-bottom: 20px;
}
#detailedInfoContent .detail-section h3 {
    font-size: 1.1rem;
    color: #0056b3;
    margin-bottom: 8px;
    border-bottom: 1px dotted #ddd;
    padding-bottom: 5px;
}
#detailedInfoContent ul {
    list-style-type: disc;
    padding-left: 20px;
    margin: 0;
}
#detailedInfoContent ul li {
    margin-bottom: 5px;
    font-size: 0.95rem;
}
#detailedInfoContent .stat {
    font-style: italic;
    color: #555;
    font-size: 0.9rem;
}

footer { 
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 0.9em;
    border-top: 1px solid #dee2e6;
}

/* Systemic Risk Analysis Styles */
.systemic-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.analysis-controls {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.control-group select,
.control-group input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

#runNetworkAnalysis {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.15s ease;
}

#runNetworkAnalysis:hover {
    background-color: #0056b3;
}

#similarityThreshold {
    width: 120px;
}

#similarityValue {
    font-weight: bold;
    color: #007bff;
    min-width: 30px;
}

.systemic-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Network Visualization Section */
.network-visualization-section {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.network-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.network-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.network-controls button {
    padding: 8px 16px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.15s ease;
}

.network-controls button:hover {
    background-color: #545b62;
}

.network-controls label {
    font-weight: 600;
    color: #495057;
    margin-left: 20px;
}

.network-controls select {
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.network-canvas {
    width: 100%;
    height: 400px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fafafa;
    overflow: hidden;
    position: relative;
}

.network-canvas svg {
    width: 100%;
    height: 100%;
    display: block;
}

.network-canvas .labels text {
    font-family: Arial, sans-serif;
    font-size: 10px;
    fill: #333;
    text-anchor: middle;
    pointer-events: none;
    user-select: none;
}

.network-legend {
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    font-size: 0.9rem;
}

/* Network legend styles */
.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
}

.legend-line {
    width: 20px;
    height: 2px;
    background-color: #999;
    margin-right: 8px;
    display: inline-block;
}

/* Indirect Impact Detection Section */
.indirect-impact-detection-section {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.impact-detection-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detection-controls {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.species-selector-row,
.pathway-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.species-selector-row:last-child,
.pathway-controls:last-child {
    margin-bottom: 0;
}

#focalSpeciesSelect {
    min-width: 250px;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

#findIndirectImpacts {
    padding: 8px 16px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
}

#findIndirectImpacts:hover {
    background-color: #218838;
}

.impact-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    min-height: 300px;
}

.pathway-viz,
.pathway-list {
    background-color: #fdfdfd;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
}

.pathway-viz {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-style: italic;
}

.pathway-list {
    overflow-y: auto;
    max-height: 400px;
}

/* Knowledge Graph Queries Section */
.knowledge-graph-queries-section {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.query-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.query-builder {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.predefined-queries,
.custom-query {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.predefined-queries h4,
.custom-query h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
}

.query-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.query-btn {
    padding: 10px 15px;
    background-color: #17a2b8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease;
}

.query-btn:hover {
    background-color: #117a8b;
}

.query-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.query-form select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

#executeCustomQuery {
    padding: 10px 15px;
    background-color: #ffc107;
    color: #212529;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 10px;
}

#executeCustomQuery:hover {
    background-color: #e0a800;
}

.query-results {
    min-height: 300px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

#queryResultsTable,
#queryVisualization {
    background-color: #fdfdfd;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
}

/* Systemic Risk Metrics Section */
.systemic-risk-metrics-section {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.metrics-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.metrics-dashboard {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

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

.metric-card {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.metric-card h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
}

.metric-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 8px;
}

.metric-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 5px;
}

.metric-description small {
    display: block;
    margin-top: 5px;
    font-size: 0.8em;
    font-style: italic;
    color: #495057;
}

.metrics-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.metrics-charts .chart-wrapper {
    background-color: #fdfdfd;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
    height: 350px;
}

.metrics-charts .chart-wrapper h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1rem;
    text-align: center;
}

.risk-analysis {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.risk-analysis h4 {
    margin: 0 0 15px 0;
    color: #dc3545;
    font-size: 1.2rem;
    border-bottom: 2px solid #dc3545;
    padding-bottom: 8px;
}

.critical-nodes-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.critical-nodes-table th,
.critical-nodes-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.critical-nodes-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
    text-transform: uppercase;
}

.critical-nodes-table tr:hover {
    background-color: #f8f9fa;
}

.critical-nodes-table .node-name {
    font-weight: 500;
    color: #007bff;
    max-width: 200px;
    word-wrap: break-word;
}

.critical-nodes-table .node-type {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
}

.critical-nodes-table .criticality-score {
    font-weight: bold;
    color: #dc3545;
}

.vulnerability-corridors {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.corridor-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.corridor-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    background-color: #f8f9fa;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.corridor-item.risk-high {
    border-left: 4px solid #dc3545;
    background-color: #f8d7da;
}

.corridor-item.risk-medium {
    border-left: 4px solid #ffc107;
    background-color: #fff3cd;
}

.corridor-item.risk-low {
    border-left: 4px solid #28a745;
    background-color: #d4edda;
}

.corridor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.corridor-header h5 {
    margin: 0;
    color: #495057;
    font-size: 1.1em;
}

.risk-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
}

.risk-badge.high {
    background-color: #dc3545;
    color: white;
}

.risk-badge.medium {
    background-color: #ffc107;
    color: #212529;
}

.risk-badge.low {
    background-color: #28a745;
    color: white;
}

.corridor-details {
    font-size: 0.9em;
}

.species-pair {
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
}

.shared-threats {
    color: #6c757d;
    font-style: italic;
}

/* Network node and edge styles for D3 visualizations */
.network-node {
    stroke: #fff;
    stroke-width: 2px;
    cursor: pointer;
}

.network-node:hover {
    stroke-width: 3px;
}

.network-link {
    stroke: #999;
    stroke-opacity: 0.6;
}

.network-text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 10px;
    fill: #333;
    text-anchor: middle;
    pointer-events: none;
}

.pathway-step {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background-color: #e7f3ff;
    border-radius: 4px;
    border-left: 4px solid #007bff;
}

.pathway-step:last-child {
    margin-bottom: 0;
}

.pathway-arrow {
    margin: 0 10px;
    color: #007bff;
    font-weight: bold;
}

.pathway-species {
    font-weight: 600;
    color: #495057;
}

.pathway-threat {
    font-size: 0.9em;
    color: #6c757d;
    font-style: italic;
}

/* Risk level styling */
.risk-low {
    color: #28a745;
    font-weight: bold;
}

.risk-medium {
    color: #ffc107;
    font-weight: bold;
}

.risk-high {
    color: #dc3545;
    font-weight: bold;
}

/* Threat Embeddings Analysis Styles */
.embeddings-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.section-description {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-left: 4px solid #007bff;
    margin-bottom: 30px;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

.embeddings-controls {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-panel .control-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.control-panel .control-group label {
    font-weight: 600;
    color: #495057;
    min-width: 120px;
}

.control-panel .control-group select,
.control-panel .control-group input[type="range"] {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.control-panel .control-group button {
    padding: 8px 16px;
    font-size: 0.9rem;
    color: #fff;
    background-color: #007bff;
    border: 1px solid #007bff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-panel .control-group button:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

#loadEmbeddings {
    background-color: #28a745;
    border-color: #28a745;
}

#loadEmbeddings:hover {
    background-color: #218838;
    border-color: #218838;
}

#performClustering {
    background-color: #dc3545;
    border-color: #dc3545;
}

#performClustering:hover {
    background-color: #c82333;
    border-color: #c82333;
}

#generateClusterLabels {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

#generateClusterLabels:hover {
    background-color: #e0a800;
    border-color: #e0a800;
}

#exportVisualization {
    background-color: #6c757d;
    border-color: #6c757d;
}

#exportVisualization:hover {
    background-color: #5a6268;
    border-color: #5a6268;
}

#numClustersValue {
    font-weight: bold;
    color: #007bff;
    min-width: 20px;
    text-align: center;
}

.loading-indicator {
    text-align: center;
    padding: 20px;
    font-size: 1.1rem;
    color: #007bff;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin: 20px 0;
}

.error-container {
    margin: 20px 0;
}

.error-container .alert {
    padding: 15px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.embeddings-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.dataset-info-section,
.visualization-section,
.clustering-analysis-section,
.pattern-discovery-section,
.method-comparison-section {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.dataset-info-section h3,
.visualization-section h3,
.clustering-analysis-section h3,
.pattern-discovery-section h3,
.method-comparison-section h3 {
    margin: 0 0 20px 0;
    color: #343a40;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.info-panel {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

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

.info-panel strong {
    color: #495057;
}

.visualization-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
    min-height: 600px;
}

@media (max-width: 1200px) {
    .visualization-container {
        flex-direction: column;
    }
}

.embeddings-plot {
    min-height: 600px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    background-color: #fdfdfd;
    display: block;
    position: relative;
    flex: 1;
    width: 100%;
    min-width: 0; /* Prevents flex item from overflowing */
}

.embeddings-plot .placeholder-text {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    max-width: 300px;
    margin: 200px auto;
    display: block;
}

.visualization-info {
    display: flex;
    flex-direction: column;
    width: 300px;
    flex-shrink: 0;
    min-width: 280px;
}

.threat-details-panel {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    max-height: 600px;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
    position: relative; /* Ensure proper positioning */
}

.threat-details h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 1.1rem;
}

.threat-details p {
    margin: 8px 0;
    font-size: 0.9rem;
}

.threat-details strong {
    color: #343a40;
}

.clustering-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.clustering-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .clustering-results {
        grid-template-columns: 1fr;
    }
}

.clustering-summary,
.cluster-labels {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.clustering-summary h4,
.cluster-labels h4 {
    margin: 0 0 15px 0;
    color: #495057;
}

.clustering-summary ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.clustering-summary li {
    padding: 5px 0;
    border-bottom: 1px solid #dee2e6;
}

.clustering-summary li:last-child {
    border-bottom: none;
}

.cluster-label-item {
    background-color: #fff;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.cluster-label-item:last-child {
    margin-bottom: 0;
}

.cluster-label-item h5 {
    margin: 0 0 10px 0;
    color: #007bff;
    font-size: 1rem;
}

.cluster-label-item p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.cluster-label-item ul {
    margin: 5px 0 0 0;
    padding-left: 20px;
}

.cluster-label-item li {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 3px 0;
}

.pattern-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

@media (max-width: 1000px) {
    .pattern-container {
        grid-template-columns: 1fr;
    }
}

.pattern-analysis {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.pattern-analysis h4 {
    margin: 0 0 20px 0;
    color: #495057;
}

.pattern-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pattern-item {
    background-color: #fff;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.pattern-item h5 {
    margin: 0 0 10px 0;
    color: #007bff;
    font-size: 1rem;
}

.pattern-item p {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.outlier-list,
.gradient-analysis,
.cluster-network {
    min-height: 80px;
    background-color: #f8f9fa;
    border: 1px dashed #ced4da;
    border-radius: 4px;
    padding: 10px;
    font-size: 0.85rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.interpretation-guide {
    background-color: #e7f3ff;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #b3d9ff;
}

.interpretation-guide h4 {
    margin: 0 0 15px 0;
    color: #0056b3;
}

.guide-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guide-item {
    background-color: #fff;
    padding: 12px;
    border-radius: 4px;
    border-left: 4px solid #007bff;
    font-size: 0.9rem;
}

.guide-item strong {
    color: #007bff;
}

.comparison-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

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

.method-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.method-card h4 {
    margin: 0 0 15px 0;
    color: #343a40;
    font-size: 1.1rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
}

.method-card p {
    margin: 10px 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.method-card strong {
    color: #495057;
}

/* Plotly chart styling overrides */
.embeddings-plot .plotly {
    width: 100% !important;
    height: 100% !important;
}

.embeddings-plot .svg-container {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Responsive design improvements */
@media (max-width: 768px) {
    .embeddings-container {
        padding: 15px;
    }
    
    .control-panel .control-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-panel .control-group label {
        min-width: unset;
        margin-bottom: 5px;
    }
    
    .embeddings-plot {
        min-height: 400px;
        padding: 10px;
    }
}

/* Academic Use Cases Demo Styles */
.academic-use-cases-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    border-left: 4px solid #007bff;
}

.academic-use-cases-section h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.use-cases-demo {
    margin-top: 15px;
}

.use-cases-demo p {
    color: #5a6c7d;
    font-size: 14px;
    margin-bottom: 20px;
}

.demo-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.demo-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.demo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background-color: #f8f9fa;
}

.demo-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 16px;
}

.demo-card p {
    color: #6c757d;
    font-size: 13px;
    line-height: 1.4;
}

.demo-card p:last-child {
    margin-bottom: 0;
    font-style: italic;
    color: #007bff;
}

.demo-actions {
    text-align: center;
    margin-top: 20px;
}

.demo-run-all-btn {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.demo-run-all-btn:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-1px);
}

/* Academic Modal Styles */
.academic-modal .modal-content {
    max-width: 800px;
    margin: 2% auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
}

.academic-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    position: relative;
}

.academic-modal .modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.academic-modal .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.academic-modal .close-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.academic-modal .modal-body {
    padding: 30px;
}

.use-case-summary h4 {
    color: #2c3e50;
    margin: 20px 0 10px 0;
    font-size: 18px;
    border-left: 3px solid #007bff;
    padding-left: 10px;
}

.use-case-summary h4:first-child {
    margin-top: 0;
}

.use-case-summary p {
    margin: 8px 0;
    line-height: 1.6;
}

.use-case-summary strong {
    color: #495057;
}

.demo-notice {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 6px;
    padding: 15px;
    margin-top: 25px;
}

.demo-notice p {
    margin: 0;
    color: #004085;
}

/* Demo Instructions Modal */
.demo-instructions-modal .modal-content {
    max-width: 700px;
    margin: 3% auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
}

.demo-instructions-modal .modal-header {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    padding: 20px;
    position: relative;
}

.demo-instructions-modal .modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.demo-instructions-modal .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.demo-instructions-modal .close-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.demo-instructions-modal .modal-body {
    padding: 25px;
}

.instructions-content p {
    margin: 10px 0;
    line-height: 1.6;
    color: #333;
}

.instructions-content p:empty {
    margin: 5px 0;
}

.demo-actions {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.switch-tab-btn, .close-demo-btn {
    margin: 0 10px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.switch-tab-btn {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
}

.switch-tab-btn:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-1px);
}

.close-demo-btn {
    background: #28a745;
    color: white;
}

.close-demo-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* Demo Notification Styles */
.demo-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border: 1px solid #007bff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    max-width: 350px;
    animation: slideInRight 0.3s ease;
}

.notification-content {
    padding: 15px 20px;
    position: relative;
}

.close-notification {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-notification:hover {
    color: #333;
}

.notification-content p {
    margin: 0;
    padding-right: 20px;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .demo-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .academic-use-cases-section {
        margin: 10px;
        padding: 15px;
    }
    
    .demo-card {
        padding: 15px;
    }
    
    .academic-modal .modal-content,
    .demo-instructions-modal .modal-content {
        margin: 5% 10px;
        max-width: none;
    }
    
    .demo-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

.metric-explanation {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.metric-explanation h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #343a40;
    font-size: 1.1em;
    border-bottom: 1px solid #ced4da;
    padding-bottom: 10px;
}

.metric-explanation p {
    margin-bottom: 10px;
    font-size: 0.95em;
    line-height: 1.6;
}

.metric-explanation p:last-child {
    margin-bottom: 0;
}

.metric-explanation strong {
    color: #007bff;
    font-weight: 600;
}

.knowledge-transfer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.analysis-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    font-size: 0.9em;
}

.status-loading {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 8px 12px;
    border-radius: 4px;
}

.status-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 8px 12px;
    border-radius: 4px;
}

.status-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 8px 12px;
    border-radius: 4px;
}

.systemic-controls {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.systemic-controls .load-data-btn {
    margin-right: 0;
}

.species-not-found {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.species-not-found h3 {
    color: #856404;
    margin-top: 0;
}

.species-not-found p {
    color: #856404;
    margin: 10px 0;
}

.dataset-info {
    background-color: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 5px;
    padding: 10px;
    margin: 15px 0;
}

.dataset-info p {
    color: #0c5460;
    margin: 0;
}

.species-suggestions {
    margin: 20px 0;
}

.species-suggestions h4 {
    color: #495057;
    margin-bottom: 10px;
}

.suggestion-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.suggestion-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.suggestion-btn:hover {
    background-color: #0056b3;
}

.search-tips {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 15px;
    margin-top: 20px;
}

.search-tips h4 {
    color: #495057;
    margin-top: 0;
    margin-bottom: 10px;
}

.search-tips ul {
    margin: 0;
    padding-left: 20px;
}

.search-tips li {
    color: #6c757d;
    margin-bottom: 5px;
}

.review-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.review-controls {
    margin-bottom: 20px;
    text-align: center;
}

.review-status {
    margin-top: 10px;
    padding: 8px;
    background-color: #f0f8ff;
    border: 1px solid #cce7ff;
    border-radius: 4px;
    color: #0066cc;
    min-height: 20px;
}

.triplet-review-section {
    margin-top: 20px;
}

.review-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 1200px) {
    .review-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.abstract-panel {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.doi-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.doi-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.doi-label {
    font-weight: bold;
    color: #555;
}

.doi-link {
    color: #0066cc;
    text-decoration: none;
    font-family: monospace;
    background: #f0f8ff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #cce7ff;
}

.doi-link:hover {
    background: #e6f3ff;
    text-decoration: underline;
}

.title-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.title-text {
    line-height: 1.5;
    color: #333;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1.1em;
}

.abstract-text {
    line-height: 1.6;
    color: #333;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.review-panel {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.triplet-display {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.triplet-breakdown {
    margin-top: 15px;
}

.triplet-component {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 1rem;
    padding: 0.5rem;
    border-bottom: 1px solid #f1f3f5;
}

.triplet-text {
    text-align: left;
}

.triplet-text span {
    word-break: break-word;
}

.triplet-component strong {
    font-weight: 600;
    color: #495057;
    margin-right: 0.5rem;
}

.review-form h3 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 8px;
}

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

.rating-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

.rating-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.rating-btn {
    padding: 8px 16px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
    font-weight: 500;
}

.rating-btn:hover {
    border-color: #007bff;
    background: #f0f8ff;
}

.rating-btn.selected {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

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

.checklist-section label {
    display: block;
    margin-bottom: 12px;
    font-weight: bold;
    color: #333;
}

.checkbox-group {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: normal !important;
    cursor: pointer;
}

.checkbox-item:last-child {
    margin-bottom: 0;
}

.checkbox-item input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.comments-section {
    margin-top: 1.5rem;
}

.comments-section label {
    font-weight: normal;
    color: #495057;
    margin-bottom: 0.5rem;
    display: block;
}

.comments-section textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    resize: vertical;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    background-color: #f8f9fa;
}

.expert-info {
    margin-bottom: 25px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.expert-info label {
    display: block;
    margin-bottom: 6px;
    margin-top: 12px;
    font-weight: bold;
    color: #333;
}

.expert-info label:first-child {
    margin-top: 0;
}

.expert-info input,
.expert-info select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.submit-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.submit-btn:hover {
    background: #218838;
}

.skip-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.skip-btn:hover {
    background: #5a6268;
}

.review-progress {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
}

.review-progress h3 {
    margin-bottom: 15px;
    color: #333;
}

.progress-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #007bff;
}

.export-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.export-btn:hover {
    background: #138496;
}

/* Session Management Styles */
.reviewer-setup {
    background: #f8f9fa;
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    text-align: center;
}

.reviewer-setup h3 {
    color: #007bff;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.setup-form {
    max-width: 500px;
    margin: 0 auto;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.start-session-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 10px;
}

.start-session-btn:hover {
    background: #0056b3;
}

.active-session {
    background: #d4edda;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.session-info h3 {
    color: #28a745;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.reviewer-info {
    background: white;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.reviewer-label,
.expertise-label {
    font-weight: bold;
    color: #495057;
}

.reviewer-name {
    color: #28a745;
    font-weight: bold;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.expertise-value {
    color: #6c757d;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.session-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.end-session-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.end-session-btn:hover {
    background: #c82333;
}

.review-note {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 25px;
}

.review-note p {
    margin: 0;
    color: #1565c0;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .reviewer-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .session-actions {
        flex-direction: column;
    }
    
    .session-actions button {
        width: 100%;
    }
}

.doi-link:hover {
    background: #e6f3ff;
    text-decoration: underline;
}

.triplet-display-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.triplet-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.triplet-item-number {
    font-size: 1.2em;
    font-weight: 600;
    color: #007bff;
    background-color: #e7f1ff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.triplet-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex-grow: 1;
}

.triplet-validation-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 1rem;
}

.triplet-valid-checkbox {
    width: 17px;
    height: 17px;
    cursor: pointer;
}

.triplet-item .triplet-component {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95em;
    padding: 0.25rem;
    border-bottom: 1px solid #f1f3f5;
}

.triplet-component:last-child {
    border-bottom: none;
}

.triplet-component label {
    font-weight: bold;
    color: #495057;
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.triplet-value {
    color: #212529;
    font-size: 1.1em;
    line-height: 1.4;
}

.title-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.triplet-component strong {
    margin-right: 0.5rem;
}

.review-actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-start;
    gap: 0.75rem;
    align-items: center;
}

.btn-export, .btn-danger {
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
    font-size: 0.95em;
    flex-grow: 0;
    white-space: nowrap;
}

.btn-export {
    background-color: #28a745;
    color: white;
}

.btn-export:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}
