/* JSON Beautifier Styles */
.beautifier-interface {
    margin: 2rem 0;
}

.beautifier-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.beautifier-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.toolbar-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

.toolbar-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.label-text {
    font-weight: 500;
    white-space: nowrap;
}

.toolbar-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    font-size: 14px;
    color: #111827;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 100px;
}

.toolbar-select:hover {
    border-color: #9ca3af;
}

.toolbar-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.toolbar-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.checkbox-label {
    font-weight: 400;
    user-select: none;
}

.toolbar-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-toolbar:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

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

.btn-toolbar svg {
    flex-shrink: 0;
}

.beautifier-main {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    min-height: 500px;
}

.beautifier-panel {
    display: flex;
    flex-direction: column;
    background: #ffffff;
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #fafafa;
    border-bottom: 1px solid #e5e7eb;
}

.panel-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.panel-badge {
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.panel-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.panel-badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f3f4f6;
    color: #111827;
}

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

.editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 400px;
}

.editor-container {
    flex: 1;
    min-height: 500px;
}

.editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: #fafafa;
    border-top: 1px solid #e5e7eb;
    font-size: 12px;
    color: #6b7280;
}

.editor-info {
    font-size: 12px;
    color: #6b7280;
}

.beautifier-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    background: #f9fafb;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    position: relative;
}

.divider-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.divider-toggle:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: scale(1.1);
}

.divider-toggle:active {
    transform: scale(0.95);
}

.beautifier-tree {
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tree-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #fafafa;
    border-bottom: 1px solid #e5e7eb;
}

.tree-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.tree-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    font-size: 13px;
    line-height: 1.6;
    color: #111827;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .beautifier-main {
        grid-template-columns: 1fr;
    }

    .beautifier-input {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .beautifier-divider {
        width: 100%;
        height: 48px;
        border-left: none;
        border-right: none;
        border-top: 1px solid #e5e7eb;
        border-bottom: 1px solid #e5e7eb;
    }

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

@media (max-width: 768px) {
    .beautifier-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }

    .toolbar-group {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .toolbar-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .toolbar-select {
        width: 100%;
    }

    .toolbar-actions {
        width: 100%;
        justify-content: stretch;
    }

    .btn-toolbar {
        flex: 1;
        justify-content: center;
    }

    .panel-header {
        padding: 0.875rem 1rem;
    }

    .panel-title {
        font-size: 14px;
    }

    .editor-container {
        min-height: 300px;
    }

    .editor-footer {
        padding: 0.625rem 1rem;
    }
}

@media (max-width: 480px) {
    .beautifier-card {
        border-radius: 12px;
    }

    .beautifier-toolbar {
        padding: 0.875rem;
    }

    .panel-header {
        padding: 0.75rem;
    }

    .editor-container {
        min-height: 250px;
    }

    .btn-toolbar span {
        display: none;
    }

    .btn-toolbar {
        width: 44px;
        padding: 0.625rem;
        justify-content: center;
    }
}

/* ACE Editor Customization */
.ace_editor {
    font-size: 14px;
    line-height: 1.6;
}

.ace_gutter {
    background: #fafafa;
    border-right: 1px solid #e5e7eb;
}

.ace_gutter-active-line {
    background: #f3f4f6;
}

.ace_scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f9fafb;
}

.ace_scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.ace_scrollbar::-webkit-scrollbar-track {
    background: #f9fafb;
}

.ace_scrollbar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.ace_scrollbar::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Tree View Styles */
.tree-content {
    font-size: 13px;
    line-height: 1.8;
    color: #111827;
}

.tree-item {
    display: block;
    min-height: 20px;
    position: relative;
    margin: 2px 0;
}

.tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-right: 4px;
    cursor: pointer;
    user-select: none;
    vertical-align: middle;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.tree-toggle:hover {
    background: #f3f4f6;
    border-radius: 3px;
}

.tree-toggle svg {
    color: #6b7280;
    transition: color 0.2s;
}

.tree-toggle:hover svg {
    color: #111827;
}

.tree-node-header {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.tree-node-header:hover {
    background: #f9fafb;
    border-radius: 3px;
    padding: 0 2px;
    margin: 0 -2px;
}

.tree-content-wrapper {
    flex: 1;
    min-width: 0;
}

.tree-children {
    margin-left: 12px;
    border-left: 1px solid #e5e7eb;
    padding-left: 8px;
    margin-top: 2px;
    margin-bottom: 2px;
}

.tree-separator {
    color: #6b7280;
    margin: 0 4px;
}

.tree-bracket {
    color: #6b7280;
    font-weight: 500;
}

.tree-count {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 400;
    margin-left: 4px;
}

.tree-content .json-key {
    color: #0369a1;
    font-weight: 600;
}

.tree-content .json-string {
    color: #059669;
}

.tree-content .json-number {
    color: #dc2626;
}

.tree-content .json-boolean {
    color: #7c3aed;
}

.tree-content .json-null {
    color: #9ca3af;
    font-style: italic;
}

/* Tree view scrollbar */
.tree-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.tree-content::-webkit-scrollbar-track {
    background: #f9fafb;
}

.tree-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.tree-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
