body {
    font-family: sans-serif;
    margin: 20px;
    background-color: #f4f4f4;
    color: #333; /* Default text color */
    line-height: 1.6; /* Improved readability */
}

/* Collapsible Sections Styling */
.collapsible-section {
    border: 1px solid #ccc;
    margin-bottom: 15px;
    background-color: #fff;
    border-radius: 5px;
    overflow: hidden; /* For collapse animation/hiding content */
}
.collapsible-section.collapsed > .collapsible-content {
    max-height: 0 !important; /* Ensure content is hidden */
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
}
.collapsible-section h1, .collapsible-section h2 {
    margin: 0;
    padding: 10px 15px; /* Increased padding */
    background-color: #f0f0f0;
    border-bottom: 1px solid #ccc;
    font-size: 1.1em; /* Slightly larger heading for sections */
}
.collapsible-section h1 .toggle-button,
.collapsible-section h2 .toggle-button {
    background: none;
    border: none;
    font-size: inherit;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    color: #333;
    width: 100%;
    text-align: left;
    display: flex; /* For alignment of icon and text */
    align-items: center;
}
.collapsible-content {
    padding: 15px; /* Increased padding */
    max-height: 400px; /* Default max height, can be overridden */
    overflow-y: auto;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out; /* Smooth collapse */
}
#inputContentContainer { max-height: none; } /* Input area can be larger */


#dataInput {
    width: calc(100% - 22px); /* Account for padding/border */
    margin-bottom: 10px;
    font-family: monospace;
    display: block;
    margin-left: auto;
    margin-right: auto;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
#parseButton {
    display: block;
    margin: 10px auto;
    padding: 10px 20px; /* Larger button */
    font-size: 1em;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
#parseButton:hover { background-color: #0056b3; }

/* Main Panes Container */
.container {
    display: flex;
    margin-top: 10px;
    height: 65vh;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 5px; /* Rounded corners for main container */
    overflow: hidden; /* Clip resizer if it tries to go outside */
}

.left-pane {
    display: flex;
    flex-direction: column;
    flex-basis: calc((100% - 8px) * 2 / 3); /* 2/3 of space remaining after resizer */
    flex-grow: 0;
    flex-shrink: 0;
    padding: 0; 
    overflow: hidden;
    background-color: #fff;
    box-sizing: border-box; 
}

.resizer {
    flex-basis: 8px; 
    flex-shrink: 0;
    flex-grow: 0;
    background-color: #e0e0e0; 
    cursor: col-resize;
    z-index: 10;
    transition: background-color 0.2s ease;
}
.resizer:hover { background-color: #bdbdbd; }


.right-pane {
    display: flex;
    flex-direction: column;
    flex-basis: calc((100% - 8px) * 1 / 3); /* 1/3 of space remaining after resizer */
    flex-grow: 0;
    flex-shrink: 0;
    padding: 10px; 
    overflow-y: auto;
    background-color: #fff;
    box-sizing: border-box; 
}

.left-pane > h2 {
    margin: 0; 
    padding: 10px 15px;
    background-color: #f0f0f0;
    border-bottom: 1px solid #ccc; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; 
    font-size: 1.05em;
}

.script-search-container {
    flex-shrink: 0; 
    /* Padding is handled by inline style in HTML, or can be moved here */
}

#scriptList {
    overflow-y: auto;
    overflow-x: auto;
    flex-grow: 1; 
    padding: 5px 10px; 
    margin: 0; 
}

#scriptList ul { list-style-type: none; padding-left: 0; margin:0; }

#scriptList li.script-item {
    display: flex;
    align-items: center;
    padding: 2px 0; 
    min-width: fit-content; 
    border-radius: 3px; 
}
#scriptList li.script-item:hover {
    background-color: #f5f5f5; 
}


#scriptList li.script-item input[type="checkbox"] {
    margin-right: 8px;
    flex-shrink: 0;
    cursor: pointer;
}

#scriptList li.script-item label {
    cursor: pointer;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
    border-radius: 3px;
}


.script-info {
    display: flex;
    align-items: center;
    overflow: hidden;
    flex-grow: 1;
    margin-right: 8px; 
}

.script-path-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px; 
    font-size: 0.95em;
}

.dots-container {
    flex-shrink: 0;
    white-space: nowrap;
    display: flex; 
    align-items: center;
}

.script-link-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 4px;
    flex-shrink: 0;
    border: 1px solid transparent;
}
.script-link-dot.highlighted {
    outline: 2px solid #007bff;
    outline-offset: 1px;
}

.ignore-script-button {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    color: #495057;
    padding: 2px 6px;
    font-size: 0.75em;
    cursor: pointer;
    border-radius: 3px;
    line-height: 1.2;
    margin-left: 5px;
    flex-shrink: 0;
}
.ignore-script-button:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

