/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    padding: 25px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

header h1 {
    font-size: 2.2rem;
    color: #2d3748;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

header h1 i {
    color: #4299e1;
}

.subtitle {
    font-size: 1.1rem;
    color: #718096;
}

/* Sections */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: 1.3rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* Input & Output Areas */
.input-section, .output-section {
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

textarea, .output-area {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: white;
    color: #2d3748;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: #4299e1;
}

.output-container {
    position: relative;
}

.output-area {
    overflow-x: auto;
    white-space: pre;
    min-height: 250px;
    max-height: 400px;
    overflow-y: auto;
    padding-left: 50px;
}

.output-area.dark {
    background: #1a202c;
    color: #e2e8f0;
    border-color: #4a5568;
}

/* Line Numbers */
.line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 45px;
    padding: 16px 8px;
    background: #edf2f7;
    border-right: 1px solid #cbd5e0;
    text-align: right;
    font-family: 'Courier New', monospace;
    color: #718096;
    font-size: 13px;
    line-height: 1.5;
    user-select: none;
}

.output-area.dark + .line-numbers {
    background: #2d3748;
    color: #a0aec0;
    border-right-color: #4a5568;
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn.primary {
    background: #4299e1;
    color: white;
}

.btn.primary:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn.secondary:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
}

.options {
    display: flex;
    gap: 15px;
    margin-left: auto;
}

.options label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4a5568;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Footer areas */
.output-footer {
    margin-top: 12px;
    font-size: 0.85rem;
    color: #718096;
    text-align: right;
}

.validation-valid {
    color: #38a169;
    font-weight: 500;
}

.validation-invalid {
    color: #e53e3e;
    font-weight: 500;
}

/* Info Box */
.info-box {
    background: #ebf8ff;
    border-radius: 10px;
    padding: 18px;
    border-left: 4px solid #4299e1;
}

.info-box h3 {
    color: #2c5282;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.info-box ul {
    list-style: none;
}

.info-box li {
    padding: 6px 0;
    padding-left: 22px;
    position: relative;
    color: #4a5568;
}

.info-box li:before {
    content: '•';
    position: absolute;
    left: 8px;
    color: #4299e1;
    font-weight: bold;
}

/* Main Footer */
footer {
    margin-top: 30px;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
    color: #718096;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 18px;
        border-radius: 12px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .options {
        margin-left: 0;
        justify-content: center;
    }
    
    .output-area {
        padding-left: 45px;
        font-size: 13px;
    }
}

/* JSON Syntax Highlighting */
.json-key { color: #d33682; }
.json-string { color: #2aa198; }
.json-number { color: #268bd2; }
.json-boolean { color: #cb4b16; }
.json-null { color: #6c71c4; }
.json-punctuation { color: #93a1a1; }

.dark .json-key { color: #f78c6c; }
.dark .json-string { color: #c3e88d; }
.dark .json-number { color: #82aaff; }
.dark .json-boolean { color: #ffcb6b; }
.dark .json-null { color: #c792ea; }
.dark .json-punctuation { color: #89ddff; }