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

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --text-light: #333;
    --text-dark: #0d0d0e;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    background-color: #fff;
    transition: background-color 0.3s ease;
}

body.dark-mode {
    background-color: var(--dark-bg);
    color: #e0e0e0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background-color: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
    overflow-x: visible;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    white-space: nowrap;
}

.nav-links li {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 40px;
    padding: 6px 10px;
    color: var(--text-light);
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.nav-links a,
.dropdown-toggle {
    text-decoration: none;
    color: var(--text-light);
}

.nav-links a:hover,
.nav-links a.active,
.dropdown-toggle:hover {
    color: var(--primary-color);
}

.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    min-width: 180px;
    margin-right: 8px;
    padding: 10px 0;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    z-index: 1000;
}

body.dark-mode .dropdown-menu {
    background-color: #2d2d2d;
    border-color: #444;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--text-light);
}

.dropdown-menu a:hover {
    background-color: var(--light-bg);
}

body.dark-mode .dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.logo a {
    text-decoration: none;
    color: var(--primary-color);
}

/* Primary CTA button in nav — outlined, fills on hover */
.nav-cta {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    background: transparent;
    color: var(--primary-color) !important;
    border: 1.5px solid var(--primary-color);
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    text-decoration: none !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-cta:hover {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

/* Active state on dropdown toggle when current page is inside that category */
.dropdown-toggle.active {
    color: var(--primary-color) !important;
}

body.dark-mode .nav-cta {
    color: #66b2ff !important;
    border-color: #66b2ff;
}

body.dark-mode .nav-cta:hover {
    background-color: #66b2ff !important;
    color: #1a1a1a !important;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.feature-link {
    display: inline-block;
    margin-top: 16px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

.feature-link:hover {
    text-decoration: underline;
}

.theme-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.theme-btn:hover {
    background-color: var(--light-bg);
}

body.dark-mode .navbar {
    background-color: var(--dark-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .nav-links a,
body.dark-mode .dropdown-toggle,
body.dark-mode .theme-btn {
    color: #f5f5f5 !important;
}

body.dark-mode .dropdown-toggle:hover {
    color: var(--primary-color) !important;
}

body.dark-mode .theme-btn {
    color: #f5f5f5 !important;
    background: #232323;
    border: 1px solid #444;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

/* Header */
.header {
    background: linear-gradient(150deg, #2e93f5, #0d5cbf);
    color: white;
    padding: 52px 20px;
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 42px;
    margin-bottom: 10px;
}

.header p {
    font-size: 18px;
    opacity: 0.95;
}

.header.header-compact {
    padding: 18px 20px;
    margin-bottom: 24px;
}
.header.header-compact h1 {
    font-size: 26px;
    margin-bottom: 4px;
}
.header.header-compact p {
    font-size: 15px;
    opacity: 0.90;
}

/* Editor Container */
.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.editor-input,
.editor-output {
    display: flex;
    flex-direction: column;
}

.editor-input label,
.editor-output label {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
}

textarea {
    flex: 1;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    resize: none;
    min-height: 400px;
    background-color: #fff;
    color: var(--text-light);
}

body.dark-mode textarea {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border-color: #444;
}

textarea:focus,
input[type="text"]:focus,
input[type="datetime-local"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

input[type="text"],
input[type="datetime-local"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    background-color: #fff;
    color: var(--text-light);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.dark-mode input[type="text"],
body.dark-mode input[type="datetime-local"] {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border-color: #444;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.4;
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 123, 255, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #fff;
    color: #444;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--light-bg);
    border-color: #bbb;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary:active {
    transform: translateY(0);
}

body.dark-mode .btn-secondary {
    background-color: #3a3a3a;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode .btn-secondary:hover {
    background-color: #4a4a4a;
    border-color: #666;
}

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

.formatter-section {
    background-color: var(--light-bg);
    padding: 30px;
    border-radius: 18px;
    box-shadow: var(--shadow);
    margin: 30px 0;
}

body.dark-mode .formatter-section {
    background-color: #232323;
}

.info-section {
    background-color: rgba(0, 123, 255, 0.08);
    padding: 24px;
    border-left: 4px solid var(--primary-color);
    border-radius: 12px;
    margin-top: 40px;
}

body.dark-mode .info-section {
    background-color: rgba(0, 123, 255, 0.16);
}

.info-section h3 {
    margin-bottom: 14px;
}

.info-section p,
.info-section ul,
.info-section span {
    font-size: 15px;
    line-height: 1.75;
}

.info-section ul {
    margin-top: 12px;
    margin-bottom: 16px;
    padding-left: 20px;
}

.info-section li {
    margin-bottom: 8px;
}

.info-section strong {
    color: var(--primary-color);
}

/* Error Container */
.error-container {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

body.dark-mode .error-container {
    background-color: #3d1f1f;
    border-color: #5a2929;
    color: #f8d7da;
}

/* Features Section */
.features {
    margin: 60px 0;
}

.features h2 {
    font-size: 32px;
    margin-bottom: 40px;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: var(--light-bg);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body.dark-mode .feature-card {
    background-color: #2d2d2d;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--secondary-color);
    font-size: 14px;
}

.tool-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 10px;
    background: rgba(74, 144, 226, 0.12);
    color: var(--primary-color);
}

body.dark-mode .tool-category {
    background: rgba(74, 144, 226, 0.18);
    color: #7eb8f7;
}

/* Blog Section */
.blog-preview {
    margin: 60px 0;
}

.blog-preview h2 {
    font-size: 32px;
    margin-bottom: 40px;
    text-align: center;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.blog-card {
    background-color: var(--light-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.blog-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body.dark-mode .blog-card {
    background-color: #2d2d2d;
}

.blog-card h3 {
    margin-bottom: 10px;
}

.blog-card p {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 14px;
}

.blog-card a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.blog-card a:hover {
    color: #0056b3;
}

/* Ad Space */
.ad-space {
    margin: 30px 0;
    padding: 20px;
    background-color: var(--light-bg);
    border-radius: 6px;
    text-align: center;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-mode .ad-space {
    background-color: #2d2d2d;
}

/* Footer */
.footer {
    background-color: var(--dark-bg);
    color: #aaa;
    padding: 40px 20px;
    text-align: center;
    margin-top: 60px;
}

.footer p {
    margin: 10px 0;
    font-size: 14px;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Hamburger menu button */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 8px 10px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    margin: 0;
    line-height: 1;
    order: 2;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text-light);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

body.dark-mode .nav-hamburger span {
    background-color: #e0e0e0;
}

.nav-hamburger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.is-open span:nth-child(2) {
    opacity: 0;
}
.nav-hamburger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0;
    }

    .nav-actions {
        flex-wrap: wrap;
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    .nav-hamburger {
        display: flex;
        order: 1;
    }

    .theme-btn {
        order: 2;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        order: 3;
        padding: 8px 0 4px;
        border-top: 1px solid var(--border-color);
        margin-top: 8px;
    }

    .nav-links.nav-open {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 10px 4px;
        font-size: 15px;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-dropdown {
        margin-left: 0;
        width: 100%;
    }

    .dropdown-toggle {
        width: 100%;
        justify-content: flex-start;
        border: none;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
        padding: 10px 4px;
        font-size: 15px;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0 0 0 16px;
    }

    .editor-container {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 28px;
    }

    .header p {
        font-size: 16px;
    }

    textarea {
        min-height: 300px;
    }

    .button-group {
        gap: 8px;
    }

    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* Drag-and-drop upload */
.drag-over {
    border: 2px dashed var(--primary-color) !important;
    background-color: rgba(0, 123, 255, 0.05) !important;
    outline: none;
}

body.dark-mode .drag-over {
    background-color: rgba(0, 123, 255, 0.12) !important;
}

/* CodeMirror 6 editor containers */
#cmInputEditor,
#cmOutputEditor {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    min-height: 400px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#cmInputEditor .cm-editor,
#cmOutputEditor .cm-editor {
    min-height: 400px;
    outline: none;
}

/* Soft panel-level glow instead of the harsh internal blue line */
#cmInputEditor:focus-within {
    border-color: rgba(13, 92, 191, 0.55);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.12);
}

#cmInputEditor .cm-editor.cm-focused,
#cmOutputEditor .cm-editor.cm-focused {
    outline: none;
}

body.dark-mode #cmInputEditor,
body.dark-mode #cmOutputEditor {
    border-color: #444;
}

body.dark-mode #cmInputEditor:focus-within {
    border-color: rgba(102, 178, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(102, 178, 255, 0.1);
}

/* When inside a panel: panel border handles focus, remove standalone styling */
.csv-input-panel #cmInputEditor,
.csv-input-panel #cmOutputEditor {
    border: none;
    border-radius: 0;
    box-shadow: none !important;
    flex: 1;
    min-height: 360px;
}

/* Syntax-Highlighted Output */
.output-pre {
    flex: 1;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    min-height: 400px;
    background-color: #fff;
    color: var(--text-light);
    overflow: auto;
    white-space: pre;
    word-break: normal;
    tab-size: 2;
    margin: 0;
}

body.dark-mode .output-pre {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-color: #444;
}

.output-placeholder {
    color: #999;
    font-style: italic;
}

.json-key    { color: #d73a49; }
.json-string { color: #032f62; }
.json-number { color: #005a9c; }
.json-boolean { color: #d73a49; }
.json-null   { color: #6f42c1; font-style: italic; }

body.dark-mode .json-key    { color: #f97583; }
body.dark-mode .json-string { color: #9ecbff; }
body.dark-mode .json-number { color: #79b8ff; }
body.dark-mode .json-boolean { color: #f97583; }
body.dark-mode .json-null   { color: #b392f0; }

/* JSON Tree Viewer Styles */
.tree-viewer-section {
    margin-top: 40px;
    margin-bottom: 20px;
}

.tree-viewer-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.tree-viewer-container {
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    max-height: 600px;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

body.dark-mode .tree-viewer-container {
    background-color: #1e1e1e;
    border-color: #444;
}

.json-tree {
    user-select: none;
}

.tree-node {
    margin-left: 0;
}

.tree-content {
    padding: 4px 0;
}

.tree-header {
    display: flex;
    align-items: center;
    cursor: default;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.tree-header:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

body.dark-mode .tree-header:hover {
    background-color: rgba(0, 123, 255, 0.2);
}

.tree-toggle {
    display: inline-block;
    width: 16px;
    cursor: pointer;
    font-size: 10px;
    color: var(--secondary-color);
    margin-right: 4px;
    user-select: none;
}

.tree-space {
    display: inline-block;
    width: 16px;
    margin-right: 4px;
}

.tree-key {
    color: #d73a49;
    font-weight: 500;
}

body.dark-mode .tree-key {
    color: #f97583;
}

.tree-key.tree-copyable:hover {
    background-color: rgba(0, 123, 255, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.tree-colon {
    color: var(--text-light);
    margin: 0 4px;
}

body.dark-mode .tree-colon {
    color: #e0e0e0;
}

.tree-value {
    font-weight: 500;
}

.tree-value.tree-string {
    color: #032f62;
}

body.dark-mode .tree-value.tree-string {
    color: #85e89d;
}

.tree-value.tree-number {
    color: #005a9c;
}

body.dark-mode .tree-value.tree-number {
    color: #79b8ff;
}

.tree-value.tree-boolean {
    color: #d73a49;
}

body.dark-mode .tree-value.tree-boolean {
    color: #f97583;
}

.tree-value.tree-null {
    color: #8b949e;
    font-style: italic;
}

body.dark-mode .tree-value.tree-null {
    color: #8b949e;
}

.tree-value.tree-copyable:hover {
    background-color: rgba(0, 123, 255, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.tree-summary {
    color: var(--secondary-color);
    font-size: 12px;
    font-style: italic;
}

.tree-body {
    padding-left: 20px;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    margin-left: 8px;
}

body.dark-mode .tree-body {
    border-left-color: rgba(255, 255, 255, 0.1);
}

.tree-error {
    color: var(--danger-color);
    font-style: italic;
    padding: 10px;
    text-align: center;
}

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

.tree-placeholder {
    color: var(--secondary-color);
    text-align: center;
    padding: 40px 20px;
    font-style: italic;
}

body.dark-mode .tree-placeholder {
    color: #8b949e;
}

/* Copy Message Toast */
.tree-copy-message {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Tree Viewer */
@media (max-width: 768px) {
    .tree-viewer-container {
        max-height: 400px;
    }

    .tree-body {
        padding-left: 12px;
    }
}

@media (max-width: 480px) {
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .nav-links a {
        display: block;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .tree-viewer-container {
        max-height: 300px;
        font-size: 12px;
    }

    .tree-body {
        padding-left: 10px;
    }
}

/* Improved spacing for input fields */
input[type="text"], input[type="number"], input[type="email"], textarea, select {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
}

button {
    font-family: inherit;
    cursor: pointer;
}

form > *:not(:last-child) {
    margin-bottom: 16px;
}

/* Remove bullets from dropdown menu */
.dropdown-menu {
    list-style: none;
    padding-left: 0;
}

/* Benefits bar (homepage hub) */
.benefits-section {
    margin: 32px 0 8px;
}

.benefits-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    list-style: none;
    padding: 16px 20px;
    background-color: var(--light-bg);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
}

.benefits-list li::before {
    content: "✓ ";
    color: var(--success-color);
}

body.dark-mode .benefits-list {
    background-color: #232323;
    color: #e0e0e0;
}

/* Blog section modern UI */
.blog-section {
    margin: 48px 0 0 0;
    padding: 32px 0;
    background: #f8f9fb;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.04);
}

.blog-section h2 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--primary-color);
    letter-spacing: -1px;
}

.blog-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px;
    margin: 0;
    padding: 0;
}

.blog-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 24px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow 0.2s;
    border: 1px solid #ececec;
}

.blog-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.10);
    border-color: var(--primary-color);
}

.blog-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--primary-color);
}

.blog-card p {
    color: #444;
    font-size: 1rem;
    margin: 0 0 8px 0;
}

.blog-card a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 500;
    margin-top: auto;
    align-self: flex-start;
    transition: color 0.2s;
}

.blog-card a:hover {
    color: #0a5a9c;
}

/* High-contrast theme toggle button for light mode */
.theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    color: var(--text-light) !important;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 14px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

body.dark-mode .theme-btn {
    color: #fff !important;
    background: #232323;
    border: 1px solid #444;
    border-radius: 6px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

.nav-links {
    align-items: center;
}

.nav-dropdown {
    margin-left: 8px;
}

/* URL Fetcher */
.url-fetcher {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.url-fetcher input[type="url"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background-color: var(--light-bg);
    color: var(--text-light);
}

body.dark-mode .url-fetcher input[type="url"] {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border-color: #555;
}

/* Sort Keys label styled as a button */
.sort-keys-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.sort-keys-label input[type="checkbox"] {
    cursor: pointer;
    width: 14px;
    height: 14px;
}

/* Share link container input */
#shareUrl {
    background-color: var(--light-bg);
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

body.dark-mode #shareUrl {
    background-color: #2d2d2d;
    color: #e0e0e0;
    border-color: #555;
}

/* JSON→CSV table preview */
.csv-table-preview {
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.csv-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
}

.csv-table-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.csv-table-stats {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.csv-table-scroll {
    overflow-x: auto;
    max-height: 380px;
    overflow-y: auto;
}

.csv-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}

.csv-preview-table thead th {
    background: var(--light-bg);
    padding: 0.45rem 0.75rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.csv-preview-table tbody td {
    padding: 0.35rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.csv-preview-table tbody tr:nth-child(even) {
    background: var(--light-bg);
}

body.dark-mode .csv-table-preview {
    border-color: #444;
}

body.dark-mode .csv-table-header {
    background: #2a2a2a;
    border-color: #444;
}

body.dark-mode .csv-preview-table thead th {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .csv-preview-table tbody td {
    border-color: #333;
    color: #e0e0e0;
}

body.dark-mode .csv-preview-table tbody tr:nth-child(even) {
    background: #252525;
}

/* JSON→CSV input panel — also used by formatter & validator input/output */
.csv-input-panel {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    flex: 1;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.csv-input-panel:focus-within {
    border-color: rgba(13, 92, 191, 0.55);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.12);
}

body.dark-mode .csv-input-panel:focus-within {
    border-color: rgba(102, 178, 255, 0.45);
    box-shadow: 0 0 0 3px rgba(102, 178, 255, 0.1);
}

.csv-input-panel .output-pre {
    border: none;
    border-radius: 0;
    margin: 0;
    flex: 1;
}

.csv-input-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    min-height: 50px;
    box-sizing: border-box;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
}

.csv-input-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-light);
}

.csv-input-hint {
    font-weight: 400;
    color: var(--secondary-color);
    font-size: 12px;
}

.csv-input-panel textarea {
    border: none;
    border-radius: 0;
    min-height: 360px;
    flex: 1;
}

.csv-input-panel textarea:focus {
    outline: none;
    box-shadow: none;
}

/* File upload button — ghost style, low visual weight */
.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    background: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    user-select: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
    line-height: 1;
}

.file-upload-btn svg {
    flex-shrink: 0;
}

.file-upload-btn:hover {
    background: var(--light-bg);
    color: var(--text-light);
    border-color: #b0b8c4;
}

body.dark-mode .csv-input-header {
    background: #2a2a2a;
    border-color: #444;
}

body.dark-mode .csv-input-label {
    color: #c5cdd8;
}

body.dark-mode .csv-input-hint {
    color: #6b7a8d;
}

body.dark-mode .csv-input-panel {
    border-color: #444;
}

body.dark-mode .file-upload-btn {
    background: transparent;
    color: #6b7a8d;
    border-color: #3a3a3a;
}

body.dark-mode .file-upload-btn:hover {
    background: #252525;
    color: #b0bac8;
    border-color: #555;
}

/* Keyboard shortcut hint */
kbd {
    display: inline-block;
    padding: 1px 5px;
    font-family: monospace;
    font-size: 0.85em;
    background: #f1f3f5;
    border: 1px solid #ccc;
    border-radius: 3px;
}

body.dark-mode kbd {
    background: #2d2d2d;
    border-color: #555;
    color: #e0e0e0;
}

/* Toast notification */
#toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #323232;
    color: #fff;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 0.9rem;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#toast.toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#toast.toast-hide {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
}
