:root {
    --bg-primary: #1e1e1e;
    --bg-secondary: #252526;
    --bg-tertiary: #2d2d2d;
    --border-color: #404040;
    --text-primary: #d4d4d4;
    --text-secondary: #9ca3af;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --success: #22c55e;
    --error: #ef4444;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

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

/* Header Styles */
.header {
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

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

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-blue), #8b5cf6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.toolbar {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #3d3d3d;
    border-color: #505050;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stats {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.status-valid {
    color: var(--success);
}

.status-error {
    color: var(--error);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.panel-header {
    height: 40px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
}

.panel-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-actions {
    display: flex;
    gap: 6px;
}

.panel-btn {
    padding: 4px 10px;
    font-size: 11px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.panel-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.divider {
    width: 1px;
    background: var(--border-color);
    cursor: col-resize;
    position: relative;
}

.divider:hover {
    background: var(--accent-blue);
}

/* Editor Area */
.editor-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.editor-textarea {
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: none;
    outline: none;
    resize: none;
    padding: 16px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    tab-size: 2;
}

.editor-textarea::placeholder {
    color: var(--text-secondary);
}

/* Output Area */
.output-container {
    flex: 1;
    overflow: auto;
    background: var(--bg-primary);
    padding: 16px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.output-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.output-container::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.output-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.output-container::-webkit-scrollbar-thumb:hover {
    background: #505050;
}

/* Prism.js overrides for dark theme */
.output-container pre {
    margin: 0;
    padding: 0;
    background: transparent;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
}

.output-container code {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    background: transparent;
}

/* JSON Tree View Styles */
.json-tree {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.json-item {
    padding-left: 20px;
    position: relative;
}

.json-item::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border-color);
}

.json-item:last-child::before {
    height: 14px;
}

.json-key {
    color: #9cdcfe;
    cursor: pointer;
}

.json-key:hover {
    text-decoration: underline;
}

.json-string {
    color: #ce9178;
}

.json-number {
    color: #b5cea8;
}

.json-boolean {
    color: #569cd6;
}

.json-null {
    color: #569cd6;
    font-style: italic;
}

.json-bracket {
    color: #ffd700;
}

.json-toggle {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.json-toggle svg {
    width: 10px;
    height: 10px;
    transition: transform 0.2s ease;
}

.json-toggle:hover {
    color: var(--accent-blue);
}

.json-toggle.collapsed svg {
    transform: rotate(0deg);
}

.json-toggle.expanded svg {
    transform: rotate(90deg);
}

/* Error Display */
.error-display {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    border-radius: 8px;
    padding: 20px;
    margin: 16px;
    color: var(--error);
}

.error-display h4 {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-display pre {
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    opacity: 0.9;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
    padding: 40px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 14px;
    max-width: 300px;
    line-height: 1.6;
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    pointer-events: none;
}

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

/* View mode toggle */
.view-modes {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.view-mode-btn {
    padding: 3px 8px;
    font-size: 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-mode-btn:hover {
    background: var(--bg-secondary);
}

.view-mode-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

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

    .panel {
        flex: none;
        height: 50%;
    }

    .divider {
        width: 100%;
        height: 1px;
        cursor: row-resize;
    }

    .header {
        padding: 0 12px;
    }

    .toolbar {
        display: none;
    }

    .stats {
        display: none;
    }
}