* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
@import url('https://fonts.googleapis.com/css2?family=Mozilla+Text:wght@200..700&display=swap');
body {
    font-family: "Mozilla Text", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

h1 {
    color: #333;
    font-size: 2.5em;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 25px;
    border: 2px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.lang-toggle:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.lang-toggle.active {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
}

.lang-flag {
    font-size: 1.2em;
}

.input-section {
    margin-bottom: 30px;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.input-header h2 {
    color: #555;
    font-size: 1.3em;
    margin: 0;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

button:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.btn-danger {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

#jsonInput {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fafafa;
}

#jsonInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#jsonInput.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

#jsonInput.success {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.output-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.output-panel {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.output-panel h3 {
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon {
    width: 20px;
    height: 20px;
    display: inline-block;
}

#treeView {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    max-height: 600px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

#formattedJson {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    max-height: 600px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    white-space: pre-wrap;
    word-break: break-all;
}

/* JSON Syntax Highlighting */
.json-key {
    color: #8b5cf6;
    font-weight: bold;
}

.json-string {
    color: #10b981;
}

.json-number {
    color: #f59e0b;
}

.json-boolean {
    color: #3b82f6;
    font-weight: bold;
}

.json-null {
    color: #6b7280;
    font-style: italic;
}

.json-bracket {
    color: #374151;
    font-weight: bold;
}

/* Tree View Styles */
.expandable {
    cursor: pointer;
    user-select: none;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.expandable:hover {
    background-color: #e5e7eb;
}

.collapsed {
    display: none;
}

.expand-icon {
    display: inline-block;
    width: 12px;
    text-align: center;
    margin-right: 5px;
    transition: transform 0.2s;
}

.expanded .expand-icon {
    transform: rotate(90deg);
}

/* Status Messages */
.error {
    color: #ef4444;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.success {
    color: #10b981;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-weight: 500;
}

.warning {
    color: #f59e0b;
    background-color: #fffbeb;
    border: 1px solid #fed7aa;
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-weight: 500;
}

/* Statistics */
.stats {
    background: linear-gradient(45deg, #f0f9ff, #e0f2fe);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
}

.stat-item {
    text-align: center;
    min-width: 80px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #0369a1;
}

.stat-label {
    font-size: 0.9em;
    color: #64748b;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: #6b7280;
    padding: 40px;
    font-style: italic;
}

/* Copy Button */
.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #667eea;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.copy-btn:hover {
    background: rgba(102, 126, 234, 0.2);
}

.panel-with-copy {
    position: relative;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
    }
    
    .output-section {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .input-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header {
        flex-direction: column;
        text-align: center;
    }

    h1 {
        font-size: 2em;
    }
    
    #jsonInput {
        height: 150px;
        font-size: 13px;
    }
    
    #treeView, #formattedJson {
        max-height: 400px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    button {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .stats {
        flex-direction: column;
        gap: 8px;
    }
    
    .stat-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-width: auto;
    }
    
    .stat-value {
        font-size: 1.2em;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        background: white;
    }
    
    .button-group,
    .lang-toggle,
    .copy-btn {
        display: none;
    }
}