* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f4f4;
    padding: 20px;
    margin: 0;
    transition: background 0.2s ease, color 0.2s;
}

/* main flex row: left column + right column */
.container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

/* Left column (input area) */
.col-left {
    flex: 1.1;
    min-width: 280px;
    background: transparent;
}

/* Right column (JSON viewer tree) */
.col-right {
    flex: 1.2;
    min-width: 320px;
    background: transparent;
}

h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1.7rem;
    letter-spacing: -0.2px;
    color: #1e2a3a;
}

/* Toolbar row */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    align-items: center;
}

.toolbar input, 
.toolbar button {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid #ccc;
    background: white;
    transition: all 0.2s;
}


.toolbar input {
    flex: 1 1 160px;
    min-width: 130px;
}

.toolbar button {
    padding: 6px 8px;
    border-radius: 5px;
    background: #1976d2;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 400;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.toolbar button:hover {
    background: #0b5aa9;
    transform: translateY(-1px);
}

/* Drop zone */
#dropZone {
    border: 2px dashed #8c9eff;
    background: #fef9e8;
    padding: 18px 12px;
    text-align: center;
    margin-bottom: 18px;
    border-radius: 14px;
    font-weight: 500;
    color: #3c4b64;
    transition: background 0.2s;
    cursor: grab;
}

#dropZone:active {
    cursor: grabbing;
}

textarea {
    width: 100%;
    height: 180px;
    padding: 16px;
    border-radius: 5px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 18px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.02);
}

#errorBox {
    color: #d32f2f;
    background: #ffeaea;
    padding: 12px 16px;
    border-radius: 14px;
    margin-bottom: 12px;
    font-weight: 500;
    font-size: 0.85rem;
    display: none;
}

#errorBox.show {
    display: block;
}

/* JSON viewer panel (right side) */
.json-container {
    background: #1e1e2f;
    color: #eef2ff;
    padding: 20px 18px;
    border-radius: 5px;
    overflow: auto;
    max-height: 75vh;
    min-height: 450px;
    box-shadow: 0 12px 24px -8px rgba(0,0,0,0.2);
    transition: background 0.2s, color 0.2s;
    font-size: 14px;
}

/* Tree styles */
.json-container ul {
    list-style: none;
    padding-left: 24px;
    margin: 4px 0 6px 0;
    border-left: 1px dotted rgba(255,255,255,0.2);
}

.json-container li {
    margin: 6px 0;
    line-height: 1.45;
    word-break: break-word;
}

.toggle {
    cursor: pointer;
    color: #7aa2f7;
    font-weight: bold;
    font-size: 13px;
    background: rgba(255,255,255,0.05);
    display: inline-block;
    width: 24px;
    text-align: center;
    border-radius: 12px;
    margin-right: 6px;
    user-select: none;
}

.toggle:hover {
    background: #3b426b;
}

.key {
    color: #ffb86c;
    font-weight: 500;
    margin-right: 6px;
}

.string {
    color: #9ece6a;
}

.number {
    color: #73d0ff;
}

.boolean {
    color: #f7768e;
}

.null {
    color: #bb9af7;
    font-style: italic;
}

.path {
    color: #7f8c9a;
    font-size: 10px;
    margin-left: 12px;
    background: rgba(0,0,0,0.3);
    padding: 2px 6px;
    border-radius: 20px;
    white-space: nowrap;
}

.hidden {
    display: none;
}

/* LIGHT THEME (only affects viewer + body) */
body.light-theme {
    background: #eef2f5;
}

body.light-theme .json-container {
    background: #ffffff;
    color: #1e293b;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

body.light-theme .json-container ul {
    border-left-color: #d4d8e6;
}

body.light-theme .key {
    color: #c4450c;
}

body.light-theme .string {
    color: #2c7a4d;
}

body.light-theme .number {
    color: #1e88e5;
}

body.light-theme .boolean {
    color: #c2185b;
}

body.light-theme .null {
    color: #8e44ad;
}

body.light-theme .path {
    background: #eef2ff;
    color: #5b6e8c;
}

body.light-theme .toggle {
    color: #0f6e9e;
    background: #eef0fa;
}

body.light-theme textarea {
    background: #fff;
    border-color: #b9c3d4;
}


/* FOOTER SECTION - new design */
.footer {
    margin-top: 40px;
    padding: 20px 24px;
    background: #ffffffcc;
    backdrop-filter: blur(4px);
    border-radius: 8px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    font-size: 0.85rem;
    color: #2c3e4e;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.02);
    transition: all 0.2s;
    font-weight: 500;
}

body.light-theme .footer {
    background: #f8fafcee;
    border-top-color: #cbd5e1;
    color: #1e293b;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.footer-stats {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-badge {
    background: #eef2ff;
    padding: 6px 14px;
    border-radius: 40px;
    font-family: monospace;
    font-size: 0.8rem;
    color: #1e40af;
}

body.light-theme .stat-badge {
    background: #e6edf5;
    color: #0c4a6e;
}

.footer-credit {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-credit a {
    color: #1976d2;
    text-decoration: none;
    transition: 0.2s;
}

.footer-credit a:hover {
    text-decoration: underline;
    color: #0b5aa9;
}

.heart {
    color: #e53e3e;
    display: inline-block;
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef2ff;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
}

.dot {
    width: 9px;
    height: 9px;
    background-color: #2ecc71;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 3px #2ecc71;
}

    /* Responsive footer */
    @media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    .footer-stats {
        justify-content: center;
    }
}

/* Responsive */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }
    .col-left, .col-right {
        width: 100%;
    }
    .toolbar button, .toolbar input {
        font-size: 0.8rem;
    }
}
