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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #0066cc;
    color: white;
}

.btn-primary:hover {
    background: #0052a3;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

/* Content Area */
.content {
    display: flex;
    flex: 1;
    gap: 1px;
    padding: 10px;
    background: #e0e0e0;
    overflow: hidden;
}

/* Panes */
.pane {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.left-pane {
    flex: 0 0 48%;
}

.right-pane {
    flex: 1;
}

.pane-header {
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
    padding: 15px 20px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.pane-header h2 {
    font-size: 16px;
    font-weight: 600;
}

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

/* JSON Viewer */
#jsonViewer {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    background: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Tree Viewer */
.tree-viewer {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
}

.tree-node {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    overflow: hidden;
}

.tree-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f0f0f0;
    border-bottom: 1px solid #ddd;
    font-weight: 600;
    cursor: pointer;
}

.tree-header:hover {
    background: #e8e8e8;
}

.tree-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
}

.toggle-icon {
    display: inline-block;
}

.tree-type {
    font-size: 14px;
    font-weight: 600;
    color: #0066cc;
}

.tree-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: normal;
    color: #999;
    background: white;
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.tree-count:first-of-type {
    margin-left: 10px;
}

.tree-content {
    padding: 5px 0;
}

.tree-content.hidden {
    display: none;
}

.tree-property {
    border-left: 1px solid #e0e0e0;
    margin-left: 15px;
}

.tree-property-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
}

.tree-property-header:hover {
    background: #f5f5f5;
}

.tree-property-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 6px 12px;
}

.tree-key {
    font-weight: 500;
    color: #333;
    min-width: 150px;
    word-break: break-word;
}

.tree-value {
    color: #666;
    word-break: break-all;
    flex: 1;
    max-width: 400px;
    white-space: pre-wrap;
}

.tree-array-count {
    margin-left: auto;
    font-size: 12px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
}

.tree-array-item {
    padding-left: 20px;
    border-left: 1px solid #e8e8e8;
}

.root-node {
    margin-bottom: 20px;
}

/* Tree Controls */
.tree-controls {
    display: flex;
    gap: 8px;
}

.tree-control-btn {
    padding: 6px 12px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.tree-control-btn:hover {
    background: #0052a3;
}

.tree-control-btn:active {
    transform: scale(0.98);
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

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

.modal-header h2 {
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    background: #f9f9f9;
}

.tab-button {
    flex: 1;
    padding: 15px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-button.active {
    color: #0066cc;
    border-bottom-color: #0066cc;
}

.tab-button:hover {
    color: #0066cc;
}

/* Tab Content */
.tab-content {
    padding: 20px;
}

.tab-pane {
    display: none;
}

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

.tab-pane label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.tab-pane input,
.tab-pane textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 8px;
    resize: vertical;
}

.tab-pane input:focus,
.tab-pane textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.tab-pane small {
    display: block;
    color: #999;
    font-size: 12px;
}

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

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0066cc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}

/* Responsive */
@media (max-width: 1200px) {
    .content {
        flex-direction: column;
    }

    .left-pane,
    .right-pane {
        flex: 1 !important;
    }

    .compliance-status {
        grid-template-columns: 1fr;
    }
}
