:root {
    --bg-dark: #1e1e1e;
    --editor-bg: #1e293b;
    --header-bg: #334155;
    --accent: #38bdf8;
    --success: #22c55e;
    --error: #ef4444;
    --text-main: #d4d4d4;
    --text-dim: #94a3b8;
    --text-bright: #f1f5f9;
}

* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    margin: 0;
    background: #f5f8fc;
    color: #1f2937;
}

/* HEADER */
.top-bar {
    background: #ffffff;
    padding: 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.header-inner {
    max-width: 1000px;
    margin: auto;
    position: relative;
    text-align: center;
}

.brand-logo {
    height: 46px;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.header-text h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #0B8EDB;
}

.header-text p {
    margin-top: 4px;
    font-size: 14px;
    color: #6b7280;
}

.baalbo-json-pro-container {
    max-width: 1550px;
    margin: 40px auto;
    padding: 0 30px;
}

.error-banner {
    background: #fef2f2;
    border-left: 6px solid var(--error);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 25px;
    display: none;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.error-info {
    display: flex;
    gap: 15px;
    color: #991b1b;
    font-weight: 500;
}

.error-icon {
    width: 20px;
    height: 20px;
    fill: #ef4444;
}

.close-err {
    cursor: pointer;
    border: none;
    background: none;
    font-size: 20px;
    color: #991b1b;
}

/* DESKTOP Workspace */
.json-workspace {
    display: flex;
    gap: 20px;
    height: 600px;
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.editor-panel {
    flex: 1;
    background: var(--editor-bg);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    position: relative;
}

.panel-header {
    background: var(--header-bg);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-bright);
    flex-shrink: 0;
    /* header squeeze nahi hoga */
}

.mini-icon-btn svg {
    width: 16px;
    height: 16px;
    fill: white;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.2s;
}

.mini-icon-btn:hover svg {
    opacity: 1;
    transform: scale(1.1);
}

/* 🚀 FIX 1: Tab switcher overlap fix */
.tab-switcher {
    display: flex;
    background: #1e293b;
    padding: 4px;
    border-radius: 8px;
    gap: 4px;
    position: relative;
    z-index: 10;
    /* tabs upar rahenge */
}

.tab-btn {
    padding: 6px 16px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    /* text wrap nahi hoga */
}

.tab-btn.active {
    background: var(--accent);
    color: white;
}

.editor-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    background: #1e293b;
}

.gutter {
    width: 60px;
    flex-shrink: 0;
    background: #0f172a;
    color: #475569;
    padding: 20px 10px 20px 0;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    line-height: 26px;
    border-right: 1px solid #334155;
    user-select: none;
    overflow: hidden;
}

.textarea-container {
    flex: 1;
    position: relative;
    min-height: 0;
    overflow: hidden;
}

.error-overlay {
    position: absolute;
    left: 0;
    width: 100%;
    height: 26px;
    background: rgba(239, 68, 68, 0.3);
    border-top: 1px solid #ef4444;
    border-bottom: 1px solid #ef4444;
    display: none;
    z-index: 1;
    pointer-events: none;
}

textarea {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100% !important;
    background: transparent !important;
    color: #e2e8f0;
    border: none;
    padding: 20px !important;
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    line-height: 26px;
    resize: none;
    outline: none;
    overflow-y: auto !important;
    overflow-anchor: none;
    white-space: pre;
    z-index: 2;
    pointer-events: auto;
    -webkit-user-select: text;
    user-select: text;
}

/* 🚀 FIX 1: Output textarea placeholder overlap fix */
#jsonOutput {
    z-index: 2;
    position: absolute;
    top: 0;
    left: 50px;
    right: 0;
    bottom: 0;
}

