/* ===== JSON Escape/Unescape — Tool-Specific Styles ===== */
/* ♻ Shared: base, home, tool, mobile CSS — layout/app-shell/panel/header/footer */
/* ♻ Only direction toggle + toolbar styles here */

/* ── Direction Toggle ── */
.direction-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-bg-tertiary, #f0f0ea);
  border-radius: var(--radius-sm, 6px);
  padding: 2px;
}

.direction-btn {
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary, #78716C);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.direction-btn.active {
  background: var(--color-accent, #10B981);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.direction-btn:hover:not(.active) {
  color: var(--color-text-primary, #1C1917);
  background: var(--color-bg-hover, #e8e8e0);
}

.direction-arrow {
  font-size: 14px;
  color: var(--color-text-muted, #A8A29E);
  user-select: none;
  padding: 0 2px;
}

/* ── Escape Output Toolbar ── */
.escape-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--color-bg-secondary, #fafaf5);
  border-bottom: 1px solid var(--color-border, #e7e5e4);
  min-height: 44px;
  flex-shrink: 0;
}

.escape-toolbar-left,
.escape-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-label {
  font-size: 13px;
  color: var(--color-text-secondary, #78716C);
  white-space: nowrap;
}

.mode-label.mode-auto {
  color: var(--color-accent, #10B981);
  font-weight: 600;
}

/* ── Output area ── */
.escape-output {
  margin: 0;
  padding: 16px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-primary, #1C1917);
  background: var(--color-bg-primary, #fff);
  border: none;
  border-radius: 0;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: break-word;
  min-height: 100%;
  flex: 1;
  overflow-y: auto;
}

.escape-output.error {
  color: var(--color-error, #dc2626);
  background: #fef2f2;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
}

/* ── FREE badge (consistent with json-minifier + json-base64) ── */
.free-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  color: #7a5c00;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #fbbf24 100%);
  border-radius: 3px;
  padding: 1px 5px;
  line-height: 1.4;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
  box-shadow: 0 1px 3px rgba(245,158,11,0.4);
  position: relative;
  overflow: hidden;
}

.free-badge::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,0.5) 50%, transparent 70%);
  animation: shine 2.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Ensure table-area flex layout for vertical centering ── */
.table-area {
  display: flex;
  flex-direction: column;
}
