/* ==========================================================================
   UCDreams Tools — JSON Formatter, Validator & Tree Visualizer Styles
   Strictly scoped under #json-formatter-app and .jf-* (Zero-bleed)
   Full Desktop & Mobile Responsiveness + Light & Dark Mode Support
   ========================================================================== */

#json-formatter-app {
	max-width: 1400px;
	margin: 0 auto 50px auto;
	padding: 0 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
	width: 100%;
}

#json-formatter-app * {
	box-sizing: border-box;
}

/* Defensive resets against WordPress wpautop */
#json-formatter-app p {
	display: contents !important;
	margin: 0 !important;
	padding: 0 !important;
}

#json-formatter-app br {
	display: none !important;
}

/* Main Studio Card Frame */
.jf-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.06), 0 4px 12px -2px rgba(0, 0, 0, 0.025);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-height: 680px;
	transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
	width: 100%;
}

/* Top Action Toolbar */
.jf-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 18px;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	gap: 12px;
	flex-wrap: wrap;
}

.jf-topbar-left,
.jf-topbar-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

/* Buttons */
.jf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	padding: 7px 13px;
	border-radius: 8px;
	border: 1px solid #cbd5e1;
	background: #ffffff;
	color: #334155;
	cursor: pointer;
	transition: all 0.15s ease;
	white-space: nowrap;
	text-decoration: none;
	user-select: none;
}

.jf-btn:hover {
	background: #f1f5f9;
	border-color: #94a3b8;
	color: #0f172a;
}

.jf-btn svg {
	flex-shrink: 0;
}

.jf-btn-primary {
	background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
	border-color: #be123c;
	color: #ffffff;
	box-shadow: 0 2px 6px rgba(225, 29, 72, 0.25);
}

.jf-btn-primary:hover {
	background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
	border-color: #e11d48;
	color: #ffffff;
	box-shadow: 0 4px 10px rgba(225, 29, 72, 0.35);
}

.jf-btn-autofix {
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
	border-color: #059669;
	color: #ffffff;
	box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}

