/* JSON Formatter Layout & Syntax Highlighting */

.tool-container {
    width: min(1200px, calc(100% - 32px));
    margin: 40px auto 80px;
}

.tool-header {
    margin-bottom: 24px;
}

.back-link {
    display: inline-block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 12px;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--accent-light);
}

.tool-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(57, 137, 255, 0.12);
    color: var(--accent-light);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.tool-header h1 {
    font-size: clamp(28px, 4vw, 40px);
    letter-spacing: -1px;
}

.tool-header p {
    color: var(--muted);
    font-size: 15px;
    margin-top: 4px;
}

/* Workspace */
.json-workspace {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}

.toolbar-group select {
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    outline: none;
    cursor: pointer;
}

.toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-light);
    box-shadow: 0 0 12px rgba(57, 137, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--card-hover);
    border-color: var(--border-hover);
}

/* Status Notifications */
.status-box {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-family: monospace;
    line-height: 1.4;
}

.status-box.hidden {
    display: none;
}

.status-box.success {
    background: rgba(118, 255, 174, 0.1);
    border: 1px solid rgba(118, 255, 174, 0.3);
    color: #76ffae;
}

.status-box.error {
    background: rgba(255, 100, 100, 0.1);
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: #ff8080;
}

/* Editor Grid */
.editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.editor-column {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-soft);
    overflow: hidden;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.5px;
}

.icon-btn {
    background: transparent;
    border: 0;
    color: var(--muted);
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: 0.2s;
}

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

#jsonInput,
.json-display {
    width: 100%;
    height: 420px;
    padding: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    background: transparent;
    color: var(--text);
    border: 0;
    outline: none;
    resize: none;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

#jsonInput::placeholder {
    color: #52525b;
}

/* Syntax Highlighting Colors */
.json-key { color: var(--accent-light); font-weight: 600; }
.json-string { color: #a3e635; }
.json-number { color: #facc15; }
.json-boolean { color: #60a5fa; }
.json-null { color: #f87171; }

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

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