/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

/* 头部样式 */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* 导航样式 */
nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 12px 24px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-btn:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.3);
}

.nav-btn.active {
    background: #2c3e50;
    color: white;
}

/* 主要内容区域 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-section {
    display: block;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.content-section.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

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

.content-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
}

/* 统计卡片网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.stat-card p {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-card span {
    font-size: 0.9rem;
    opacity: 0.8;
}

.content-section#datapoints {
    padding: 20px;
}

.search-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.search-controls input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 16px;
}

.search-controls select {
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 16px;
}

.search-controls input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.datapoints-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));
    gap: 40px;
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Filter Header Styles */
.filter-header {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.filter-header h2 {
    color: #2c3e50;
    margin: 0 0 20px 0;
    font-size: 2em;
    text-align: center;
}

.filters-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.type-filter-container,
.datasource-filter-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.type-filter-container label,
.datasource-filter-container label {
    font-weight: 600;
    color: #495057;
    font-size: 1.1em;
    white-space: nowrap;
}

.type-filter-dropdown,
.datasource-filter-dropdown {
    padding: 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    font-size: 1em;
    color: #495057;
    cursor: pointer;
    min-width: 180px;
    transition: all 0.2s ease;
}

.type-filter-dropdown:hover,
.datasource-filter-dropdown:hover {
    border-color: #667eea;
}

.type-filter-dropdown:focus,
.datasource-filter-dropdown:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.results-info {
    text-align: center;
    color: #6c757d;
    font-size: 1em;
    font-weight: 500;
}

.datapoint-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.datapoint-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.datapoint-id {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 15px;
}

.datapoint-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.datapoint-type-tag,
.datapoint-source-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 500;
}

.datapoint-type-tag {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.datapoint-source-tag {
    background: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #e1bee7;
}

.datapoint-title {
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 600;
    line-height: 1.4;
    margin: 15px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.datapoint-doi {
    color: #7f8c8d;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
    margin: 10px 0 20px 0;
    word-break: break-all;
}
.datapoint-type {
    /* color: #7f8c8d; */
    font-size: 1.3em;
    /* font-family: 'Segoe UI'; */
    margin: 10px 0 20px 0;
    word-break: break-all;
}
.view-full-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95em;
    transition: all 0.3s ease;
    width: 100%;
}

.view-full-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.datapoint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.datapoint-header h3 {
    color: #64b5f6;
    margin: 0;
    font-size: 1.5em;
}

.datapoint-header .doi {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
    font-family: monospace;
}

.datapoint-title {
    margin-bottom: 20px;
}

.datapoint-title p {
    color: #fff;
    font-size: 1.1em;
    line-height: 1.6;
    margin: 0;
}

.datapoint-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.data-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.data-section h4 {
    color: #81c784;
    margin: 0 0 15px 0;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-item, .json-item, .text-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.download-btn, .view-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
}

.download-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
}

.view-btn {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
}