.jf-btn-autofix:hover {
	background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
	border-color: #10b981;
	color: #ffffff;
	box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.jf-btn-sm {
	padding: 5px 10px;
	font-size: 12px;
	border-radius: 6px;
}

.jf-btn-xs {
	padding: 4px 8px;
	font-size: 11.5px;
	font-weight: 600;
	border-radius: 6px;
	border: 1px solid #cbd5e1;
	background: #ffffff;
	color: #475569;
}

.jf-btn-xs:hover {
	background: #f1f5f9;
	color: #0f172a;
}

/* Select wrapper */
.jf-select-wrapper {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.jf-select {
	appearance: none;
	-webkit-appearance: none;
	background: #ffffff url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") no-repeat right 8px center;
	background-size: 14px 14px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: 7px 28px 7px 12px;
	font-size: 13px;
	font-weight: 600;
	color: #334155;
	cursor: pointer;
	outline: none;
	transition: all 0.15s ease;
}

.jf-select:hover {
	border-color: #94a3b8;
}

.jf-select:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Mobile Tabs Switcher (hidden on desktop) */
.jf-mob-tabs {
	display: none;
	align-items: center;
	gap: 6px;
	padding: 6px;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	margin-bottom: 14px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.jf-mob-tabs::-webkit-scrollbar {
	display: none;
}

.jf-mob-tab-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 9px 14px;
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
	background: transparent;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	white-space: nowrap;
	flex: 1 1 auto;
	transition: all 0.15s ease;
}

.jf-mob-tab-btn:hover {
	color: #0f172a;
}

.jf-mob-tab-btn.is-active {
	background: #ffffff;
	color: #0f172a;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Workspace Dual Pane (Desktop: 50% split) */
.jf-workspace {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	flex: 1 1 auto;
	min-height: 600px;
	width: 100%;
	background: #ffffff;
	overflow: hidden;
}

/* Left Column: Editor */
.jf-col-editor {
	display: flex;
	flex-direction: column;
	border-right: 1px solid #e2e8f0;
	min-width: 0;
	width: 100%;
	position: relative;
	overflow: hidden;
}

.jf-pane-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 9px 14px;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	font-size: 12px;
	font-weight: 700;
	color: #64748b;
	user-select: none;
	gap: 8px;
}

.jf-pane-title {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 700;
	color: #475569;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.jf-pane-tools {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* Editor Dropzone & Body */
.jf-editor-dropzone {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 520px;
	width: 100%;
	position: relative;
	overflow: hidden;
}

.jf-editor-dropzone.is-dragover {
	background: rgba(37, 99, 235, 0.05);
	outline: 2px dashed #2563eb;
	outline-offset: -4px;
}

.jf-editor-body {
	display: flex;
	flex-direction: row;
	flex: 1 1 auto;
	min-height: 520px;
	width: 100%;
	position: relative;
	background: #ffffff;
	overflow: hidden;
}

.jf-lines {
	width: 48px;
	min-width: 48px;
	max-width: 48px;
	padding: 14px 8px 14px 0;
	background: #f8fafc;
	border-right: 1px solid #e2e8f0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 13px;
	line-height: 22px;
	color: #94a3b8;
	text-align: right;
	user-select: none;
	overflow: hidden;
	box-sizing: border-box;
}

.jf-lines > div {
	height: 22px;
	line-height: 22px;
}

.jf-lines > div.has-error {
	background: #fee2e2 !important;
	color: #ef4444 !important;
	font-weight: 700;
	border-radius: 2px;
}

/* Textarea Input - Full Width & Pre-wrap */
.jf-textarea,
.jf-editor-textarea,
#jf-input {
	flex: 1 1 auto !important;
	min-width: 0 !important;
	width: calc(100% - 48px) !important;
	height: 100% !important;
	min-height: 520px !important;
	border: none !important;
	outline: none !important;
	padding: 14px 16px !important;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
	font-size: 13px !important;
	line-height: 22px !important;
	color: #0f172a !important;
	background: transparent !important;
	resize: none !important;
	white-space: pre !important;
	word-wrap: normal !important;
	overflow: auto !important;
	tab-size: 2 !important;
	box-sizing: border-box !important;
}

/* Error Banner */
.jf-error-banner {
	display: none;
	background: #fef2f2;
	border-top: 1px solid #fecaca;
	border-bottom: 1px solid #fecaca;
	padding: 10px 14px;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}

.jf-error-banner.is-visible {
	display: flex !important;
}

.jf-error-content {
	display: flex;
	gap: 8px;
	flex: 1;
	min-width: 0;
}

.jf-error-icon {
	color: #ef4444;
	flex-shrink: 0;
	margin-top: 2px;
}

.jf-error-details {
	font-size: 12.5px;
	color: #991b1b;
	line-height: 1.5;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	word-break: break-word;
	white-space: pre-wrap;
}

#jf-error-fix-btn {
	background: #ef4444;
	color: #ffffff;
	border-color: #dc2626;
	flex-shrink: 0;
}

#jf-error-fix-btn:hover {
	background: #dc2626;
}

/* Stats Footer */
.jf-stats-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 14px;
	background: #f8fafc;
	border-top: 1px solid #e2e8f0;
	font-size: 12px;
	color: #64748b;
	gap: 12px;
	flex-wrap: wrap;
}