#scriptList li.script-item.ignored .script-path-text {
    opacity: 0.6;
    text-decoration: line-through;
    color: #6c757d;
}
#scriptList li.script-item.ignored .script-link-dot {
    opacity: 0.4;
}
#scriptList li.script-item.ignored .ignore-script-button {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}
#scriptList li.script-item.ignored .ignore-script-button:hover {
    background-color: #baddf0;
}

/* GUI Tree Styles */
#guiTree ul { list-style-type: none; padding-left: 0; }
#guiTree li > span {
    cursor: pointer;
    padding: 5px 8px; 
    display: block;
    border-radius: 3px;
    font-size: 0.95em;
}
#guiTree li > span:hover { background-color: #e9efff; }

.gui-node .children { display: none; padding-left: 20px; }
.gui-node.open > .children { display: block; }

.gui-node.has-children > span::before {
    content: '►';
    display: inline-block;
    width: 1em;
    text-align: center;
    margin-right: 5px; 
    transition: transform 0.1s ease-in-out;
    font-size: 0.8em; 
}
.gui-node.has-children.open > span::before { content: '▼'; }
.gui-node:not(.has-children) > span { padding-left: calc(1em + 8px + 5px); }


/* Code & Properties View in Right Pane */
#codeViewContainer, #propertiesViewContainer {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden; 
}
#codeViewContainer { flex: 1; min-height: 0; } 
#propertiesViewContainer { flex: 1; min-height: 0; } 


#codeViewContainer h3, #propertiesViewContainer h3 {
    margin: 0 0 8px 0; 
    padding: 8px 0;
    font-size: 1.05em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; 
}

#codeViewContainer > pre {
    flex-grow: 1; 
    overflow: auto; 
    margin: 0; 
    padding: 15px; 
    background-color: #272822; 
    border-radius: 4px; 
    min-height: 0; 
}

#codeContent {
    color: #f8f8f2; 
    font-size: 0.9em;
    display: block; 
    white-space: pre-wrap; 
    word-break: break-word; 
    box-sizing: border-box; 
}


#propertiesContent {
    overflow: auto; 
    flex-grow: 1; 
    font-size: 0.95em;
    max-width: 100%; 
    box-sizing: border-box;
    padding: 5px; 
    min-height: 0; 
}
#propertiesContent table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.9em;
}
#propertiesContent th, #propertiesContent td {
    border: 1px solid #ddd;
    padding: 8px; 
    text-align: left;
    vertical-align: top;
    word-break: break-word; 
}
#propertiesContent th { background-color: #f0f0f0; font-weight: bold; }
#propertiesContent h4 { margin-top: 0; margin-bottom: 10px; font-size: 1.1em; }
#propertiesContent h5 { margin-top: 15px; margin-bottom: 8px; font-size: 1em; color: #444; }
#propertiesContent p { margin-top: 5px; margin-bottom: 10px; }

.copy-button {
    padding: 4px 10px; 
    font-size: 0.8em; 
    cursor: pointer;
    background-color: #6c757d; 
    color: white;
    border: none;
    border-radius: 3px;
}
.copy-button:hover { background-color: #5a6268; }
.copy-button:active { background-color: #545b62; }

/* Remotes Panel */
#remotesPanel .remote-group {
    margin-bottom: 15px;
    border-left: 3px solid #007bff;
    padding-left: 10px;
}
#remotesPanel h4 { margin-top: 0; margin-bottom: 5px; font-size: 1.1em; color: #333; }
#remotesPanel h5 { margin-top: 8px; margin-bottom: 3px; font-size: 0.9em; color: #555; }
#remotesPanel ul { padding-left: 15px; list-style-type: disc; }
#remotesPanel li { font-size: 0.9em; margin-bottom: 3px; cursor: pointer; color: #0056b3; }
#remotesPanel li:hover { text-decoration: underline; }

/* Copy Feedback */
.copy-feedback {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background-color: #28a745; color: white; padding: 10px 20px;
    border-radius: 5px; z-index: 1000; opacity: 0;
    transition: opacity 0.5s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.copy-feedback.show { opacity: 1; }

/* Top Panels Container */
.top-panels-container {
    display: flex;
    gap: 15px; 
    margin-bottom: 15px;
}
.top-panel {
    flex: 1;
}

/* Mind Map Styling */
#mindMapSection {
    margin-top: 15px;
}
#mindMapContainerContent {
     max-height: 500px; /* Or adjust as needed */
     overflow-y: auto; /* Add scroll if content exceeds max-height */
}
#mindMapContainer {
    width: 100%;
    height: 450px; /* Adjust if mindMapContainerContent max-height is different */
    border: 1px solid #ccc;
    background-color: #fdfdfd;
    position: relative;
    box-sizing: border-box; 
}
#mindMapContainer p {
    text-align: center;
    padding-top: 20px;
    color: #777;
}

/* Vis.js Network specific styling */
.vis-network .vis-navigation .vis-button {
    font-size: 16px; 
}