/* ══════════════════════════════════════════════
   DevSpells — JSON Formatter Page Styles
   ══════════════════════════════════════════════ */

/* ── Syntax Colors ── */
[data-theme="light"] {
    --json-key: #4F46E5;
    --json-string: #059669;
    --json-number: #D97706;
    --json-boolean: #DC2626;
    --json-null: #9CA3AF;
    --json-bracket: #6B7280;
}

[data-theme="dark"] {
    --json-key: #818CF8;
    --json-string: #34D399;
    --json-number: #FBBF24;
    --json-boolean: #FB7185;
    --json-null: #6B7280;
    --json-bracket: #9CA3AF;
}

/* ── Tool Content ── */
.tool-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
}

.tool-header {
    text-align: center;
    margin-bottom: 24px;
}

.tool-header h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.tool-header p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ── Status Bar ── */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    min-height: 36px;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 300ms ease;
}

.status-bar.visible {
    opacity: 1;
    transform: translateY(0);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
}

.status-pill.success {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success-border);
}

.status-pill.error {
    background: var(--error-bg);
    color: var(--error);
    border-color: var(--error-border);
}

.status-pill svg { width: 14px; height: 14px; }

.error-detail {
    font-size: 12px;
    color: var(--error);
    font-family: var(--font-mono);
    margin-top: 2px;
}

/* ── Editor Layout ── */
.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-height: 520px;
    animation: fadeIn 400ms ease;
}

.editor-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: border-color var(--transition), background var(--transition);
}

.editor-panel:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.panel-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.panel-actions {
    display: flex;
    gap: 4px;
}

/* ── Textarea ── */
.editor-area {
    flex: 1;
    position: relative;
}

.editor-area textarea {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    resize: none;
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-editor);
    tab-size: 2;
    transition: background var(--transition), color var(--transition);
}

.editor-area textarea::placeholder {
    color: var(--text-tertiary);
    font-family: var(--font-sans);
    font-style: normal;
}

/* ── Syntax-highlighted output ── */
.output-display {
    width: 100%;
    height: 100%;
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    overflow: auto;
    white-space: pre;
    background: var(--bg-editor);
    color: var(--text-primary);
    transition: background var(--transition);
}

.output-display .json-key { color: var(--json-key); }
.output-display .json-string { color: var(--json-string); }
.output-display .json-number { color: var(--json-number); }
.output-display .json-boolean { color: var(--json-boolean); }
.output-display .json-null { color: var(--json-null); }
.output-display .json-bracket { color: var(--json-bracket); }

.output-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-tertiary);
    gap: 12px;
    padding: 40px;
}

.output-placeholder svg { width: 40px; height: 40px; opacity: 0.4; }
.output-placeholder p { font-size: 13px; text-align: center; }

/* ── Action Bar ── */
.actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .tool-content { padding: 16px; }
    .editor-container {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .editor-area textarea,
    .output-display {
        min-height: 260px;
    }
    .tool-header h1 { font-size: 18px; }
    .actions { gap: 8px; }
}