.jf-stats-group {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

.jf-stat-item {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.jf-stat-val {
	font-weight: 700;
	color: #0f172a;
}

/* Right Column: Output / Tree View */
.jf-col-preview {
	display: flex;
	flex-direction: column;
	min-width: 0;
	width: 100%;
	background: #ffffff;
	position: relative;
	overflow: hidden;
}

/* View Selector Tabs */
.jf-view-tabs {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	overflow-x: auto;
}

.jf-view-tab-btn {
	padding: 6px 12px;
	font-size: 12.5px;
	font-weight: 600;
	color: #64748b;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 8px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
	transition: all 0.15s ease;
}

.jf-view-tab-btn:hover {
	color: #0f172a;
	background: #f1f5f9;
}

.jf-view-tab-btn.is-active {
	background: #ffffff;
	color: #0f172a;
	border-color: #cbd5e1;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

/* Live JSONPath Bar */
.jf-path-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	background: #fafafa;
	border-bottom: 1px solid #e2e8f0;
	font-size: 12px;
}

.jf-path-label {
	font-size: 11px;
	font-weight: 700;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	flex-shrink: 0;
}

.jf-path-code {
	background: #f1f5f9;
	color: #2563eb;
	padding: 3px 8px;
	border-radius: 6px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12px;
	font-weight: 600;
	border: 1px solid #e2e8f0;
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#jf-btn-copy-path {
	flex-shrink: 0;
}

/* Tree Search Toolbar */
.jf-tree-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 14px;
	background: #ffffff;
	border-bottom: 1px solid #e2e8f0;
	gap: 8px;
	flex-wrap: wrap;
}

.jf-search-box {
	display: flex;
	align-items: center;
	gap: 6px;
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: 5px 10px;
	flex: 1;
	min-width: 160px;
	max-width: 320px;
	color: #64748b;
	transition: all 0.15s ease;
}

.jf-search-box:focus-within {
	border-color: #2563eb;
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
	background: #ffffff;
}

.jf-tree-search-input {
	border: none;
	background: transparent;
	outline: none;
	font-size: 12.5px;
	color: #0f172a;
	width: 100%;
}

.jf-match-count {
	font-size: 11px;
	font-weight: 700;
	color: #10b981;
	padding: 2px 6px;
	background: rgba(16, 185, 129, 0.1);
	border-radius: 10px;
	white-space: nowrap;
}

.jf-tree-level-tools {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-wrap: wrap;
}

/* Output Panes */
.jf-output-pane {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 500px;
	overflow: hidden;
	background: #ffffff;
}

.jf-placeholder-msg {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	min-height: 250px;
	color: #94a3b8;
	font-size: 13.5px;
	text-align: center;
	padding: 20px;
}

/* Tree Render Container */
.jf-tree-container {
	flex: 1 1 auto;
	overflow: auto;
	padding: 14px 16px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 13px;
	line-height: 1.65;
	color: #0f172a;
}

.jf-tree-item {
	position: relative;
	margin: 1px 0;
}

.jf-tree-row {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 2px 6px;
	border-radius: 4px;
	cursor: pointer;
	user-select: none;
	transition: background-color 0.1s ease;
	position: relative;
}

.jf-tree-row:hover {
	background: #f1f5f9;
}

.jf-tree-toggle {
	width: 16px;
	height: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #64748b;
	font-size: 10px;
	border-radius: 3px;
	flex-shrink: 0;
	transition: transform 0.15s ease;
}

.jf-tree-toggle:hover {
	color: #0f172a;
}

.jf-tree-children {
	padding-left: 20px;
	border-left: 1px dashed #e2e8f0;
	margin-left: 8px;
}

/* Tree Syntax Colors */
.jf-tree-key {
	color: #0f172a;
	font-weight: 600;
}

.jf-tree-colon {
	color: #94a3b8;
	margin-right: 4px;
}

.jf-val-string {
	color: #059669;
}

.jf-val-number {
	color: #2563eb;
	font-weight: 600;
}

.jf-val-boolean {
	color: #7c3aed;
	font-weight: 600;
}

.jf-val-null {
	color: #64748b;
	font-style: italic;
}

/* Badges */
.jf-tree-badge {
	font-size: 11px;
	font-weight: 600;
	padding: 1px 6px;
	border-radius: 4px;
	margin-left: 4px;
}

.jf-tree-badge.is-object {
	background: rgba(37, 99, 235, 0.08);
	color: #2563eb;
	border: 1px solid rgba(37, 99, 235, 0.2);
}

.jf-tree-badge.is-array {
	background: rgba(236, 72, 153, 0.08);
	color: #db2777;
	border: 1px solid rgba(236, 72, 153, 0.2);
}

/* Hover Quick Actions on Tree Row */
.jf-tree-actions {
	margin-left: auto;
	opacity: 0;
	transition: opacity 0.15s ease;
	display: inline-flex;
	align-items: center;
}

.jf-tree-row:hover .jf-tree-actions {
	opacity: 1;
}

.jf-node-copy-btn {
	font-size: 10.5px;
	font-weight: 600;
	padding: 2px 6px;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 4px;
	color: #475569;
	cursor: pointer;
}

.jf-node-copy-btn:hover {
	background: #f8fafc;
	color: #0f172a;
}

/* Table Output View */
.jf-table-container {
	flex: 1 1 auto;
	overflow: auto;
	padding: 16px;
}

.jf-grid-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12.5px;
	text-align: left;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.jf-grid-table th {
	background: #f8fafc;
	padding: 9px 12px;
	border: 1px solid #e2e8f0;
	font-weight: 700;
	color: #334155;
	position: sticky;
	top: 0;
	z-index: 2;
}

.jf-grid-table td {
	padding: 8px 12px;
	border: 1px solid #e2e8f0;
	color: #334155;
	max-width: 250px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.jf-grid-table tr:nth-child(even) td {
	background: #fcfdfe;
}

.jf-grid-table tr:hover td {
	background: #f1f5f9;
}

/* Code Viewers (YAML, TypeScript) */
.jf-code-box {
	margin: 0;
	padding: 16px;
	flex: 1 1 auto;
	overflow: auto;
	background: #f8fafc;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 13px;
	line-height: 1.6;
	color: #0f172a;
}

/* Toast Notification */
.jf-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(100px);
	background: #0f172a;
	color: #ffffff;
	padding: 10px 18px;
	border-radius: 10px;
	font-size: 13.5px;
	font-weight: 600;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
	opacity: 0;
	transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	z-index: 9999999;
	pointer-events: none;
	max-width: 90%;
	text-align: center;
}

.jf-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.jf-toast.is-error {
	background: #ef4444;
}

/* URL Modal */
.jf-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(4px);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 999999;
	padding: 16px;
}

