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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #0d1117;
    color: #e6edf3;
    line-height: 1.6;
    min-height: 100vh;
}

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


.main-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    height: calc(100vh - 40px);
    min-height: 600px;
}

.input-section, .output-section {
    display: flex;
    flex-direction: column;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    overflow: hidden;
    min-width: 200px;
}

.resize-handle {
    width: 8px;
    background: transparent;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    position: relative;
}

.resize-handle:hover {
    background: #30363d;
}

.resize-handle-line {
    width: 2px;
    height: 40px;
    background: #6e7681;
    border-radius: 1px;
    opacity: 0.6;
}

.resize-handle:hover .resize-handle-line {
    opacity: 1;
    background: #58a6ff;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: #21262d;
    border-bottom: 1px solid #30363d;
}

.section-header h2 {
    font-size: 0.9rem;
    font-weight: 500;
    color: #f0f6fc;
}

.input-controls, .output-controls {
    display: flex;
    gap: 8px;
}

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

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

.btn-primary:hover {
    background: #2ea043;
}

.btn-secondary {
    background: #21262d;
    color: #e6edf3;
    border: 1px solid #30363d;
}

.btn-secondary:hover {
    background: #30363d;
    border-color: #484f58;
}


#jsonInput {
    flex: 1;
    padding: 20px;
    background: #0d1117;
    border: none;
    color: #e6edf3;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
}

#jsonInput::placeholder {
    color: #6e7681;
}

.json-viewer {
    flex: 1;
    background: #0d1117;
    overflow: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    display: grid;
    grid-template-columns: auto 1fr;
}

.json-gutter {
    background: #161b22;
    border-right: 1px solid #30363d;
    padding: 20px 0;
    min-width: 80px;
    user-select: none;
    display: block;
}

.json-content {
    padding: 20px;
    white-space: pre-wrap;
    display: block;
}

.json-key {
    color: #79c0ff;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.json-string {
    color: #a5d6ff;
    position: relative;
    z-index: 1;
}

.json-number {
    color: #79c0ff;
    position: relative;
    z-index: 1;
}

.json-boolean {
    color: #ffa657;
    position: relative;
    z-index: 1;
}

.json-null {
    color: #f85149;
    font-style: italic;
    position: relative;
    z-index: 1;
}

.json-bracket {
    color: #8b949e;
    font-weight: bold;
    position: relative;
    z-index: 1;
}

.json-comma {
    color: #8b949e;
    position: relative;
    z-index: 1;
}

.json-line {
    position: relative;
    min-height: 21px;
    line-height: 1.5;
    display: block;
}

.json-line-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    position: relative;
}

.json-indent-guides {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.json-indent-guide {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #30363d;
    opacity: 0.6;
}

.json-line-number {
    color: #6e7681;
    padding: 0 8px;
    min-width: 60px;
    font-size: 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    line-height: 1.5;
    position: relative;
    padding-top: 1px;
}

.line-num {
    flex-shrink: 0;
    min-width: 24px;
    text-align: right;
    line-height: 21px;
}

.json-expand-icon {
    color: #8b949e;
    font-size: 12px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    cursor: pointer;
    user-select: none;
    margin-left: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    margin-top: 2px;
}

.json-expand-icon.collapsed {
    transform: rotate(-90deg);
}

.json-expand-icon:hover {
    color: #58a6ff;
}

.json-line-content {
    flex: 1;
    padding-left: 4px;
}

.json-children {
    display: block;
}

.json-children.collapsed {
    display: none;
}

.json-indent {
    display: inline-block;
    width: 20px;
}

.json-expandable {
    cursor: pointer;
    position: relative;
    display: inline-block;
}

.error-message {
    padding: 12px 20px;
    background: #da3633;
    color: white;
    font-size: 0.9rem;
    border-top: 1px solid #30363d;
    display: none;
}

.info-message {
    padding: 12px 20px;
    background: #0969da;
    color: white;
    font-size: 0.9rem;
    border-top: 1px solid #30363d;
    display: none;
}

.success-message {
    background: #238636 !important;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
        height: auto;
    }
    
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .input-controls, .output-controls {
        width: 100%;
        justify-content: flex-end;
    }
    
    .json-gutter {
        min-width: 50px;
    }
    
    .json-line-number {
        min-width: 25px;
    }
}