:root {
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --panel-border: rgba(148, 163, 184, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-hover: #0ea5e9;
    --danger-color: #ef4444;
    --string-color: #a5d6ff;
    --number-color: #7ee787;
    --boolean-color: #ff7b72;
    --key-color: #79c0ff;
    --null-color: #ff7b72;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

.background-globes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.globe {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.globe-1 {
    width: 400px;
    height: 400px;
    background: #4c1d95;
    top: -100px;
    left: -100px;
    animation: float 10s infinite ease-in-out alternate;
}

.globe-2 {
    width: 500px;
    height: 500px;
    background: #0ea5e9;
    bottom: -150px;
    right: -150px;
    animation: float 12s infinite ease-in-out alternate-reverse;
}

@keyframes float {
    from { transform: translate(0, 0); }
    to { transform: translate(30px, 30px); }
}

.container {
    width: 95%;
    max-width: 1200px;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
}

.editor-container {
    display: flex;
    flex: 1;
    gap: 1rem;
    min-height: 0;
    margin-bottom: 2rem;
}

.panel {
    flex: 1;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.panel-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.4);
}

.label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

textarea, .output-area {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    overflow: auto;
}

.output-area {
    white-space: pre-wrap;
    word-break: break-word;
}

textarea::placeholder {
    color: rgba(148, 163, 184, 0.4);
}

.controls {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
}

.primary-btn {
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    color: white;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.secondary-btn {
    background: rgba(30, 41, 59, 0.6);
    color: var(--text-primary);
    border: 1px solid var(--panel-border);
}

.secondary-btn:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: var(--accent-color);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
}

/* Syntax Highlighting */
.key { color: var(--key-color); }
.string { color: var(--string-color); }
.number { color: var(--number-color); }
.boolean { color: var(--boolean-color); }
.null { color: var(--null-color); }
.error { color: var(--danger-color); font-weight: bold; }

@media (max-width: 768px) {
    .editor-container {
        flex-direction: column;
    }
    .controls {
        flex-direction: row;
    }
    .container {
        height: auto;
    }
    textarea, .output-area {
        min-height: 300px;
    }
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100;
}

.toast.hidden {
    opacity: 0;
    transform: translate(-50%, 20px);
    pointer-events: none;
}
