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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 15px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--gray);
    max-width: 800px;
    margin: 0 auto 20px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.feature-item {
    background: var(--light);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.feature-item i {
    margin-right: 10px;
    color: var(--primary);
    font-size: 1.2rem;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.panel:hover {
    transform: translateY(-5px);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-gray);
}

.panel-title {
    font-size: 1.5rem;
    color: var(--dark);
    display: flex;
    align-items: center;
}

.panel-title i {
    margin-right: 10px;
    color: var(--primary);
}

.panel-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: var(--light);
    color: var(--gray);
}

.btn-secondary:hover {
    background: var(--light-gray);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

.btn-success:hover {
    background: #3aafd9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

.btn-danger:hover {
    background: #d11a6f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.9rem;
}

textarea {
    width: 100%;
    min-height: 350px;
    padding: 20px;
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1rem;
    resize: vertical;
    line-height: 1.5;
    background: var(--light);
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.options {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.option-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

select,
input[type="number"] {
    padding: 10px;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
}

select:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-toggle {
    display: flex;
    margin-bottom: 20px;
    background: var(--light);
    border-radius: 8px;
    padding: 5px;
    width: fit-content;
}

.view-toggle-btn {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    background: transparent;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.view-toggle-btn.active {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: var(--primary);
}

.search-container {
    display: flex;
    margin-bottom: 20px;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

.result {
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.result.success {
    background: rgba(76, 201, 240, 0.2);
    color: #155724;
    border-left: 4px solid var(--success);
}

.result.error {
    background: rgba(247, 37, 133, 0.15);
    color: #721c24;
    border-left: 4px solid var(--danger);
}

.json-tree {
    padding: 20px;
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    background: var(--light);
    min-height: 350px;
    overflow: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    line-height: 1.5;
    /* display: none; */
}

.tree-node {
    margin-left: 20px;
}

.toggle {
    cursor: pointer;
    margin-right: 5px;
    width: 14px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.toggle.collapsed {
    transform: rotate(-90deg);
}

.key {
    color: #905;
    font-weight: bold;
}

.string {
    color: #690;
}

.number {
    color: #905;
}

.boolean {
    color: #07a;
}

.null {
    color: #07a;
}

.highlight {
    background-color: yellow;
    font-weight: bold;
    padding: 0 2px;
    border-radius: 3px;
}

.syntax-string {
    color: #690;
}

.syntax-number {
    color: #905;
}

.syntax-boolean {
    color: #07a;
}

.syntax-null {
    color: #07a;
}

.syntax-key {
    color: #905;
    font-weight: bold;
}

.formatted-json {
    white-space: pre-wrap;
    font-family: 'Consolas', 'Monaco', monospace;
    padding: 20px;
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    background: var(--light);
    min-height: 350px;
    overflow: auto;
    line-height: 1.5;
}

.file-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.file-input {
    padding: 10px;
    border: 1px dashed var(--primary);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input:hover {
    background: rgba(67, 97, 238, 0.1);
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: var(--gray);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .panel-actions {
        width: 100%;
        justify-content: space-between;
    }

    .options {
        flex-direction: column;
        gap: 15px;
    }

    .search-container {
        flex-direction: column;
    }
}

#json-output,
#json-tree-view {
    max-height: 70vh;
    /* adjust height as per layout */
    overflow-y: auto;
    /* vertical scroll only */
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}