.jf-modal-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 24px;
	width: 100%;
	max-width: 480px;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.jf-modal-title {
	font-size: 17px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 8px 0;
}

.jf-modal-input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 14px;
	margin-bottom: 16px;
	outline: none;
}

.jf-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

/* ==========================================================================
   Dark Mode Master Adaptation for JSON Formatter
   ========================================================================== */
body.dark-mode .jf-card,
html[data-theme="dark"] .jf-card,
html.dark .jf-card {
	background: #11141d !important;
	border-color: rgba(255, 255, 255, 0.08) !important;
	box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .jf-topbar,
html[data-theme="dark"] .jf-topbar,
html.dark .jf-topbar {
	background: #171b26 !important;
	border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .jf-btn,
html[data-theme="dark"] .jf-btn,
html.dark .jf-btn {
	background: #1e2433 !important;
	border-color: rgba(255, 255, 255, 0.12) !important;
	color: #e2e8f0 !important;
}

body.dark-mode .jf-btn:hover,
html[data-theme="dark"] .jf-btn:hover,
html.dark .jf-btn:hover {
	background: #252b3b !important;
	border-color: rgba(255, 255, 255, 0.22) !important;
	color: #ffffff !important;
}

body.dark-mode .jf-btn-primary,
html[data-theme="dark"] .jf-btn-primary,
html.dark .jf-btn-primary {
	background: linear-gradient(135deg, #e11d48 0%, #be123c 100%) !important;
	border-color: #be123c !important;
	color: #ffffff !important;
}

body.dark-mode .jf-btn-autofix,
html[data-theme="dark"] .jf-btn-autofix,
html.dark .jf-btn-autofix {
	background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
	border-color: #059669 !important;
	color: #ffffff !important;
}

body.dark-mode .jf-select,
html[data-theme="dark"] .jf-select,
html.dark .jf-select {
	background-color: #1e2433 !important;
	border-color: rgba(255, 255, 255, 0.12) !important;
	color: #e2e8f0 !important;
}

body.dark-mode .jf-mob-tabs,
html[data-theme="dark"] .jf-mob-tabs,
html.dark .jf-mob-tabs {
	background: #171b26 !important;
	border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .jf-mob-tab-btn,
html[data-theme="dark"] .jf-mob-tab-btn,
html.dark .jf-mob-tab-btn {
	color: #94a3b8 !important;
}

body.dark-mode .jf-mob-tab-btn.is-active,
html[data-theme="dark"] .jf-mob-tab-btn.is-active,
html.dark .jf-mob-tab-btn.is-active {
	background: #252b3b !important;
	color: #ffffff !important;
}

body.dark-mode .jf-workspace,
html[data-theme="dark"] .jf-workspace,
html.dark .jf-workspace {
	background: #11141d !important;
}

body.dark-mode .jf-col-editor,
html[data-theme="dark"] .jf-col-editor,
html.dark .jf-col-editor {
	border-right-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .jf-col-preview,
html[data-theme="dark"] .jf-col-preview,
html.dark .jf-col-preview {
	background: #11141d !important;
}

body.dark-mode .jf-pane-header,
html[data-theme="dark"] .jf-pane-header,
html.dark .jf-pane-header {
	background: #171b26 !important;
	border-bottom-color: rgba(255, 255, 255, 0.08) !important;
	color: #94a3b8 !important;
}

body.dark-mode .jf-pane-title,
html[data-theme="dark"] .jf-pane-title,
html.dark .jf-pane-title {
	color: #cbd5e1 !important;
}

body.dark-mode .jf-editor-body,
html[data-theme="dark"] .jf-editor-body,
html.dark .jf-editor-body {
	background: #11141d !important;
}

body.dark-mode .jf-lines,
html[data-theme="dark"] .jf-lines,
html.dark .jf-lines {
	background: #141720 !important;
	border-right-color: rgba(255, 255, 255, 0.08) !important;
	color: #64748b !important;
}

body.dark-mode .jf-textarea,
body.dark-mode .jf-editor-textarea,
body.dark-mode #jf-input,
html[data-theme="dark"] .jf-textarea,
html[data-theme="dark"] .jf-editor-textarea,
html[data-theme="dark"] #jf-input,
html.dark .jf-textarea,
html.dark .jf-editor-textarea,
html.dark #jf-input {
	color: #e2e8f0 !important;
	background: transparent !important;
}

body.dark-mode .jf-error-banner,
html[data-theme="dark"] .jf-error-banner,
html.dark .jf-error-banner {
	background: rgba(239, 68, 68, 0.12) !important;
	border-color: rgba(239, 68, 68, 0.25) !important;
}

body.dark-mode .jf-error-details,
html[data-theme="dark"] .jf-error-details,
html.dark .jf-error-details {
	color: #fca5a5 !important;
}

body.dark-mode .jf-stats-bar,
html[data-theme="dark"] .jf-stats-bar,
html.dark .jf-stats-bar {
	background: #141720 !important;
	border-top-color: rgba(255, 255, 255, 0.08) !important;
	color: #94a3b8 !important;
}

body.dark-mode .jf-stat-val,
html[data-theme="dark"] .jf-stat-val,
html.dark .jf-stat-val {
	color: #ffffff !important;
}

body.dark-mode .jf-view-tabs,
html[data-theme="dark"] .jf-view-tabs,
html.dark .jf-view-tabs {
	background: #171b26 !important;
	border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .jf-view-tab-btn,
html[data-theme="dark"] .jf-view-tab-btn,
html.dark .jf-view-tab-btn {
	color: #94a3b8 !important;
}

body.dark-mode .jf-view-tab-btn.is-active,
html[data-theme="dark"] .jf-view-tab-btn.is-active,
html.dark .jf-view-tab-btn.is-active {
	background: #252b3b !important;
	color: #ffffff !important;
	border-color: rgba(255, 255, 255, 0.15) !important;
}

body.dark-mode .jf-path-bar,
html[data-theme="dark"] .jf-path-bar,
html.dark .jf-path-bar {
	background: #151822 !important;
	border-bottom-color: rgba(255, 255, 255, 0.07) !important;
}

body.dark-mode .jf-path-code,
html[data-theme="dark"] .jf-path-code,
html.dark .jf-path-code {
	background: rgba(37, 99, 235, 0.15) !important;
	color: #60a5fa !important;
	border-color: rgba(37, 99, 235, 0.3) !important;
}

body.dark-mode .jf-tree-toolbar,
html[data-theme="dark"] .jf-tree-toolbar,
html.dark .jf-tree-toolbar {
	background: #141720 !important;
	border-bottom-color: rgba(255, 255, 255, 0.07) !important;
}

body.dark-mode .jf-search-box,
html[data-theme="dark"] .jf-search-box,
html.dark .jf-search-box {
	background: #1e2433 !important;
	border-color: rgba(255, 255, 255, 0.12) !important;
	color: #94a3b8 !important;
}

body.dark-mode .jf-tree-search-input,
html[data-theme="dark"] .jf-tree-search-input,
html.dark .jf-tree-search-input {
	color: #e2e8f0 !important;
}

body.dark-mode .jf-output-pane,
html[data-theme="dark"] .jf-output-pane,
html.dark .jf-output-pane {
	background: #11141d !important;
}

body.dark-mode .jf-tree-container,
html[data-theme="dark"] .jf-tree-container,
html.dark .jf-tree-container {
	color: #e2e8f0 !important;
}

body.dark-mode .jf-tree-row:hover,
html[data-theme="dark"] .jf-tree-row:hover,
html.dark .jf-tree-row:hover {
	background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .jf-tree-children,
html[data-theme="dark"] .jf-tree-children,
html.dark .jf-tree-children {
	border-left-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .jf-tree-key,
html[data-theme="dark"] .jf-tree-key,
html.dark .jf-tree-key {
	color: #f1f5f9 !important;
}

body.dark-mode .jf-tree-colon,
html[data-theme="dark"] .jf-tree-colon,
html.dark .jf-tree-colon {
	color: #64748b !important;
}

body.dark-mode .jf-val-string,
html[data-theme="dark"] .jf-val-string,
html.dark .jf-val-string {
	color: #34d399 !important;
}

body.dark-mode .jf-val-number,
html[data-theme="dark"] .jf-val-number,
html.dark .jf-val-number {
	color: #60a5fa !important;
}

body.dark-mode .jf-val-boolean,
html[data-theme="dark"] .jf-val-boolean,
html.dark .jf-val-boolean {
	color: #a78bfa !important;
}

body.dark-mode .jf-val-null,
html[data-theme="dark"] .jf-val-null,
html.dark .jf-val-null {
	color: #94a3b8 !important;
}

body.dark-mode .jf-node-copy-btn,
html[data-theme="dark"] .jf-node-copy-btn,
html.dark .jf-node-copy-btn {
	background: #1e2433 !important;
	border-color: rgba(255, 255, 255, 0.15) !important;
	color: #cbd5e1 !important;
}

body.dark-mode .jf-grid-table th,
html[data-theme="dark"] .jf-grid-table th,
html.dark .jf-grid-table th {
	background: #171b26 !important;
	border-color: rgba(255, 255, 255, 0.1) !important;
	color: #e2e8f0 !important;
}

body.dark-mode .jf-grid-table td,
html[data-theme="dark"] .jf-grid-table td,
html.dark .jf-grid-table td {
	border-color: rgba(255, 255, 255, 0.08) !important;
	color: #cbd5e1 !important;
}

body.dark-mode .jf-grid-table tr:nth-child(even) td,
html[data-theme="dark"] .jf-grid-table tr:nth-child(even) td,
html.dark .jf-grid-table tr:nth-child(even) td {
	background: rgba(255, 255, 255, 0.02) !important;
}

body.dark-mode .jf-grid-table tr:hover td,
html[data-theme="dark"] .jf-grid-table tr:hover td,
html.dark .jf-grid-table tr:hover td {
	background: rgba(255, 255, 255, 0.06) !important;
}

body.dark-mode .jf-code-box,
html[data-theme="dark"] .jf-code-box,
html.dark .jf-code-box {
	background: #11141d !important;
	color: #e2e8f0 !important;
}

body.dark-mode .jf-modal-card,
html[data-theme="dark"] .jf-modal-card,
html.dark .jf-modal-card {
	background: #171b26 !important;
	border-color: rgba(255, 255, 255, 0.12) !important;
}

body.dark-mode .jf-modal-title,
html[data-theme="dark"] .jf-modal-title,
html.dark .jf-modal-title {
	color: #ffffff !important;
}

body.dark-mode .jf-modal-input,
html[data-theme="dark"] .jf-modal-input,
html.dark .jf-modal-input {
	background: #1e2433 !important;
	border-color: rgba(255, 255, 255, 0.15) !important;
	color: #ffffff !important;
}

/* ==========================================================================
   Responsive Breakpoints (< 992px: Mobile & Tablet Tabs Mode)
   ========================================================================== */
@media (max-width: 991px) {
	#json-formatter-app {
		padding: 0 10px;
	}

	.jf-mob-tabs {
		display: flex !important;
	}

	.jf-workspace {
		display: flex !important;
		flex-direction: column !important;
	}

	/* Show only the active pane on mobile */
	.jf-workspace:not([data-pane="tree"]):not([data-pane="table"]):not([data-pane="yaml"]):not([data-pane="typescript"]) .jf-col-preview,
	.jf-workspace[data-pane="editor"] .jf-col-preview {
		display: none !important;
	}

	.jf-workspace[data-pane="tree"] .jf-col-editor,
	.jf-workspace[data-pane="table"] .jf-col-editor,
	.jf-workspace[data-pane="yaml"] .jf-col-editor,
	.jf-workspace[data-pane="typescript"] .jf-col-editor {
		display: none !important;
	}

	.jf-col-editor,
	.jf-col-preview {
		border-right: none !important;
		border-top: none !important;
		width: 100% !important;
	}

	.jf-topbar {
		padding: 10px 12px;
		gap: 8px;
	}

	.jf-topbar-left,
	.jf-topbar-right {
		width: 100%;
		justify-content: flex-start;
		gap: 6px;
	}

	.jf-tree-toolbar {
		padding: 8px 12px;
		gap: 8px;
	}

	.jf-search-box {
		max-width: 100%;
		width: 100%;
	}

	.jf-tree-level-tools {
		width: 100%;
		justify-content: flex-start;
	}
}

@media (min-width: 992px) {
	.jf-mob-tabs {
		display: none !important;
	}

	.jf-workspace {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
	}

	.jf-col-editor,
	.jf-col-preview {
		display: flex !important;
		width: 100% !important;
	}
}

@media (max-width: 640px) {
	.jf-topbar-left,
	.jf-topbar-right {
		gap: 5px;
	}

	.jf-btn {
		padding: 6px 9px;
		font-size: 12px;
	}

	.jf-select {
		padding: 6px 24px 6px 8px;
		font-size: 12px;
	}

	.jf-lines {
		width: 38px;
		min-width: 38px;
		max-width: 38px;
		font-size: 11.5px;
		padding: 12px 4px 12px 0;
	}

	.jf-textarea,
	.jf-editor-textarea,
	#jf-input {
		font-size: 12px !important;
		padding: 12px 10px !important;
		width: calc(100% - 38px) !important;
	}

	.jf-editor-body {
		min-height: 400px;
	}

	.jf-editor-dropzone {
		min-height: 400px;
	}

	.jf-output-pane {
		min-height: 400px;
	}

	.jf-card {
		min-height: auto;
		border-radius: 12px;
	}
}
