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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
    line-height: 1.6;
}

#app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

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

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

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

.input-section {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.tab-content {
    display: none;
}

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

#jsonInput {
    width: 100%;
    height: 300px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #f0f2ff;
}

.upload-icon {
    width: 60px;
    height: 60px;
    color: #667eea;
    margin-bottom: 20px;
}

.path-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.path-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

#pathInput {
    width: calc(100% - 150px);
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    margin-right: 10px;
}

.path-suggestions {
    margin-top: 10px;
    display: none;
}

.path-suggestion {
    display: inline-block;
    padding: 5px 10px;
    margin: 5px;
    background: #f0f2ff;
    border: 1px solid #667eea;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.path-suggestion:hover {
    background: #667eea;
    color: white;
}

.action-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5567d8;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

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

.error-message {
    margin-top: 15px;
    padding: 10px;
    background: #fee;
    color: #c00;
    border-radius: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

.table-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

#globalSearch {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

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

.table-info {
    margin-bottom: 15px;
    color: #666;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

#dataTable {
    width: 100%;
    border-collapse: collapse;
}

#dataTable thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

#dataTable th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    cursor: pointer;
    user-select: none;
    position: relative;
    white-space: nowrap;
}

#dataTable th:hover {
    background: #e9ecef;
}

.sort-indicator {
    margin-left: 5px;
    opacity: 0.5;
}

.sort-indicator.active {
    opacity: 1;
}

.filter-indicator {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 5px;
    background: #667eea;
    color: white;
    border-radius: 3px;
    font-size: 12px;
    text-align: center;
    line-height: 16px;
    cursor: pointer;
}

.filter-indicator.active {
    background: #ff6b6b;
}

#dataTable td {
    padding: 10px 12px;
    border-bottom: 1px solid #dee2e6;
}

#dataTable tbody tr:hover {
    background: #f8f9ff;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 5px;
}

.pagination button:hover:not(:disabled) {
    background: #f8f9fa;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .page-info {
    padding: 0 15px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

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

.filter-search input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    margin-bottom: 15px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-actions button,
.filter-actions select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    cursor: pointer;
}

.filter-info {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.filter-options {
    max-height: 300px;
    overflow-y: auto;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.filter-option:hover {
    background: #f8f9ff;
}

.filter-option input[type="checkbox"] {
    margin-right: 10px;
}

.filter-option-label {
    flex: 1;
}

.filter-option-count {
    color: #666;
    font-size: 14px;
    margin-left: 10px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.truncate {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cell-number {
    text-align: right;
}

.cell-boolean {
    text-align: center;
}

.true-value {
    color: #28a745;
    font-weight: 600;
}

.false-value {
    color: #dc3545;
    font-weight: 600;
}

.null-value {
    color: #999;
    font-style: italic;
}