* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light mode - Base theme from Angular Tailwind */
    --background: #FFFFFF;
    --foreground: #0C1420;
    --card: #F1F5F9;
    --card-foreground: #000000;
    --primary: #E11D48;
    --primary-foreground: #FFFFFF;
    --muted: #CFD9E5;
    --muted-foreground: #64748B;
    --destructive: #CC0033;
    --destructive-foreground: #FAFAFA;
    --border: #E2E8F0;

    /* Mapped variables for compatibility */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F1F5F9;
    --bg-tertiary: #CFD9E5;
    --text-primary: #0C1420;
    --text-secondary: #64748B;
    --header-bg: #FFFFFF;
    --toolbar-bg: #FFFFFF;
    --border-color: #E2E8F0;
    --input-bg: #FFFFFF;
    --button-bg: #E11D48;
    --button-hover: #BE123C;
    --accent-primary: #E11D48;
    --accent-secondary: #F43F5E;
    --shadow: rgba(0, 0, 0, 0.1);
    --highlight-bg: #fef3c7;
    --highlight-current: #f59e0b;
}

body.dark-mode {
    /* Dark mode - Base theme from Angular Tailwind */
    --background: #0A0A0A;
    --foreground: #F2F2F2;
    --card: #121212;
    --card-foreground: #262626;
    --muted: #262626;
    --muted-foreground: #A3A3A3;
    --border: #262626;

    /* Mapped variables for compatibility */
    --bg-primary: #0A0A0A;
    --bg-secondary: #121212;
    --bg-tertiary: #262626;
    --text-primary: #F2F2F2;
    --text-secondary: #A3A3A3;
    --header-bg: #0A0A0A;
    --toolbar-bg: #0A0A0A;
    --border-color: #262626;
    --input-bg: #121212;
    --button-bg: #E11D48;
    --button-hover: #BE123C;
    --accent-primary: #E11D48;
    --accent-secondary: #F43F5E;
    --shadow: rgba(0, 0, 0, 0.5);
    --highlight-bg: #713f12;
    --highlight-current: #d97706;
}

/* Violet Theme */
body[data-color="violet"] {
    --primary: #6E56CF;
    --button-bg: #6E56CF;
    --button-hover: #5B45B8;
    --accent-primary: #6E56CF;
    --accent-secondary: #8B7DD8;
}

body.dark-mode[data-color="violet"] {
    --background: #060815;
    --foreground: #F6F8FB;
    --card: #0B0F1A;
    --card-foreground: #F6F8FB;
    --primary-foreground: #F6F8FB;
    --muted: #232B3D;
    --muted-foreground: #A1A8BF;
    --border: #232B3D;

    --bg-primary: #060815;
    --bg-secondary: #0B0F1A;
    --bg-tertiary: #232B3D;
    --text-primary: #F6F8FB;
    --text-secondary: #A1A8BF;
    --header-bg: #060815;
    --toolbar-bg: #060815;
    --border-color: #232B3D;
    --input-bg: #0B0F1A;
}

/* Red Theme */
body[data-color="red"] {
    --primary: #CC0033;
    --button-bg: #CC0033;
    --button-hover: #A3002A;
    --accent-primary: #CC0033;
    --accent-secondary: #E6003D;
}

body.dark-mode[data-color="red"] {
    --primary-foreground: #FFE5E5;
}

/* Blue Theme */
body[data-color="blue"] {
    --primary: #2490FF;
    --button-bg: #2490FF;
    --button-hover: #1A75DB;
    --accent-primary: #2490FF;
    --accent-secondary: #4DA3FF;
}

body.dark-mode[data-color="blue"] {
    --background: #02080F;
    --foreground: #F8FAFC;
    --card: #0B1117;
    --card-foreground: #F8FAFC;
    --primary-foreground: #0F1729;
    --muted: #1E293B;
    --muted-foreground: #94A3B8;
    --border: #1E293B;

    --bg-primary: #02080F;
    --bg-secondary: #0B1117;
    --bg-tertiary: #1E293B;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --header-bg: #02080F;
    --toolbar-bg: #02080F;
    --border-color: #1E293B;
    --input-bg: #0B1117;
}

/* Orange Theme */
body[data-color="orange"] {
    --primary: #EA580C;
    --button-bg: #EA580C;
    --button-hover: #C2410C;
    --accent-primary: #EA580C;
    --accent-secondary: #FB923C;
}

body.dark-mode[data-color="orange"] {
    --background: #0C0A09;
    --foreground: #FAFAF9;
    --card: #141110;
    --card-foreground: #FAFAF9;
    --primary-foreground: #FAFAF9;
    --muted: #292524;
    --muted-foreground: #A8A29E;
    --border: #292524;

    --bg-primary: #0C0A09;
    --bg-secondary: #141110;
    --bg-tertiary: #292524;
    --text-primary: #FAFAF9;
    --text-secondary: #A8A29E;
    --header-bg: #0C0A09;
    --toolbar-bg: #0C0A09;
    --border-color: #292524;
    --input-bg: #141110;
}

/* Yellow Theme */
body[data-color="yellow"] {
    --primary: #FACC15;
    --button-bg: #FACC15;
    --button-hover: #EAB308;
    --accent-primary: #FACC15;
    --accent-secondary: #FDE047;
}

body.dark-mode[data-color="yellow"] {
    --background: #0C0A09;
    --foreground: #FAFAF9;
    --card: #141110;
    --card-foreground: #FAFAF9;
    --primary: #FACC15;
    --primary-foreground: #422006;
    --muted: #292524;
    --muted-foreground: #A8A29E;
    --border: #292524;

    --bg-primary: #0C0A09;
    --bg-secondary: #141110;
    --bg-tertiary: #292524;
    --text-primary: #FAFAF9;
    --text-secondary: #A8A29E;
    --header-bg: #0C0A09;
    --toolbar-bg: #0C0A09;
    --border-color: #292524;
    --input-bg: #141110;
}

/* Green Theme */
body[data-color="green"] {
    --primary: #22C55E;
    --button-bg: #22C55E;
    --button-hover: #16A34A;
    --accent-primary: #22C55E;
    --accent-secondary: #4ADE80;
}

body.dark-mode[data-color="green"] {
    --primary: #22C55E;
    --primary-foreground: #052E16;
}

body[data-color="blue"] {
    --accent-primary: #3b82f6;
    --accent-secondary: #60a5fa;
    --button-bg: #3b82f6;
    --button-hover: #2563eb;
}

body[data-color="green"] {
    --accent-primary: #10b981;
    --accent-secondary: #34d399;
    --button-bg: #10b981;
    --button-hover: #059669;
}

body[data-color="purple"] {
    --accent-primary: #8b5cf6;
    --accent-secondary: #a78bfa;
    --button-bg: #8b5cf6;
    --button-hover: #7c3aed;
}

body[data-color="orange"] {
    --accent-primary: #f97316;
    --accent-secondary: #fb923c;
    --button-bg: #f97316;
    --button-hover: #ea580c;
}

body[data-color="pink"] {
    --accent-primary: #ec4899;
    --accent-secondary: #f472b6;
    --button-bg: #ec4899;
    --button-hover: #db2777;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
}

[dir="rtl"] .settings-dropdown-content {
    right: auto;
    left: 0;
}

[dir="rtl"] .toolbar-left {
    margin-right: 0;
    margin-left: auto;
}

[dir="rtl"] .toolbar-right {
    margin-left: 0;
    margin-right: auto;
}

.container {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: var(--header-bg);
    color: var(--text-primary);
    padding: 16px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 2200;
    overflow: visible;
}