.view-btn:hover {
    background: linear-gradient(135deg, #1976d2, #1565c0);
    transform: translateY(-2px);
}

.json-display, .text-display {
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 300px;
    overflow-y: auto;
}

.json-display pre, .text-display pre {
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.text-section {
    margin-bottom: 20px;
}

.text-section h5 {
    color: #ffb74d;
    margin: 0 0 10px 0;
    font-size: 1em;
    border-bottom: 1px solid rgba(255, 183, 77, 0.3);
    padding-bottom: 5px;
}

.image-gallery-small {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.image-item-small {
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.image-item-small:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.image-item-small img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
}

.image-item-small span {
    display: block;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    margin: 50px auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.modal-content img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close:hover {
    color: #ff6b6b;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .datapoints-container {
        grid-template-columns: 1fr;
    }
    
    .datapoint-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .search-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .datapoints-container {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 20px 15px;
    }
    
    .datapoint-card {
        padding: 20px;
    }
    
    .pdf-item, .json-item, .text-item {
        flex-direction: column;
        gap: 8px;
    }
    
    .image-gallery-small {
        grid-template-columns: 1fr;
    }
}

.file-actions {
    display: flex;
    gap: 10px;
}

.view-btn {
    padding: 8px 16px;
    background: #9b59b6;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: #8e44ad;
    transform: translateY(-2px);
}

/* 文件列表样式 */
.file-list {
    display: grid;
    gap: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.file-details h4 {
    color: #2c3e50;
    margin-bottom: 0.2rem;
}

.file-details p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.download-btn {
    padding: 8px 16px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #219a52;
    transform: translateY(-2px);
}

/* 可视化控制 */
.visualization-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.visualization-controls select,
.visualization-controls button {
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.visualization-controls button {
    background: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.visualization-controls button:hover {
    background: #2980b9;
}

/* 图表容器 */
.chart-container {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 400px;
}

/* 数据显示 */
.data-display {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* 文本分析样式 */
.text-analysis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.text-stats {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
}

.word-cloud {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

#wordcloud-container {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    margin-top: 1rem;
}

.text-display {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    line-height: 1.6;
}

/* 图像控制 */
.image-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.image-controls button,
.image-controls select {
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.image-controls button {
    background: #9b59b6;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.image-controls button:hover {
    background: #8e44ad;
}

/* 图像画廊 */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.image-gallery.list-view {
    grid-template-columns: 1fr;
}

.image-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.image-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
}

.image-gallery.list-view .image-item {
    display: flex;
    align-items: center;
}

.image-gallery.list-view .image-item img {
    width: 150px;
    height: 100px;
    flex-shrink: 0;
}

.image-info {
    padding: 1rem;
}

.image-info h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.image-info p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    margin-top: 2rem;
}

footer p {
    color: #7f8c8d;
}

/* 概览部分特殊样式 */
.overview-description {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin-top: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.overview-description h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.overview-description ul {
    margin-left: 1.5rem;
    line-height: 1.8;
}

.overview-description li {
    margin-bottom: 0.5rem;
}

.overview-description strong {
    color: #3498db;
}

/* 部分描述样式 */
.section-description {
    color: #7f8c8d;
    font-style: italic;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .nav-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .content-section {
        padding: 1.5rem;
    }
    
    .text-analysis {
        grid-template-columns: 1fr;
    }
    
    .visualization-controls {
        flex-direction: column;
    }
    
    .image-controls {
        flex-direction: column;
    }
}

/* Single Data Point Page Styles */
.single-datapoint-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.datapoint-header-full {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 20px;
}

.switchers-container {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.type-switcher,
.datasource-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.type-switcher label,
.datasource-switcher label {
    font-size: 0.9em;
    opacity: 0.9;
    white-space: nowrap;
    font-weight: 600;
}

.type-switcher-dropdown,
.datasource-switcher-dropdown {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9em;
    cursor: pointer;
    min-width: 100px;
}

.type-switcher-dropdown:focus,
.datasource-switcher-dropdown:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
}

.type-switcher-dropdown option,
.datasource-switcher-dropdown option {
    background: #333;
    color: white;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

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

.datapoint-header-full h1 {
    margin: 0 0 15px 0;
    font-size: 2.5em;
}

.datapoint-meta {
    margin-top: 15px;
}

.datapoint-meta p {
    margin: 8px 0;
    font-size: 1.1em;
    opacity: 0.95;
}

/* New Layout Styles */
.datapoint-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.top-section {
    display: flex;
    flex-direction: row-reverse;
    gap: 20px;
    min-height: 400px;
}

.analysis-panel, .diagram-panel {
    flex: 1;
}

.bottom-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.analysis-panel, .diagram-panel, .pdf-panel, .netlist-panel {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-width: 0;
}

.analysis-panel h3, .diagram-panel h3, .pdf-panel h3, .netlist-panel h3 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.image-container {
    text-align: center;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-container img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive Design for New Layout */
@media (max-width: 768px) {
    .top-section, .bottom-section {
        flex-direction: column;
    }
    
    .top-section {
        min-height: auto;
    }
    
    .bottom-section {
        grid-template-columns: 1fr;
    }
}

/* PDF Section */
.pdf-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.pdf-controls .download-btn,
.pdf-controls .view-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

.view-btn {
    background: #007bff;
    color: white;
}

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

.pdf-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

/* Analysis and Text Displays */
.analysis-display,
.text-display {
    margin-top: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.analysis-content,
.text-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    color: #000000;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.6;
}

.analysis-text {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 0 0 6px 6px;
    overflow-x: auto;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    max-width: 100%;
    margin-top: 0;
    border: none;
}

/* JSON Key Selector */
.json-key-selector {
    margin-bottom: 15px;
}

.json-key-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 0.9em;
}

.json-key-dropdown {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
}

.json-key-dropdown:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.json-key-dropdown:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.json-key-dropdown option {
    padding: 8px;
    background: #fff;
    color: #495057;
}

/* JSON Display Styles */
.json-key-title {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 10px 15px;
    border-radius: 6px 6px 0 0;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.no-data-message {
    background: #f8f9fa;
    color: #6c757d;
    padding: 20px;
    text-align: center;
    border-radius: 6px;
    border: 1px dashed #dee2e6;
    font-style: italic;
}

.json-display {
    background: #2d3748;
    color: #e2e8f0;
    padding: 15px;
    border-radius: 0 0 6px 6px;
    overflow-x: auto;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    max-width: 100%;
    margin-top: 0;
}

.markdown-display {
    background: #f8f9fa;
    color: #333;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    border: 1px solid #dee2e6;
}

.text-section {
    margin-bottom: 20px;
}

.text-section h4 {
    color: #495057;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #dee2e6;
}

.text-content-display {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Image Gallery Full */
.image-gallery-full {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.image-item-full {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-item-full:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.image-item-full img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #eee;
    margin-bottom: 10px;
}

.image-item-full h4 {
    margin: 10px 0 5px 0;
    color: #333;
    font-size: 1.1em;
}

.image-item-full p {
    color: #666;
    font-size: 0.9em;
    margin: 0;
}

/* Navigation Controls */
.navigation-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.nav-control-btn {
    padding: 12px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-control-btn:hover:not(:disabled) {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.nav-control-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.current-position {
    font-weight: 500;
    color: #495057;
    background: white;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

/* Quick Navigation */
.quick-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-nav-input {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    width: 100px;
    text-align: center;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.quick-nav-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.quick-nav-btn {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

/* View Single Button for List View */
.view-single-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.view-single-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* Error Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
}

.error-detail {
    font-size: 0.9em;
    margin-top: 5px;
    opacity: 0.8;
}

/* Loading Messages */
.loading-message {
    background: #e7f3ff;
    color: #0c5460;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #bee5eb;
    text-align: center;
    font-style: italic;
}

/* Image Modal */
.image-modal {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-image {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #ff6b6b;
}

/* Responsive Design for Single Data Point Page */
@media (max-width: 768px) {
    .single-datapoint-page {
        padding: 10px;
    }
    
    .datapoint-header-full {
        padding: 20px;
    }
    
    .datapoint-header-full h1 {
        font-size: 1.8em;
    }
    
    .header-top-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .switchers-container {
        justify-content: center;
        gap: 15px;
    }
    
    .filters-container {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .type-filter-dropdown,
    .datasource-filter-dropdown {
        min-width: 160px;
    }
    
    .section-nav {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .section-nav-btn {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }
    
    .pdf-controls {
        flex-direction: column;
    }
    
    .navigation-controls {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .quick-nav {
        justify-content: center;
    }
    
    .quick-nav-input {
        width: 120px;
    }
    
    .image-gallery-full {
        grid-template-columns: 1fr;
    }
}

/* Edit functionality styles */
.edit-controls {
    margin-top: 1rem;
    padding: 1rem 0;
    border-top: 2px solid #e1e8ed;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.edit-btn, .mark-correct-btn, .view-edits-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.edit-btn {
    background: #3498db;
    color: white;
}

.edit-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.mark-correct-btn {
    background: #27ae60;
    color: white;
}

.mark-correct-btn:hover {
    background: #229954;
    transform: translateY(-1px);
}

.view-edits-btn {
    background: #9b59b6;
    color: white;
}

.view-edits-btn:hover {
    background: #8e44ad;
    transform: translateY(-1px);
}

.edit-panel {
    margin-top: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.edit-header h4 {
    margin: 0;
    color: #2c3e50;
}

.close-edit-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.close-edit-btn:hover {
    background: #c0392b;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.user-name-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.user-name-input:focus {
    border-color: #3498db;
    outline: none;
}

.json-editor {
    width: 100%;
    padding: 1rem;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    background: white;
    resize: vertical;
    min-height: 300px;
    transition: border-color 0.3s ease;
}

.json-editor:focus {
    border-color: #3498db;
    outline: none;
}

.edit-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.save-edit-btn, .cancel-edit-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.save-edit-btn {
    background: #27ae60;
    color: white;
}

.save-edit-btn:hover:not(:disabled) {
    background: #229954;
    transform: translateY(-1px);
}

.save-edit-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.cancel-edit-btn {
    background: #e74c3c;
    color: white;
}

.cancel-edit-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.edit-indicator, .correct-indicator {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
}

.edited-indicator {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
}

.edit-indicator {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.correct-indicator {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

/* Title status indicators */
.title-status {
    font-size: 0.85em;
    font-weight: normal;
    color: #666;
    margin-left: 0.5rem;
}

/* Edit history modal styles */
.edit-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.edit-history-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 80vw;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.edit-history-header {
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edit-history-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close-modal-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    transition: background 0.3s ease;
}

.close-modal-btn:hover {
    background: #c0392b;
}

.edit-history-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.edit-entry {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
}

.edit-entry:last-child {
    margin-bottom: 0;
}

.edit-entry .edit-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.edit-user, .edit-time, .edit-type {
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.edit-user {
    background: #e3f2fd;
    color: #1976d2;
}

.edit-time {
    background: #fff3e0;
    color: #f57c00;
}

.edit-type {
    background: #f3e5f5;
    color: #7b1fa2;
}

.edit-data {
    margin-top: 1rem;
}

.edit-data summary {
    cursor: pointer;
    font-weight: 600;
    color: #3498db;
    padding: 0.5rem;
    background: #f1f3f4;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.edit-data summary:hover {
    background: #e8eaed;
}

.edit-data pre {
    margin-top: 0.5rem;
    padding: 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
}

.no-edits {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
}

/* Responsive design for edit functionality */
@media (max-width: 768px) {
    .edit-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .edit-btn, .mark-correct-btn, .view-edits-btn {
        width: 100%;
        justify-content: center;
    }
    
    .edit-actions {
        flex-direction: column;
    }
    
    .save-edit-btn, .cancel-edit-btn {
        width: 100%;
    }
    
    .edit-history-content {
        max-width: 95vw;
        max-height: 90vh;
    }
    
    .edit-entry .edit-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .edit-user, .edit-time, .edit-type {
        align-self: flex-start;
    }
}