.action-sidebar {
    width: 180px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.act-btn {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.act-btn svg {
    width: 16px;
    height: 16px;
    fill: #475569;
}

.act-btn:hover {
    background: #f1f5f9;
    border-color: var(--accent);
    color: var(--accent);
}

.act-btn:hover svg {
    fill: var(--accent);
}

.btn-prime {
    background: var(--accent) !important;
    color: white !important;
    border: none;
}

.btn-prime svg {
    fill: white !important;
}

.btn-success {
    background: var(--success) !important;
    color: white !important;
    border: none;
}

.btn-success svg {
    fill: white !important;
}

.btn-danger {
    color: var(--error);
    border-color: #fee2e2;
}

.btn-danger svg {
    fill: var(--error);
}

.select-btn {
    width: 100%;
    padding: 10px;
    cursor: pointer;
    outline: none;
}

.divider {
    height: 1px;
    background: #e2e8f0;
    margin: 8px 0;
}

/* 🚀 FIX 1: full-view-panel overflow hidden so placeholder doesn't bleed */
.full-view-panel {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.tree-content {
    padding: 25px;
    color: #bae6fd;
    font-family: monospace;
    overflow: auto;
    width: 100%;
}

.tree-item {
    margin: 6px 0 6px 20px;
    border-left: 1px dashed #475569;
    padding-left: 15px;
}

.tree-key {
    color: var(--accent);
}

.tree-toggle {
    color: var(--error);
    cursor: pointer;
    margin-right: 8px;
    font-weight: bold;
}

.hidden-file {
    display: none !important;
}

/* =========================================
   MOBILE RESPONSIVE - FULLY FIXED
   ========================================= */

@media (max-width: 1024px) {
    .baalbo-json-pro-container {
        padding: 0 10px;
        margin: 10px auto;
    }

    /* 🚀 FIX 2: json-workspace height auto nahi - fixed rahega */
    .json-workspace {
        flex-direction: column;
        height: auto !important;
        gap: 15px;
        padding: 12px;
    }

    /* 🚀 FIX 2: editor-panel ki height FIXED - content ke saath grow nahi karega */
    .editor-panel {
        height: 350px !important;
        min-height: 350px !important;
        max-height: 350px !important;
        /* 🚀 KEY - yahi rokta hai grow karne se */
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .panel-header {
        flex-shrink: 0;
        padding: 10px 12px;
    }

    .editor-body {
        flex: 1;
        min-height: 0;
        display: flex;
        overflow: hidden;
        /* 🚀 content bahar nahi jaayega */
    }

    .gutter {
        width: 38px;
        font-size: 11px;
        padding-top: 12px;
        flex-shrink: 0;
    }

    .textarea-container {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        position: relative;
    }

    /* 🚀 FIX 2: Mobile textarea - fixed height, scroll inside */
    textarea {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        /* grow nahi hoga */
        padding: 12px !important;
        font-size: 13px !important;
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch !important;
        overflow-anchor: none !important;
        pointer-events: auto !important;
        -webkit-user-select: text !important;
        user-select: text !important;
        cursor: text !important;
        transform: none !important;
        resize: none !important;
    }

    .action-sidebar {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        order: 2;
        flex-shrink: 0;
    }

    .act-btn {
        justify-content: center;
        padding: 12px 5px;
        font-size: 12px;
        height: 45px;
    }

    .editor-panel:first-child {
        order: 1;
    }

    .output-panel {
        order: 3;
    }

    .divider {
        display: none;
    }

    .select-btn {
        grid-column: span 2;
    }

    .modal-content {
        width: 92%;
        padding: 20px;
        border-radius: 15px;
    }

    /* Tab fix for mobile */
    .tab-switcher {
        gap: 2px;
    }

    .tab-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .editor-panel {
        height: 300px !important;
        min-height: 300px !important;
        max-height: 300px !important;
    }

    .panel-header {
        font-size: 11px;
        padding: 8px 10px;
    }

    .tab-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    textarea {
        font-size: 12px !important;
    }
}

/* fetch button and modal */
.premium-fetch-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #334155;
    border: 1px solid #475569;
    padding: 6px 12px;
    border-radius: 6px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: 0.3s;
}

.premium-fetch-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    color: #1e293b;
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #64748b;
}

.modal-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: 0.3s;
    margin-top: 10px;
}

.modal-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.hidden {
    display: none !important;
}

.seo-modern-wrapper {
    background: #fff;
    padding: 80px 20px;
    color: #374151;
    line-height: 1.8;
}

.container {
    max-width: 1000px;
    margin: auto;
}

.long-content h2 {
    font-size: 28px;
    color: #111827;
    margin-bottom: 20px;
}

.info-card {
    background: linear-gradient(135deg, #0B8EDB, #2563eb);
    color: #fff;
    padding: 30px;
    border-radius: 20px;
    margin: 30px 0;
}

.faq-item {
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 18px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    color: #1f2937;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: 0.3s ease-out;
    padding: 0 18px;
    font-size: 14px;
    color: #6b7280;
}

.faq-answer.open {
    max-height: 500px;
    padding-bottom: 18px;
}

.related-tools-premium {
    padding: 60px 15px;
    background: #ffffff;
    margin: 20px auto;
    max-width: 1200px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.p-tool-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    border: 1px solid #eef2f6;
    transition: 0.3s;
}

.p-tool-card:hover {
    transform: translateY(-8px);
    border-color: #0B8EDB;
    box-shadow: 0 15px 30px rgba(11, 142, 219, 0.12);
}

.tool-icon-wrapper {
    font-size: 22px;
    margin-bottom: 10px;
}

.tool-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.related-blogs {
    background: #ffffff;
    padding: 60px 16px;
    border-top: 1px solid #e5e7eb;
}

.related-blogs-inner {
    max-width: 1100px;
    margin: auto;
    text-align: center;
}

.related-blogs h2 {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.related-subtitle {
    font-size: 15px;
    color: #6b7280;
    max-width: 620px;
    margin: 0 auto 40px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

.blog-card {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-align: left;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
}

.blog-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.blog-content {
    padding: 18px 18px 22px;
}

.blog-date {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.blog-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 6px 0 10px;
    line-height: 1.4;
}

.blog-excerpt {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 18px;
}

.blog-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #0B8EDB, #2563eb);
    color: #ffffff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-readmore:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.35);
}

@media (max-width: 640px) {
    .related-blogs {
        padding: 40px 14px;
    }

    .related-blogs h2 {
        font-size: 22px;
    }

    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .brand-logo {
        position: static;
        transform: none;
        margin-bottom: 12px;
    }
}

.footer {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 28px 12px;
    text-align: center;
}

.footer-links a {
    color: #0B8EDB;
    text-decoration: none;
    font-weight: 500;
}

.footer-copy {
    font-size: 12px;
    color: #6b7280;
}