body.dark-mode header {
    border-bottom-color: var(--border);
    background-color: var(--background);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin: 0;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

/* Settings Dropdown */
.settings-dropdown {
    position: relative;
}

.settings-toggle {
    background-color: var(--button-bg);
    color: white;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-toggle:hover {
    background-color: var(--button-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px var(--shadow);
}

.settings-toggle svg {
    width: 18px;
    height: 18px;
    color: white;
    transition: all 0.3s ease;
}

.settings-toggle:hover svg {
    transform: rotate(90deg);
}

.settings-text {
    font-weight: 500;
    user-select: none;
    color: white;
}

.settings-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    min-width: 280px;
    z-index: 4200;
    padding: 16px;
    animation: slideDown 0.2s ease;
}

body.dark-mode .settings-dropdown-content {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
    border-color: var(--border);
    background-color: var(--card);
}

.settings-dropdown-content.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section.hidden {
    display: none;
}

.settings-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.settings-options {
    display: flex;
    gap: 8px;
}

.visual-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.settings-option {
    flex: 1;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-weight: 500;
}

.settings-option:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.settings-option.active {
    background: var(--button-bg);
    color: white !important;
    border-color: var(--button-bg);
}

.settings-option svg {
    width: 16px;
    height: 16px;
}

.settings-option.active svg {
    color: white !important;
}

body.dark-mode .settings-option {
    border-color: var(--border);
}

body.dark-mode .settings-option:hover {
    background: var(--background);
}

/* Color Options */
.color-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.color-option {
    flex-direction: column;
    padding: 12px 8px;
}

.color-preview {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-bottom: 4px;
}

.color-option.active .color-preview {
    box-shadow: 0 0 0 3px var(--bg-secondary), 0 0 0 5px var(--button-bg);
}

body.dark-mode .color-option.active .color-preview {
    box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--button-bg);
}

.header-links a {
    color: var(--primary);
    text-decoration: none;
    margin-left: 20px;
    transition: color 0.2s ease;
}

.header-links a:hover {
    color: var(--button-hover);
}

.toolbar {
    background-color: var(--toolbar-bg);
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 2100;
    overflow: visible;
}

body.dark-mode .toolbar {
    border-bottom-color: var(--border);
    background-color: var(--background);
}

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

.status-banner {
    margin: 10px 30px 14px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: calc(100% - 60px);
}

.status-ready {
    display: none;
}

.status-ok {
    border-color: #22c55e;
    color: #15803d;
}

.status-error {
    border-color: #ef4444;
    color: #b91c1c;
}

body.density-comfortable .toolbar,
body.density-comfortable header {
    padding-top: 14px;
    padding-bottom: 14px;
}

body.density-compact .toolbar,
body.density-compact header {
    padding-top: 10px;
    padding-bottom: 10px;
}

body.density-compact .action-btn,
body.density-compact .settings-toggle,
body.density-compact .dropdown-btn,
body.density-compact .settings-option {
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 12px;
}

body.density-dense .toolbar,
body.density-dense header {
    padding-top: 8px;
    padding-bottom: 8px;
}

body.density-dense .action-btn,
body.density-dense .settings-toggle,
body.density-dense .dropdown-btn,
body.density-dense .settings-option,
body.density-dense .checkbox-label {
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 11px;
}

body.density-dense .workspace-hud .hud-chip {
    padding: 4px 7px;
    font-size: 10px;
}

.main-content.layout-split {
    flex-direction: row;
}

.main-content.layout-input-focus {
    flex-direction: row;
}

.main-content.layout-input-focus .input-panel {
    flex: 2.2;
}

.main-content.layout-input-focus .output-panel {
    flex: 1;
}

.main-content.layout-output-focus {
    flex-direction: row;
}

.main-content.layout-output-focus .input-panel {
    flex: 1;
}

.main-content.layout-output-focus .output-panel {
    flex: 2.2;
}

.main-content.layout-stacked {
    flex-direction: column;
}

.main-content.layout-stacked .output-panel {
    border-left: none;
    border-top: 2px solid var(--border-color);
}

.workspace-hud {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    flex-wrap: wrap;
    opacity: 0.9;
}

.hud-chip {
    font-size: 10px;
    letter-spacing: 0.35px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    background: var(--input-bg);
}

.hud-chip strong {
    color: var(--text-primary);
    font-weight: 700;
    margin-left: 3px;
}

.workspace-hud .hud-chip:first-child {
    display: none;
}

#workspaceHud[data-status="ready"] #hudStatus {
    color: #94a3b8;
}

#workspaceHud[data-status="ok"] #hudStatus {
    color: #22c55e;
}

#workspaceHud[data-status="error"] #hudStatus {
    color: #ef4444;
}

#workspaceHud[data-status="ready"] .hud-chip:first-child {
    border-color: rgba(148, 163, 184, 0.45);
}

#workspaceHud[data-status="ok"] .hud-chip:first-child {
    border-color: rgba(34, 197, 94, 0.45);
}

#workspaceHud[data-status="error"] .hud-chip:first-child {
    border-color: rgba(239, 68, 68, 0.45);
}

#resetUiBtn {
    justify-content: center;
    font-weight: 600;
}

.action-btn.toggled {
    background-color: #1f7aec;
}

.command-palette {
    position: fixed;
    inset: 0;
    background: rgba(6, 12, 20, 0.55);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 10vh 16px 0;
    z-index: 6000;
}

.command-palette.show {
    display: flex;
}

.command-palette-panel {
    width: min(680px, 100%);
    border-radius: 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

#commandPaletteInput {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 14px 16px;
    font-size: 15px;
    outline: none;
    background: var(--input-bg);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
}

#commandPaletteList {
    list-style: none;
    margin: 0;
    padding: 8px;
    max-height: 320px;
    overflow: auto;
}

#commandPaletteList li {
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#commandPaletteList li:hover,
#commandPaletteList li.active {
    background: var(--bg-tertiary);
}

#commandPaletteList li.command-group {
    cursor: default;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    opacity: 0.9;
    padding: 8px 8px 4px;
    background: transparent !important;
}

.command-shortcut {
    font-size: 11px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 2px 6px;
    background: var(--input-bg);
    white-space: nowrap;
}

.command-palette-hints {
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-secondary);
    font-size: 12px;
}

.command-palette-hints span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.command-palette-hints kbd {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
}

body.focus-mode footer {
    display: none;
}

body.focus-mode {
    overflow: hidden;
}

body.focus-mode .container {
    height: 100vh;
    overflow: hidden;
}

body.focus-mode .main-content {
    flex: 1;
    min-height: 0;
    height: auto;
    overflow: hidden;
}

body.focus-mode .status-banner {
    margin-top: 6px;
}

body.focus-mode #jsonInput,
body.focus-mode #jsonOutput {
    height: 100%;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

body.focus-mode .editor-wrapper {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
}

body.focus-mode .input-panel,
body.focus-mode .output-panel {
    min-height: 0;
}

body.focus-mode .toolbar {
    position: sticky;
    top: 10px;
    z-index: 2100;
}

body.focus-mode header {
    z-index: 2800;
}

