/* JSON to Any Converter — Code Editor Aesthetic */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

:root {
    --primary: #F59E0B;
    --primary-rgb: 245, 158, 11;
    --primary-dim: #D97706;
    --accent: #EF4444;
    --bg: #0F172A;
    --bg-card: #1E293B;
    --bg-elevated: #273548;
    --bg-surface: #334155;
    --text: #F1F5F9;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    --border: rgba(245, 158, 11, 0.12);
    --border-hover: rgba(245, 158, 11, 0.3);
    --green: #22C55E;
    --red: #EF4444;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
    --font-code: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh
}

.app-header {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border)
}

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

.logo h1 {
    font-size: 1.15rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-dim)
}

.format-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto
}

.tab {
    padding: 7px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap
}

.tab:hover {
    color: var(--text);
    border-color: var(--border-hover)
}

.tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dim));
    border-color: transparent;
    color: #000;
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.3)
}

.editor-panels {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 0
}

@media(max-width:768px) {
    .editor-panels {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr
    }
}

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

.input-panel {
    border-right: 1px solid var(--border)
}

@media(max-width:768px) {
    .input-panel {
        border-right: none;
        border-bottom: 1px solid var(--border)
    }
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border)
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em
}

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

.btn-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-dim);
    cursor: pointer;
    transition: var(--transition)
}

.btn-icon:hover {
    color: var(--text);
    background: var(--bg-elevated);
    border-color: var(--border)
}

.editor-wrap {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0
}

.editor {
    flex: 1;
    width: 100%;
    padding: 16px;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font-code);
    font-size: 0.82rem;
    line-height: 1.65;
    resize: none;
    outline: none;
    tab-size: 2
}

.editor::placeholder {
    color: var(--text-dim)
}

.error-bar {
    font-size: 0.7rem;
    color: var(--red);
    transition: var(--transition)
}

.error-bar.show {
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.08)
}

.output {
    flex: 1;
    margin: 0;
    padding: 16px;
    background: transparent;
    color: var(--text);
    font-family: var(--font-code);
    font-size: 0.82rem;
    line-height: 1.65;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all
}

.output code {
    color: var(--text)
}

.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 24px;
    border-top: 1px solid var(--border);
    font-size: 0.65rem;
    color: var(--text-dim)
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px
}

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

::-webkit-scrollbar-thumb {
    background: var(--bg-surface);
    border-radius: 3px
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px
}