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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
    flex-shrink: 0;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.file-upload-section {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.file-input-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-input-group label {
    font-weight: 600;
    min-width: 150px;
    color: #333;
}

.file-input-group input[type="file"] {
    padding: 8px;
    border: 2px solid #667eea;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    flex: 0 0 auto;
}

.file-name {
    color: #666;
    font-style: italic;
    font-size: 0.9em;
}

.status {
    padding: 15px 30px;
    font-weight: 500;
    text-align: center;
    flex-shrink: 0;
}

.status.success {
    background: #d4edda;
    color: #155724;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
}

.status.info {
    background: #d1ecf1;
    color: #0c5460;
}

/* File Details Section (Collapsible) */
.file-details-section {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.file-details-header {
    padding: 15px 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.file-details-header:hover {
    background: #e9ecef;
}

.file-details-header h2 {
    color: #333;
    font-size: 1.3em;
    margin: 0;
}

.collapse-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.collapse-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
}

.toggle-icon {
    color: #667eea;
    font-size: 1.2em;
    font-weight: bold;
    transition: transform 0.3s ease;
    display: inline-block;
}

.file-details-section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.file-details-content {
    padding: 20px 30px;
    max-height: 500px;
    overflow-y: auto;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.file-details-section.collapsed .file-details-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

.file-details-content .info-section {
    margin-bottom: 0;
    border-left: none;
    padding: 0;
    background: transparent;
}

.file-details-content .info-section h3 {
    display: none;
}

.file-details-content .info-item {
    padding: 10px 0;
}

.content-wrapper {
    flex: 1;
    overflow: hidden;
    display: flex;
}

/* Schema Pane Layout */
.schema-pane {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
}

.pane-header {
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.pane-header h2 {
    color: #333;
    font-size: 1.4em;
}

.schema-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: 600;
    border: 2px solid #667eea;
    border-radius: 6px;
    background: white;
    color: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

.control-btn:disabled {
    background: #e9ecef;
    color: #adb5bd;
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.6;
}

.pane-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.placeholder {
    text-align: center;
    color: #999;
    padding: 60px 20px;
    font-size: 1.1em;
}

/* File Info Styles */
.info-section {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.info-section h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.info-label {
    font-weight: 600;
    color: #555;
}

.info-value {
    color: #333;
    font-family: 'Courier New', Courier, monospace;
}

/* Schema Tree Styles */
.schema-tree {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95em;
}

.schema-node {
    margin-left: 20px;
    position: relative;
}

.schema-node.root {
    margin-left: 0;
}

.schema-field {
    padding: 8px 10px;
    margin: 2px 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s ease;
}

.schema-field:hover {
    background: #f8f9fa;
}

.field-toggle {
    cursor: pointer;
    user-select: none;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    color: #667eea;
    font-weight: bold;
}

.field-toggle.empty {
    visibility: hidden;
}

.field-toggle::before {
    content: '▶';
    display: inline-block;
    transition: transform 0.2s ease;
}

.field-toggle.expanded::before {
    transform: rotate(90deg);
}

.field-name {
    font-weight: 600;
    color: #333;
    flex-shrink: 0;
}

.field-type {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    flex-shrink: 0;
}

.field-type.string {
    background: #d4edda;
    color: #155724;
}

.field-type.number {
    background: #cce5ff;
    color: #004085;
}

.field-type.boolean {
    background: #fff3cd;
    color: #856404;
}

.field-type.array {
    background: #e7e7ff;
    color: #3d3d99;
}

.field-type.object {
    background: #f8d7da;
    color: #721c24;
}

.field-type.null {
    background: #e2e3e5;
    color: #383d41;
}

.field-info {
    font-size: 0.85em;
    color: #666;
    flex-shrink: 0;
}

.field-clickable {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    background: #667eea;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.field-clickable:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

.field-children {
    display: none;
    margin-top: 4px;
}

.field-children.visible {
    display: block;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    font-size: 1.3em;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

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

.modal-body {
    padding: 20px 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.value-search {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95em;
}

.value-search:focus {
    outline: none;
    border-color: #667eea;
}

.sort-select {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95em;
    cursor: pointer;
    background: white;
}

.sort-select:focus {
    outline: none;
    border-color: #667eea;
}

.copy-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

.modal-stats {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.stat-label {
    font-weight: 600;
    color: #555;
}

.stat-value {
    color: #333;
    font-family: 'Courier New', Courier, monospace;
}

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

.value-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin: 4px 0;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    transition: all 0.2s ease;
}

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

.value-text {
    flex: 1;
    font-family: 'Courier New', Courier, monospace;
    color: #333;
    word-break: break-all;
}

.value-stats {
    display: flex;
    gap: 15px;
    align-items: center;
}

.value-count {
    font-weight: 600;
    color: #667eea;
}

.value-percentage {
    font-size: 0.9em;
    color: #666;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* Modal Pagination Styles */
.modal-pagination {
    padding: 15px;
    margin: 15px 0;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.pagination-info {
    color: #555;
    font-size: 0.95em;
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.pagination-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.pagination-btn:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.page-indicator {
    color: #333;
    font-weight: 600;
    font-size: 0.95em;
}

/* Warning Styles */
.stat-row.warning {
    background: #fff3cd;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    border-left: 4px solid #ffc107;
}

.stat-row.warning .stat-label {
    color: #856404;
}

.stat-row.warning .stat-value {
    color: #856404;
    font-weight: 600;
}

/* Scrollbar Styles */
.pane-content::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.values-list::-webkit-scrollbar {
    width: 8px;
}

.pane-content::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.values-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.pane-content::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.values-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.pane-content::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.values-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