body.focus-mode .workspace-hud,
body.focus-mode .dev-indicators {
    display: none;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background-color: var(--button-bg);
    color: white;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.dropdown-btn:hover {
    background-color: var(--button-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px var(--shadow);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--bg-secondary);
    min-width: 180px;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 4000;
    border-radius: 8px;
    margin-top: 4px;
    top: 100%;
    left: 0;
    border: 1px solid var(--border-color);
}

.dropdown-content a {
    color: var(--text-primary);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s ease;
}

.dropdown-content a:hover {
    background-color: var(--bg-tertiary);
}

.dropdown-content label {
    color: var(--text-primary);
    padding: 12px 16px;
    display: block;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dropdown-content label:hover {
    background-color: var(--bg-tertiary);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Bridge the gap between button and dropdown to prevent hover issues */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 0;
    right: 0;
    height: 4px;
    background: transparent;
}

.action-btn {
    background-color: var(--button-bg);
    color: white;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.action-btn:hover {
    background-color: var(--button-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px var(--shadow);
}

.action-btn.active {
    background-color: #27ae60;
}

.checkbox-label {
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: var(--accent-primary);
}

.checkbox-label input {
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.main-content {
    min-height: calc(100vh - 80px);
    display: flex;
    overflow: hidden;
}

.main-content.side-by-side {
    flex-direction: row;
}

.main-content.top-bottom {
    flex-direction: column;
}

.input-panel,
.output-panel {
    flex: 1;
    padding: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.input-panel,
.output-panel {
    background-color: var(--card);
}

.output-panel {
    border-left: 2px solid var(--border-color);
}

.main-content.top-bottom .output-panel {
    border-left: none;
    border-top: 2px solid var(--border-color);
}

body.dark-mode .input-panel,
body.dark-mode .output-panel {
    background-color: var(--card);
}

body.dark-mode .output-panel {
    border-left-color: var(--border);
}

body.dark-mode .main-content.top-bottom .output-panel {
    border-top-color: var(--border);
}

/* Search Box Styles */
.search-box {
    position: fixed;
    top: 130px;
    right: 5px;
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.search-icon-btn {
    width: 36px;
    height: 36px;
    padding: 6px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow);
}

.search-icon-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.search-icon-btn:hover {
    background-color: var(--button-bg);
    border-color: var(--button-bg);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.search-icon-btn:hover svg {
    color: #fff;
}

.search-box-content {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    margin-left: 0;
}

/* Expand when active (clicked) */
.search-box.active .search-box-content {
    max-width: 400px;
    opacity: 1;
    margin-left: 8px;
}

.search-box.active .search-icon-btn {
    background-color: var(--button-bg);
    border-color: var(--button-bg);
}

.search-box.active .search-icon-btn svg {
    color: #fff;
}

.search-input {
    width: 180px;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    outline: none;
    transition: all 0.2s;
    background-color: var(--input-bg);
    color: var(--text-primary);
}

.search-input:focus {
    border-color: var(--button-bg);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
    width: 200px;
}

.search-counter {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 45px;
    text-align: center;
    font-family: 'Courier New', monospace;
    background-color: var(--input-bg);
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.search-nav-btn {
    padding: 4px 8px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-primary);
    transition: all 0.2s;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-nav-btn:hover {
    background-color: var(--button-bg);
    color: #fff;
    border-color: var(--button-bg);
}

.search-nav-btn:active {
    transform: scale(0.95);
}

.search-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--bg-tertiary);
}

.search-nav-btn:disabled:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Highlight Styles */
mark {
    background-color: var(--highlight-bg);
    color: var(--text-primary);
    padding: 2px 0;
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

mark.current {
    background-color: var(--highlight-current);
    color: #fff;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.editor-wrapper {
    display: flex;
    flex: 1;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background-color: var(--input-bg);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.line-numbers {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 15px 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    text-align: right;
    user-select: none;
    border-right: 1px solid var(--border-color);
    min-width: 40px;
    overflow: hidden;
    white-space: pre;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body.dark-mode .line-numbers {
    background-color: var(--background);
    border-right-color: var(--border);
    color: var(--muted-foreground);
}

#jsonInput {
    flex: 1;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    border: none;
    resize: none;
    outline: none;
    line-height: 1.5;
    background-color: var(--input-bg);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode #jsonInput {
    background-color: var(--card);
    color: var(--foreground);
}

#jsonOutput {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    padding: 15px;
    overflow-x: hidden;
    overflow-y: hidden;
    background-color: var(--input-bg);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode #jsonOutput {
    background-color: var(--card);
    color: var(--foreground);
}

/* Output line numbers inherit from .line-numbers but ensure exact alignment */
#outputLineNumbers {
    /* Inherits line-height: 1.5 and padding: 15px 10px from .line-numbers */
}

/* Ensure all inline elements in output don't affect line height */
#jsonOutput * {
    line-height: inherit;
}

#jsonOutput button,
#jsonOutput .nested-indicator {
    max-height: 21px;
}

/* ============================================
   MODERN FOOTER STYLES
   ============================================ */

footer {
    background: var(--bg-primary);
    color: var(--text-color);
    padding: 60px 0 30px;
    margin-top: auto;
    border-top: 2px solid var(--primary);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

.dark-mode footer {
    background: var(--bg-primary);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

/* Footer Top Section */
.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: 60px;
    margin-bottom: 40px;
}

/* Footer Brand */
.footer-brand {
    max-width: 400px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
}

.footer-logo-img {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
    display: block;
    flex-shrink: 0;
}

.footer-logo:hover .footer-logo-img {
    transform: scale(1.1) rotate(5deg);
}

.footer-logo svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Social Links */
.footer-social {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.footer-social a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--primary);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    z-index: 0;
}

.footer-social a:hover::before {
    width: 100%;
    height: 100%;
}

.footer-social a:hover {
    border-color: var(--primary);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.footer-social a svg {
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.footer-social a:hover svg {
    color: white;
}

.footer-social svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    max-width: 20px;
    max-height: 20px;
    flex-shrink: 0;
}

/* Footer Links Section */
.footer-links-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.footer-column h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 8px;
}

.footer-column h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    margin-bottom: 12px;
}

.footer-column a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.footer-column a::before {
    content: '→';
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.footer-column a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.footer-column a:hover {
    color: var(--primary);
    padding-left: 8px;
}

/* Footer Divider */
.footer-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 40px 0;
    opacity: 0.3;
    position: relative;
}

.footer-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
}

/* Footer Bottom Section */
.footer-bottom {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 30px;
    align-items: center;
}

/* Copyright */
.footer-copyright {
    text-align: left;
}

.footer-copyright p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 4px 0;
}

.footer-made-with {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.heart-icon {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    max-width: 16px;
    max-height: 16px;
    flex-shrink: 0;
    color: #e11d48;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    10%,
    30% {
        transform: scale(1.1);
    }

    20%,
    40% {
        transform: scale(1);
    }
}

/* Creators Section */
.footer-creators {
    text-align: center;
}

.creators-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.creators-list {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.creator-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 24px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.creator-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.creator-link:hover::before {
    left: 100%;
}

.creator-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.creator-link svg {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.creator-link:hover svg {
    transform: rotate(360deg);
}

.separator {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Footer Badges */
.footer-badges {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    z-index: 0;
}

.badge:hover::before {
    transform: scaleX(1);
}

.badge:hover {
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.badge svg {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    max-width: 16px;
    max-height: 16px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.badge:hover svg {
    transform: scale(1.2);
}

.badge span {
    position: relative;
    z-index: 1;
}

/* JSON Syntax Highlighting */
.json-key {
    color: #881391;
    font-weight: bold;
}

body.dark-mode .json-key {
    color: #d896ff;
}

.json-string {
    color: #1A1AA6;
}

body.dark-mode .json-string {
    color: #6fb3ff;
}

.json-number {
    color: #1C00CF;
}

body.dark-mode .json-number {
    color: #b5a3ff;
}

.json-boolean {
    color: #0000FF;
    font-weight: bold;
}

body.dark-mode .json-boolean {
    color: #7aa3ff;
}

.json-null {
    color: #808080;
    font-weight: bold;
}

body.dark-mode .json-null {
    color: #999999;
}

.json-type {
    color: #008000;
    font-style: italic;
    margin-left: 10px;
    display: inline;
    white-space: nowrap;
    line-height: 1.5;
    vertical-align: baseline;
}

body.dark-mode .json-type {
    color: #7fcc7f;
}

.json-index {
    color: #FF6600;
    font-weight: bold;
    display: inline;
    white-space: nowrap;
    line-height: 1.5;
    vertical-align: baseline;
}

body.dark-mode .json-index {
    color: #ff9955;
}

.error {
    color: #e74c3c;
    font-weight: bold;
}

body.dark-mode .error {
    color: #ff6b6b;
}

/* Invalid JSON display */
.invalid-json-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.invalid-json-output {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 16px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow-x: auto;
}

body.dark-mode .invalid-json-output {
    background-color: #2d2d2d;
    border-color: #444;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    border-left: 4px solid #e74c3c;
}

body.dark-mode .error-message {
    background-color: #3d2f1f;
    border-color: #d39e00;
}

.error-icon {
    font-size: 20px;
    flex-shrink: 0;
}

/* Inline error message (shown after parsed JSON) */
.inline-error-message {
    margin-top: 12px;
    padding: 10px 14px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    border-left: 4px solid #e74c3c;
}

body.dark-mode .inline-error-message {
    background-color: #3d2f1f;
    border-color: #d39e00;
}

.error-message-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.error-icon {
    font-size: 18px;
    line-height: 1.3;
    flex-shrink: 0;
    margin-top: 1px;
}

.error-text {
    flex: 1;
    min-width: 0;
}

.error-main {
    color: #856404;
    font-size: 13px;
    line-height: 1.3;
    margin: 0 0 4px 0;
}

body.dark-mode .error-main {
    color: #ffc107;
}

.error-hint {
    font-size: 12px;
    color: #666;
    margin: 4px 0 0 0;
}

body.dark-mode .error-hint {
    color: #aaa;
}

.error-hint strong {
    color: #856404;
    font-weight: 600;
}

body.dark-mode .error-hint strong {
    color: #ffc107;
}

.error-fixes-list {
    margin: 2px 0 0 0;
    padding-left: 20px;
    list-style-type: disc;
}

.error-fixes-list li {
    margin: 1px 0;
    line-height: 1.3;
    color: #666;
}

body.dark-mode .error-fixes-list li {
    color: #aaa;
}

.nested-indicator {
    background-color: #f39c12;
    color: white;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    height: 18px;
    line-height: 1.6;
    font-weight: bold;
    margin-left: 8px;
    vertical-align: middle;
    display: inline-block;
    white-space: nowrap;
}

body.dark-mode .nested-indicator {
    background-color: #e67e22;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: var(--text-secondary);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 8px;
    cursor: pointer;
    vertical-align: middle;
    height: 18px;
    line-height: 1;
    opacity: 0;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    position: relative;
}

/* Note: Button visibility is now controlled by json-hover-wrapper hover in the output panel */

.copy-btn:hover {
    background-color: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
}

.copy-btn:active {
    background-color: #27ae60;
    color: white;
    border-color: #27ae60;
}

/* Tooltip */
.copy-btn::before {
    content: 'Copy';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 5px;
    z-index: 1000;
}

.copy-btn::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2c3e50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.copy-btn:hover::before,
.copy-btn:hover::after {
    opacity: 1;
}

/* SVG icon inside copy button */
.copy-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Share link button */
.share-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: var(--text-secondary);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 4px;
    cursor: pointer;
    vertical-align: middle;
    height: 18px;
    line-height: 1;
    opacity: 0;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    position: relative;
}

.share-link-btn:hover {
    background-color: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
}

.share-link-btn:active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* Tooltip for share link button */
.share-link-btn::before {
    content: 'Copy share link';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 5px;
    z-index: 1000;
}

.share-link-btn::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2c3e50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.share-link-btn:hover::before,
.share-link-btn:hover::after {
    opacity: 1;
}

/* SVG icon inside share link button */
.share-link-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Toggle buttons for collapse/expand - hidden in output, shown in line numbers */
.toggle-btn {
    display: none !important;
}

.toggle-btn.collapsed::before {
    content: '▶';
}

.toggle-btn.expanded::before {
    content: '▼';
}

/* Line markers for tracking line positions - invisible but measurable */
.line-marker {
    display: inline-block;
    width: 0;
    height: 1px;
    vertical-align: top;
}

/* Toggle button in line numbers */
.toggle-btn-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    font-weight: bold;
    font-size: 10px;
    color: #7f8c8d;
    transition: color 0.2s;
    font-family: monospace;
    margin-left: 2px;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

body.dark-mode .toggle-btn-line {
    color: #95a5a6;
}

.toggle-btn-line:hover {
    color: #2c3e50;
}

body.dark-mode .toggle-btn-line:hover {
    color: #bdc3c7;
}

.toggle-btn-line.collapsed::before {
    content: '▶';
}

.toggle-btn-line.expanded::before {
    content: '▼';
}

/* Spacer for line numbers without toggle (to maintain alignment) */
.toggle-btn-line-spacer {
    display: inline-flex;
    width: 14px;
    height: 14px;
    margin-left: 2px;
    flex-shrink: 0;
}

/* Line number row container */
.line-number-row {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    min-height: 21px;
    line-height: 1.5;
    padding-right: 5px;
}

/* Line number text */
.line-number-text {
    display: inline-block;
    min-width: 30px;
    text-align: right;
    padding-right: 5px;
}

/* Clickable line numbers with toggle */
.line-number-clickable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s, color 0.2s;
}

.line-number-clickable:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: #2c3e50;
}

body.dark-mode .line-number-clickable:hover {
    background-color: rgba(52, 152, 219, 0.2);
    color: #ecf0f1;
}

/* JSON hover wrapper styles - for showing copy icons when hovering on objects/arrays in output panel */
.json-hover-wrapper {
    display: inline;
    position: relative;
}

/* Full-width background highlight for hovered wrapper - uses primary color */
.json-hover-wrapper.hovering::before {
    content: '';
    position: absolute;
    left: -100vw;
    right: -100vw;
    top: 0;
    bottom: 0;
    background-color: color-mix(in srgb, var(--primary) 12%, transparent);
    pointer-events: none;
    z-index: 1;
}

body.dark-mode .json-hover-wrapper.hovering::before {
    background-color: color-mix(in srgb, var(--primary) 20%, transparent);
}

/* Ensure buttons appear above the highlight */
.json-hover-wrapper .copy-btn,
.json-hover-wrapper .share-link-btn,
.json-hover-wrapper .toggle-btn {
    position: relative;
    z-index: 2;
}

/* Make text and content appear above the highlight */
.json-hover-wrapper .json-key,
.json-hover-wrapper .json-string,
.json-hover-wrapper .json-number,
.json-hover-wrapper .json-boolean,
.json-hover-wrapper .json-null,
.json-hover-wrapper .json-content,
.json-hover-wrapper .json-ellipsis,
.json-hover-wrapper .json-type,
.json-hover-wrapper .json-index,
.json-hover-wrapper .nested-indicator {
    position: relative;
    z-index: 2;
}

/* Line number hover styles - for lines with toggle buttons */
.line-number-hoverable {
    cursor: pointer;
}

/* Highlight style for line numbers in the hovered range - uses primary color */
.line-number-row.line-range-highlighted {
    background-color: color-mix(in srgb, var(--primary) 12%, transparent);
    border-left: 2px solid var(--primary);
    margin-left: -2px;
}

body.dark-mode .line-number-row.line-range-highlighted {
    background-color: color-mix(in srgb, var(--primary) 20%, transparent);
}

/* Hide all copy/share buttons by default, show only on hover */
#jsonOutput .copy-btn,
#jsonOutput .share-link-btn {
    opacity: 0;
    transition: opacity 0.15s ease;
}

/* Show buttons when wrapper is hovered (via JS class) */
#jsonOutput .buttons-expanded.line-hover-visible .copy-btn,
#jsonOutput .buttons-expanded.line-hover-visible .share-link-btn,
#jsonOutput .buttons-collapsed.line-hover-visible .copy-btn,
#jsonOutput .buttons-collapsed.line-hover-visible .share-link-btn {
    opacity: 1;
}

/* Also show buttons when directly hovering over them in jsonOutput */
#jsonOutput .copy-btn:hover,
#jsonOutput .share-link-btn:hover {
    opacity: 1;
}

.json-content {
    display: inline;
}

.json-content.collapsed {
    display: none;
}

/* Wrapper for collapsible elements to handle comma positioning */
.collapsible-wrapper {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
}

/* Comma that appears after collapsed elements */
.comma-after-collapse {
    order: 1;
}

/* Buttons should appear after comma */
.buttons-collapsed {
    order: 2;
}

.json-ellipsis {
    color: #95a5a6;
    font-style: italic;
    margin-left: 5px;
    display: inline;
    white-space: nowrap;
}

body.dark-mode .json-ellipsis {
    color: #7f8c8d;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #27ae60;
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    font-weight: bold;
    z-index: 1000;
    animation: slideIn 0.3s ease-out, slideOut 0.3s ease-in 2.7s;
    opacity: 0;
}

.toast.show {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ============================================
   RESPONSIVE MOBILE STYLES
   ============================================ */

/* Tablet and below (768px) */
@media screen and (max-width: 768px) {

    /* Header adjustments */
    header {
        padding: 12px 15px;
        flex-wrap: wrap;
    }

    .header-logo {
        width: 28px;
        height: 28px;
    }

    header h1 {
        font-size: 18px;
        margin-right: auto;
    }

    .header-links {
        display: none;
        /* Hide links on mobile, can be shown in menu */
    }

    /* Settings dropdown */
    .settings-dropdown {
        position: static;
    }

    .settings-toggle {
        padding: 8px 12px;
        font-size: 14px;
    }

    .settings-dropdown-content {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
    }

    .settings-section-title {
        font-size: 13px;
    }

    .settings-options {
        gap: 8px;
    }

    .settings-option {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Toolbar adjustments */
    .toolbar {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .toolbar-left,
    .toolbar-right {
        gap: 8px;
    }

    .toolbar button {
        padding: 8px 12px;
        font-size: 13px;
    }

    .toolbar button svg {
        width: 16px;
        height: 16px;
    }

    /* Main content - stack vertically on mobile */
    .main-content {
        flex-direction: column !important;
    }

    .input-panel,
    .output-panel {
        min-height: 300px;
        max-height: none;
    }

    .output-panel {
        border-left: none !important;
        border-top: 2px solid var(--border-color);
    }

    /* Text areas */
    #jsonInput {
        font-size: 13px;
        min-height: 250px;
    }

    #jsonOutput {
        font-size: 13px;
    }

    /* Line numbers */
    .line-numbers {
        min-width: 35px;
        padding: 15px 8px;
        font-size: 12px;
    }

    /* Search panel */
    .search-panel {
        padding: 10px 15px;
    }

    .search-input {
        font-size: 13px;
        padding: 8px 35px 8px 12px;
    }

    /* Revert search box to absolute positioning on mobile */
    .search-box {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 100;
    }

    .search-controls {
        gap: 8px;
    }

    .search-controls button {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* Toast notifications */
    .toast {
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 40px);
        max-width: 300px;
    }

    /* Footer */
    footer {
        padding: 15px;
        font-size: 12px;
    }

    .footer-links {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* Mobile phones (480px and below) */
@media screen and (max-width: 480px) {

    /* Header */
    .header-logo {
        width: 24px;
        height: 24px;
    }

    .header-brand {
        gap: 8px;
    }

    header h1 {
        font-size: 16px;
    }

    /* Settings */
    .settings-toggle {
        padding: 6px 10px;
        font-size: 13px;
    }

    .settings-toggle svg {
        width: 16px;
        height: 16px;
    }

    .color-options {
        grid-template-columns: repeat(3, 1fr);
    }

    .color-preview {
        width: 30px;
        height: 30px;
    }

    /* Toolbar - single column on very small screens */
    .toolbar {
        padding: 8px 10px;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .toolbar button {
        padding: 6px 10px;
        font-size: 12px;
        flex: 1;
    }

    .toolbar button span {
        display: none;
        /* Hide text, show only icons */
    }

    .toolbar button svg {
        margin-right: 0;
    }

    /* Panels */
    .input-panel,
    .output-panel {
        padding: 10px;
        min-height: 250px;
    }

    #jsonInput {
        font-size: 12px;
        padding: 10px;
    }

    #jsonOutput {
        font-size: 12px;
        padding: 10px;
    }

    /* Line numbers */
    .line-numbers {
        min-width: 30px;
        padding: 10px 5px;
        font-size: 11px;
    }

    /* Search */
    .search-panel {
        padding: 8px 10px;
    }

    .search-input {
        font-size: 12px;
    }

    .search-stats {
        font-size: 11px;
    }

    /* Revert search box to absolute positioning on small mobile */
    .search-box {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 100;
    }

    /* Toast */
    .toast {
        font-size: 13px;
        padding: 10px 15px;
    }
}

/* Landscape orientation on mobile - Keep top-bottom layout */
@media screen and (max-width: 768px) and (orientation: landscape) {

    /* Mobile always uses top-bottom layout regardless of orientation */
    .main-content {
        flex-direction: column !important;
    }

    .output-panel {
        border-left: none !important;
        border-top: 2px solid var(--border-color) !important;
    }

    .input-panel,
    .output-panel {
        min-height: 200px;
    }
}

/* PWA Install Button */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--button-bg);
    color: var(--primary-foreground);
    padding: 12px 24px;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    animation: slideUp 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 14px;
    font-weight: 500;
}

.install-prompt.show {
    display: flex;
}

.install-prompt:hover {
    background: var(--button-hover);
    transform: translateX(-50%) scale(1.05);
}

.install-prompt svg {
    width: 20px;
    height: 20px;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {

    /* Increase touch targets */
    button,
    .settings-option,
    .toolbar button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Better spacing for touch */
    .toolbar {
        gap: 10px;
    }

    .settings-options {
        gap: 10px;
    }

    /* Larger tap areas */
    .search-controls button {
        min-height: 40px;
        min-width: 40px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    /* Sharper borders and shadows */
    .settings-dropdown-content,
    .toast,
    .install-prompt {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    }
}

/* Footer Responsive Styles */
@media (max-width: 1024px) {
    .footer-top {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-links-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .footer-bottom {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }

    .footer-copyright {
        text-align: center;
    }

    .footer-badges {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    footer {
        padding: 40px 0 20px;
    }

    .footer-content {
        padding: 0 20px;
    }

    .footer-links-section {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-brand {
        max-width: 100%;
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .creators-list {
        flex-direction: column;
        gap: 8px;
    }

    .separator {
        display: none;
    }

    .footer-badges {
        flex-direction: column;
        align-items: center;
    }

    .badge {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .footer-logo {
        font-size: 18px;
    }

    .footer-logo svg {
        width: 28px;
        height: 28px;
    }

    .footer-tagline {
        font-size: 13px;
    }

    .footer-social a {
        width: 36px;
        height: 36px;
    }

    .footer-column h4 {
        font-size: 13px;
    }

    .footer-column a {
        font-size: 13px;
    }

    .creator-link {
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Critical CSS to prevent icon flash - loads immediately before external CSS */
.header-logo {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
}

.footer-logo-img {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
}

.footer-social svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
}

.creator-link svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
}

.heart-icon {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
}

.badge svg {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
}

/* ============================================
   ENTERPRISE 3D THEME UPGRADE
   ============================================ */

:root {
    --enterprise-bg-1: #071424;
    --enterprise-bg-2: #0f2233;
    --enterprise-bg-3: #0c1c2f;
    --enterprise-accent: #00b3ff;
    --enterprise-accent-soft: #74d7ff;
    --enterprise-surface: rgba(13, 30, 45, 0.78);
    --enterprise-stroke: rgba(117, 167, 194, 0.26);
}

body.enterprise-theme,
body.dark-mode.enterprise-theme {
    background:
        radial-gradient(circle at 15% 10%, rgba(0, 179, 255, 0.18), transparent 40%),
        radial-gradient(circle at 85% 5%, rgba(9, 224, 184, 0.14), transparent 45%),
        linear-gradient(120deg, var(--enterprise-bg-1), var(--enterprise-bg-2) 48%, var(--enterprise-bg-3));
    color: #e7f4fb;
    font-family: 'Space Grotesk', 'Trebuchet MS', 'Geneva', sans-serif;
    min-height: 100vh;
    --cursor-x: 50%;
    --cursor-y: 40%;
}

#enterpriseCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: none;
}

.ambient-grid {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    display: none;
    background-image:
        linear-gradient(rgba(138, 188, 215, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(138, 188, 215, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at center, black 30%, transparent 95%);
}

.dev-scanlines,
.dev-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    display: none;
}

.dev-scanlines {
    z-index: 2;
    opacity: 0.22;
    background: repeating-linear-gradient(180deg,
            rgba(195, 230, 255, 0.05) 0px,
            rgba(195, 230, 255, 0.05) 1px,
            transparent 2px,
            transparent 6px);
    animation: scanShift 12s linear infinite;
}

.dev-noise {
    z-index: 2;
    opacity: 0.08;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.35) 0.45px, transparent 0.45px),
        radial-gradient(rgba(0, 0, 0, 0.3) 0.45px, transparent 0.45px);
    background-position: 0 0, 11px 11px;
    background-size: 22px 22px;
}

body.enterprise-theme #enterpriseCanvas,
body.enterprise-theme .ambient-grid,
body.enterprise-theme .dev-scanlines,
body.enterprise-theme .dev-noise {
    display: block;
}

.container {
    position: relative;
    z-index: 3;
}

body.enterprise-theme .container::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(420px circle at var(--cursor-x) var(--cursor-y), rgba(19, 176, 255, 0.17), transparent 72%),
        radial-gradient(620px circle at calc(var(--cursor-x) + 8%) calc(var(--cursor-y) + 4%), rgba(16, 226, 184, 0.11), transparent 78%);
}

body.enterprise-theme .brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

body.enterprise-theme .header-subtitle {
    margin: 0;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 11px;
    letter-spacing: 1.8px;
    color: rgba(164, 225, 255, 0.9);
    text-transform: uppercase;
}

body:not(.enterprise-theme) .header-subtitle {
    display: none;
}

body.enterprise-theme .dev-indicators {
    display: flex;
    gap: 8px;
    align-items: center;
}

body.enterprise-theme .dev-chip {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 10px;
    padding: 6px 9px;
    border-radius: 999px;
    color: #bdeeff;
    border: 1px solid rgba(112, 194, 231, 0.35);
    background: linear-gradient(180deg, rgba(8, 26, 39, 0.9), rgba(8, 33, 48, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 5px 12px rgba(4, 14, 24, 0.35);
    animation: chipPulse 2.8s ease-in-out infinite;
}

body.enterprise-theme .hud-chip {
    border-color: rgba(111, 168, 199, 0.35);
    background: rgba(9, 24, 37, 0.82);
    color: #9ad8f4;
}

body.enterprise-theme .hud-chip strong {
    color: #dff7ff;
}

body.enterprise-theme .command-palette-panel {
    background: rgba(8, 24, 36, 0.96);
    border-color: rgba(111, 168, 199, 0.35);
}

body.enterprise-theme #commandPaletteList li:hover,
body.enterprise-theme #commandPaletteList li.active {
    background: rgba(41, 110, 148, 0.32);
}

body.enterprise-theme .command-shortcut,
body.enterprise-theme .command-palette-hints kbd {
    background: rgba(9, 24, 37, 0.82);
    border-color: rgba(111, 168, 199, 0.35);
    color: #cceefc;
}

body.enterprise-theme #commandPaletteList li.command-group,
body.enterprise-theme .command-palette-hints {
    color: #8fcbe7;
    border-top-color: rgba(111, 168, 199, 0.35);
}

body.enterprise-theme .dev-chip:nth-child(2) {
    animation-delay: 0.5s;
}

body.enterprise-theme .dev-chip:nth-child(3) {
    animation-delay: 1s;
}

body:not(.enterprise-theme) .dev-indicators {
    display: none;
}

body.enterprise-theme header,
body.enterprise-theme .toolbar,
body.enterprise-theme .input-panel,
body.enterprise-theme .output-panel,
body.enterprise-theme footer,
body.enterprise-theme .settings-dropdown-content,
body.enterprise-theme .dropdown-content {
    background: var(--enterprise-surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--enterprise-stroke);
}

body.enterprise-theme header {
    margin: 18px 22px 10px;
    border-radius: 16px;
    box-shadow: 0 14px 35px rgba(4, 12, 20, 0.45);
}

body.enterprise-theme .toolbar {
    margin: 0 22px 12px;
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 28px rgba(4, 12, 20, 0.35);
}

body.enterprise-theme .main-content {
    margin: 0 22px 24px;
    gap: 14px;
    min-height: calc(100vh - 260px);
    overflow: visible;
}

body.enterprise-theme .output-panel {
    border-left: 1px solid var(--enterprise-stroke);
}

body.enterprise-theme .input-panel,
body.enterprise-theme .output-panel {
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(220, 240, 255, 0.09), 0 18px 32px rgba(3, 10, 18, 0.38);
    transform-style: preserve-3d;
    transition: transform 0.26s ease, box-shadow 0.26s ease;
    overflow: hidden;
}

body.enterprise-theme .input-panel::before,
body.enterprise-theme .output-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    border: 1px solid rgba(137, 221, 255, 0.24);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    padding: 1px;
    opacity: 0.72;
}

body.enterprise-theme .input-panel::after,
body.enterprise-theme .output-panel::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(138, 223, 255, 0.9), transparent);
    box-shadow: 0 -1px 14px rgba(108, 214, 255, 0.5);
    pointer-events: none;
}

body.enterprise-theme .input-panel:hover,
body.enterprise-theme .output-panel:hover {
    transform: translateY(-2px) rotateX(0.35deg) rotateY(-0.35deg);
    box-shadow: inset 0 1px 0 rgba(220, 240, 255, 0.11), 0 24px 38px rgba(3, 10, 18, 0.5);
}

body.enterprise-theme header h1,
body.enterprise-theme .footer-logo span {
    letter-spacing: 0.3px;
    color: #f3fbff;
}

body.enterprise-theme .settings-toggle,
body.enterprise-theme .dropdown-btn,
body.enterprise-theme .action-btn {
    background: linear-gradient(180deg, #24bfff, #0097d9);
    color: #f5fcff;
    border: 1px solid rgba(197, 240, 255, 0.38);
    box-shadow: 0 8px 16px rgba(0, 126, 179, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    position: relative;
    overflow: hidden;
}

body.enterprise-theme .visual-options .settings-option.active {
    background: linear-gradient(180deg, #24bfff, #0097d9);
    color: #f5fcff !important;
    border-color: rgba(197, 240, 255, 0.38);
    box-shadow: 0 8px 16px rgba(0, 126, 179, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

body.enterprise-theme [data-mode].settings-option.active {
    background: linear-gradient(180deg, #24bfff, #0097d9);
    color: #f5fcff !important;
    border-color: rgba(197, 240, 255, 0.38);
    box-shadow: 0 8px 16px rgba(0, 126, 179, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

body.enterprise-theme .settings-toggle::before,
body.enterprise-theme .dropdown-btn::before,
body.enterprise-theme .action-btn::before {
    content: '';
    position: absolute;
    inset: -120% auto auto -20%;
    width: 60%;
    height: 260%;
    transform: rotate(24deg);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
    opacity: 0;
}

body.enterprise-theme .settings-toggle:hover::before,
body.enterprise-theme .dropdown-btn:hover::before,
body.enterprise-theme .action-btn:hover::before {
    opacity: 1;
    animation: buttonSweep 0.75s ease;
}

body.enterprise-theme .settings-toggle:hover,
body.enterprise-theme .dropdown-btn:hover,
body.enterprise-theme .action-btn:hover {
    background: linear-gradient(180deg, #39c8ff, #009fd8);
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 10px 18px rgba(0, 142, 201, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

body.enterprise-theme .action-btn.active {
    background: linear-gradient(180deg, #1fd9ac, #0db88f);
    border-color: rgba(171, 255, 229, 0.38);
    box-shadow: 0 0 0 1px rgba(102, 247, 209, 0.35), 0 9px 20px rgba(3, 115, 90, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

body.enterprise-theme #jsonInput,
body.enterprise-theme #jsonOutput,
body.enterprise-theme .line-numbers,
body.enterprise-theme .editor-wrapper,
body.enterprise-theme .search-icon-btn,
body.enterprise-theme .search-input,
body.enterprise-theme .search-counter,
body.enterprise-theme .search-nav-btn,
body.enterprise-theme .checkbox-label {
    color: #d5ecf9;
}

body.enterprise-theme #jsonInput,
body.enterprise-theme #jsonOutput,
body.enterprise-theme .editor-wrapper,
body.enterprise-theme .line-numbers,
body.enterprise-theme .search-icon-btn,
body.enterprise-theme .search-input,
body.enterprise-theme .search-counter,
body.enterprise-theme .search-nav-btn,
body.enterprise-theme .badge,
body.enterprise-theme .creator-link,
body.enterprise-theme .footer-social a {
    background-color: rgba(9, 24, 37, 0.78);
    border-color: rgba(111, 168, 199, 0.28);
}

body.enterprise-theme #jsonInput,
body.enterprise-theme #jsonOutput,
body.enterprise-theme .line-numbers {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
}

body.enterprise-theme footer {
    margin: 0 22px 22px;
    border-radius: 18px;
    border-top: 1px solid rgba(111, 168, 199, 0.28);
    box-shadow: 0 16px 34px rgba(3, 10, 18, 0.42);
}

body.enterprise-theme footer::before,
body.enterprise-theme .footer-divider {
    background: linear-gradient(90deg, transparent, var(--enterprise-accent-soft), transparent);
}

body.enterprise-theme .footer-column h4,
body.enterprise-theme .footer-column a:hover,
body.enterprise-theme .header-links a,
body.enterprise-theme .checkbox-label:hover {
    color: var(--enterprise-accent-soft);
}

body.enterprise-theme .json-hover-wrapper.hovering::before,
body.enterprise-theme .line-number-row.line-range-highlighted {
    background-color: rgba(80, 202, 255, 0.14);
    border-left-color: rgba(116, 215, 255, 0.9);
}

body.enterprise-theme .json-key {
    color: #7fd9ff;
}

body.enterprise-theme .json-string {
    color: #8fffd9;
}

body.enterprise-theme .json-number {
    color: #ffcf7a;
}

body.enterprise-theme .json-boolean {
    color: #c2b2ff;
}

body.enterprise-theme .json-null {
    color: #ff8eb5;
}

body.enterprise-theme #jsonInput::selection,
body.enterprise-theme #jsonOutput ::selection {
    background: rgba(58, 189, 255, 0.34);
}

/* Neo Terminal variant on top of enterprise foundation */
body.neo-terminal-theme {
    --enterprise-bg-1: #04150e;
    --enterprise-bg-2: #082419;
    --enterprise-bg-3: #0a1f14;
    --enterprise-surface: rgba(6, 28, 18, 0.84);
    --enterprise-stroke: rgba(120, 255, 194, 0.26);
}

body.neo-terminal-theme .ambient-grid {
    background-image:
        linear-gradient(rgba(120, 255, 194, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 255, 194, 0.055) 1px, transparent 1px);
}

body.neo-terminal-theme .settings-toggle,
body.neo-terminal-theme .dropdown-btn,
body.neo-terminal-theme .action-btn {
    background: linear-gradient(180deg, #28f4b3, #16c88f);
    border-color: rgba(180, 255, 225, 0.5);
    box-shadow: 0 8px 16px rgba(22, 180, 124, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    color: #052015;
    font-weight: 700;
}

body.neo-terminal-theme .visual-options .settings-option.active {
    background: linear-gradient(180deg, #28f4b3, #16c88f);
    color: #052015 !important;
    border-color: rgba(180, 255, 225, 0.5);
    box-shadow: 0 8px 16px rgba(22, 180, 124, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

body.neo-terminal-theme [data-mode].settings-option.active {
    background: linear-gradient(180deg, #28f4b3, #16c88f);
    color: #052015 !important;
    border-color: rgba(180, 255, 225, 0.5);
    box-shadow: 0 8px 16px rgba(22, 180, 124, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

body.neo-terminal-theme [data-mode].settings-option.active svg {
    color: #052015 !important;
}

body.neo-terminal-theme .settings-toggle:hover,
body.neo-terminal-theme .dropdown-btn:hover,
body.neo-terminal-theme .action-btn:hover {
    background: linear-gradient(180deg, #38ffbe, #1ad495);
    box-shadow: 0 10px 18px rgba(27, 195, 134, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

body.neo-terminal-theme .action-btn.active {
    background: linear-gradient(180deg, #ffd274, #ffb949);
    color: #261c05;
    border-color: rgba(255, 234, 191, 0.4);
    box-shadow: 0 0 0 1px rgba(255, 221, 149, 0.35), 0 9px 20px rgba(146, 101, 22, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

body.neo-terminal-theme .header-subtitle,
body.neo-terminal-theme .footer-column h4,
body.neo-terminal-theme .footer-column a:hover,
body.neo-terminal-theme .checkbox-label:hover {
    color: #86ffcc;
}

body.neo-terminal-theme .dev-chip {
    color: #b8ffd8;
    border-color: rgba(120, 255, 194, 0.35);
    background: linear-gradient(180deg, rgba(5, 28, 18, 0.93), rgba(8, 38, 25, 0.93));
}

body.neo-terminal-theme .json-key {
    color: #8bffcf;
}

body.neo-terminal-theme .json-string {
    color: #f3ff99;
}

body.neo-terminal-theme .json-number {
    color: #87d5ff;
}

body.neo-terminal-theme .json-boolean {
    color: #ffb4d8;
}

body.neo-terminal-theme .json-null {
    color: #ffb77b;
}

body.neo-terminal-theme .json-hover-wrapper.hovering::before,
body.neo-terminal-theme .line-number-row.line-range-highlighted {
    background-color: rgba(52, 255, 171, 0.16);
    border-left-color: rgba(159, 255, 210, 0.9);
}

body.neo-terminal-theme .search-icon-btn,
body.neo-terminal-theme .search-input,
body.neo-terminal-theme .search-counter,
body.neo-terminal-theme .search-nav-btn,
body.neo-terminal-theme .line-numbers,
body.neo-terminal-theme #jsonInput,
body.neo-terminal-theme #jsonOutput {
    color: #d8ffe9;
    border-color: rgba(120, 255, 194, 0.28);
    background-color: rgba(5, 27, 17, 0.86);
}

body.neo-terminal-theme .hud-chip {
    border-color: rgba(120, 255, 194, 0.35);
    background: rgba(5, 28, 18, 0.88);
    color: #95ffd1;
}

body.neo-terminal-theme .hud-chip strong {
    color: #e8fff4;
}

body.neo-terminal-theme ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #38ffbe, #1bcf94);
}

/* Midnight Ops variant on top of enterprise foundation */
body.midnight-ops-theme {
    --enterprise-bg-1: #090f1f;
    --enterprise-bg-2: #101a33;
    --enterprise-bg-3: #0f1d2b;
    --enterprise-surface: rgba(14, 26, 45, 0.84);
    --enterprise-stroke: rgba(126, 172, 255, 0.26);
}

body.midnight-ops-theme .ambient-grid {
    background-image:
        linear-gradient(rgba(122, 170, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(122, 170, 255, 0.05) 1px, transparent 1px);
}

body.midnight-ops-theme .settings-toggle,
body.midnight-ops-theme .dropdown-btn,
body.midnight-ops-theme .action-btn {
    background: linear-gradient(180deg, #63a1ff, #4a7be0);
    border-color: rgba(198, 216, 255, 0.45);
    box-shadow: 0 8px 16px rgba(56, 97, 185, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.33);
    color: #eff4ff;
}

body.midnight-ops-theme .visual-options .settings-option.active {
    background: linear-gradient(180deg, #63a1ff, #4a7be0);
    color: #eff4ff !important;
    border-color: rgba(198, 216, 255, 0.45);
    box-shadow: 0 8px 16px rgba(56, 97, 185, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.33);
}

body.midnight-ops-theme [data-mode].settings-option.active {
    background: linear-gradient(180deg, #63a1ff, #4a7be0);
    color: #eff4ff !important;
    border-color: rgba(198, 216, 255, 0.45);
    box-shadow: 0 8px 16px rgba(56, 97, 185, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.33);
}

body.midnight-ops-theme .settings-toggle:hover,
body.midnight-ops-theme .dropdown-btn:hover,
body.midnight-ops-theme .action-btn:hover {
    background: linear-gradient(180deg, #78afff, #5688e9);
}

body.midnight-ops-theme .action-btn.active {
    background: linear-gradient(180deg, #ffb163, #ef9448);
    color: #2b1704;
    border-color: rgba(255, 218, 187, 0.45);
    box-shadow: 0 0 0 1px rgba(255, 193, 133, 0.35), 0 10px 22px rgba(141, 85, 33, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

body.midnight-ops-theme .header-subtitle,
body.midnight-ops-theme .footer-column h4,
body.midnight-ops-theme .footer-column a:hover,
body.midnight-ops-theme .checkbox-label:hover {
    color: #ffc688;
}

body.midnight-ops-theme .dev-chip {
    color: #d8e7ff;
    border-color: rgba(125, 174, 255, 0.35);
    background: linear-gradient(180deg, rgba(12, 26, 49, 0.92), rgba(16, 35, 62, 0.92));
}

body.midnight-ops-theme .json-key {
    color: #9ac3ff;
}

body.midnight-ops-theme .json-string {
    color: #ffd591;
}

body.midnight-ops-theme .json-number {
    color: #9de2ff;
}

body.midnight-ops-theme .json-boolean {
    color: #d4b8ff;
}

body.midnight-ops-theme .json-null {
    color: #ff9eb8;
}

body.midnight-ops-theme .json-hover-wrapper.hovering::before,
body.midnight-ops-theme .line-number-row.line-range-highlighted {
    background-color: rgba(104, 148, 255, 0.16);
    border-left-color: rgba(171, 201, 255, 0.95);
}

body.midnight-ops-theme .search-icon-btn,
body.midnight-ops-theme .search-input,
body.midnight-ops-theme .search-counter,
body.midnight-ops-theme .search-nav-btn,
body.midnight-ops-theme .line-numbers,
body.midnight-ops-theme #jsonInput,
body.midnight-ops-theme #jsonOutput {
    color: #e0eaff;
    border-color: rgba(126, 171, 255, 0.28);
    background-color: rgba(12, 25, 44, 0.86);
}

body.midnight-ops-theme .hud-chip {
    border-color: rgba(126, 171, 255, 0.35);
    background: rgba(12, 25, 44, 0.88);
    color: #9ec0ff;
}

body.midnight-ops-theme .hud-chip strong {
    color: #eff4ff;
}

body.midnight-ops-theme ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #85b8ff, #658fdf);
}

/* Ensure settings toggle follows active visual theme palette */
body.enterprise-theme #settingsToggle {
    background: linear-gradient(180deg, #24bfff, #0097d9);
    color: #f5fcff;
    border: 1px solid rgba(197, 240, 255, 0.38);
}

body.enterprise-theme #settingsToggle:hover {
    background: linear-gradient(180deg, #39c8ff, #009fd8);
}

body.neo-terminal-theme #settingsToggle {
    background: linear-gradient(180deg, #28f4b3, #16c88f);
    color: #052015;
    border-color: rgba(180, 255, 225, 0.5);
}

body.neo-terminal-theme #settingsToggle:hover {
    background: linear-gradient(180deg, #38ffbe, #1ad495);
}

body.midnight-ops-theme #settingsToggle {
    background: linear-gradient(180deg, #63a1ff, #4a7be0);
    color: #eff4ff;
    border-color: rgba(198, 216, 255, 0.45);
}

body.midnight-ops-theme #settingsToggle:hover {
    background: linear-gradient(180deg, #78afff, #5688e9);
}

body.enterprise-theme ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

body.enterprise-theme ::-webkit-scrollbar-track {
    background: rgba(5, 20, 30, 0.8);
}

body.enterprise-theme ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #2dc0ff, #1597d0);
    border-radius: 999px;
    border: 2px solid rgba(5, 20, 30, 0.85);
}

@keyframes scanShift {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(18px);
    }
}

@keyframes buttonSweep {
    from {
        transform: translateX(-160%) rotate(24deg);
    }

    to {
        transform: translateX(300%) rotate(24deg);
    }
}

@keyframes chipPulse {

    0%,
    100% {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 5px 12px rgba(4, 14, 24, 0.35);
    }

    50% {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 8px 16px rgba(12, 101, 156, 0.38);
    }
}

@media screen and (max-width: 768px) {

    body.enterprise-theme header,
    body.enterprise-theme .toolbar,
    body.enterprise-theme .main-content,
    body.enterprise-theme footer {
        margin-left: 10px;
        margin-right: 10px;
    }

    body.enterprise-theme .main-content {
        gap: 10px;
    }

    body.enterprise-theme .header-subtitle,
    body.enterprise-theme .dev-indicators {
        display: none;
    }

    .workspace-hud {
        display: none;
    }

    .status-banner {
        margin-left: 10px;
        margin-right: 10px;
        font-size: 12px;
        max-width: calc(100% - 20px);
    }

    body.enterprise-theme .input-panel:hover,
    body.enterprise-theme .output-panel:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    body.enterprise-theme .dev-scanlines,
    body.enterprise-theme .dev-chip {
        animation: none !important;
    }

    .input-panel,
    .output-panel,
    .settings-toggle,
    .dropdown-btn,
    .action-btn {
        transform: none !important;
    }
}