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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #F5F7FA;
    min-height: 100vh;
    padding: 24px 24px 24px 10px;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    overflow: visible;
}

.tree-panel {
    width: 40%;
    background: #FAFAFA;
    padding: 32px;
    overflow-y: auto;
}

.editor-panel {
    width: 60%;
    padding: 32px;
    background: #FFFFFF;
    overflow-y: auto;
}

.global-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #285187;
    color: #FFFFFF;
}

.btn-success {
    background: #34C759;
    color: #FFFFFF;
}

.btn-danger {
    background: #FF3B30;
    color: #FFFFFF;
}

.btn-info {
    background: #5C5C66;
    color: #FFFFFF;
}

.btn-secondary {
    background: #E0E0E6;
    color: #333333;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tree-container {
    background: #FAFAFA;
    display: marker;
    width: 577px;
}

.tree-node {
    position: relative;
}

.tree-node.expanded > .tree-children {
    display: block;
}

.tree-node.collapsed > .tree-children {
    display: marker;
}

.node-header {
    padding: 5px 16px 4px 0px;
    background: #E1E1E1;
    border: 1px solid #E0E0E6;
    border-radius: 8px;
    margin: 8px -26px -7px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.node-header:hover {
    background: #F5F7FA;
    border-color: #1A73E8;
}

.node-header.root {
    background: #BCBCBD;
    color: #FFFFFF;
    border-color: #1A73E8;
}

.node-header.menu {
    background: #3C4043;
    color: #FFFFFF;
    border-color: #3C4043;
}

.node-header.submenu {
    background: #5C5C66;
    color: #FFFFFF;
    border-color: #5C5C66;
}

.node-header[draggable="true"]:hover {
    cursor: move;
    background: #E0E0E6;
}

.node-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toggle-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.200);
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.node-title {
    font-weight: 500;
    font-size: 15px;
}

.node-type {
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.node-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-btn:hover {
    transform: translateY(-1px);
}

.tree-children {
    margin-left: 0px;
    border-left: 2px dashed #D0D0D6;
    padding-left: 16px;
}

.form-container {
    background: #FFFFFF;
    border: 1px solid #E0E0E6;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.form-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #666666;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #333333;
}

.form-body {
    display: grid;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: row;
    gap: 8px;
    /*+placement: -9px -4px;*/
    position: relative;
    left: -9px;
    top: -4px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    width: 214px;
    padding-top: 9px;
    text-align: right;
    padding-right: 7px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #D0D0D6;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #1A73E8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.form-footer {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.modal {
    display: marker;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.main-content-wrapper {
    display: flex;
    gap: 24px;
    /* Jarak antara panel kiri dan kanan */
    padding: 0;
    /* Padding sudah diatur di .tree-container dan .right-form-panel */
    overflow: visible;
}

.left-panel {
    flex: 1;
    /* Panel kiri mengambil sebagian ruang */
    min-width: 574px;
    /* Lebar minimum untuk tree */
    max-height: calc(100vh - 150px);
    /* Sesuaikan dengan tinggi header dan padding body */
    overflow-y: auto;
    background: #FAFAFA;
    /* Background tree-container */
    padding: 32px 32px 32px 0px;
    /* Padding tree-container */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.right-form-panel {
    flex: 1.5;
    /* Panel kanan mengambil lebih banyak ruang */
    min-width: 500px;
    /* Lebar minimum untuk form */
    max-height: calc(100vh - 150px);
    /* Sama dengan panel kiri */
    overflow-y: auto;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 20px;
    /* Padding internal untuk form */
    overflow: visible;
}

.right-form-panel .form-container {
    /* Hapus margin dan shadow jika sudah diatur di parent */
    margin: 0;
    box-shadow: none;
    border: none;
}

.right-form-panel .form-header {
    position: sticky;
    top: -20px;
    /* Menyesuaikan dengan padding parent */
    background: #FFFFFF;
    z-index: 10;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* Styling untuk input group di form */
.link-group,
.option-group {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.link-group input,
.option-group input {
    flex-grow: 1;
}

.link-group button,
.option-group button {
    flex-shrink: 0;
}

.checkbox-label {
    margin-right: 15px;
}

.checkbox-right {
    margin-left: 10px;
    margin-top: 5px;
    margin-right: 7px;
}

.node-type-badge {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-left: 2px;
    display: normal;
}

.node-type-badge.field {
    background-color: rgba(26, 115, 232, 0.1);
    color: #1A73E8;
}

.node-header.config-node .node-title,
.node-header.config-node .node-type-badge {
    color: #000000;
    /* Agar kontras dengan background gelap config */
}

.node-header.config-node .toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #FFF;
}

.node-header.config-node .toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.node-header.field-node {
    /* Styling khusus untuk field node jika diperlukan */
    background: #E8F0FE;
    /* Light blue background for fields */
    border-color: #D2E3FC;
}

.node-header.field-node:hover {
    background: #D2E3FC;
    border-color: #1A73E8;
}

.node-header.field-node .node-title {
    color: #174EA6;
}

.node-header.menu-level1 {
    /* Kelas untuk node-header level 1 */
    background: #F5F7FA;
    /* Warna default tree.css untuk node-header:hover */
}

.node-header.menu-level1:hover {
    background: #E8E8ED;
}

.json-editor-area {
    border-top: 2px solid #EEE;
    margin-top: 20px;
    padding-top: 15px;
}

.json-editor-area textarea {
    width: 100%;
    min-height: 250px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.5;
    padding: 10px;
    border: 1px solid #CCC;
    border-radius: 4px;
    background-color: #FDFDFD;
}

.json-editor-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: flex-end;
}

textarea.json-output {
    width: 575px;
}
