        /* This is the working CSS Grid layout from the diagnostic test */
        html, body { height: 100%; margin: 0; padding: 0; font-family: sans-serif; overflow: hidden; }
        body { display: grid; grid-template-columns: 350px 1fr; grid-template-rows: 100%; }
#sidebar {
    /* Your existing sidebar styles are likely fine */
    background: #fff;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 10;
    overflow-y: auto;
}

#map {
    /* Critical: The map container does NOT need position: relative anymore */
    height: 100%;
    width: 100%;
}

#app-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    height: 100vh; /* vh = viewport height */
}

        /* Simple styles for our application elements */
        .section { margin-bottom: 2rem; }
        .section h3 { margin-top: 0; border-bottom: 1px solid #ccc; padding-bottom: 5px; }
        #upload-geojson-form input { margin-bottom: 10px; }
        button { padding: 8px 12px; cursor: pointer; }
        
        /* /index.php inside the <style> tag */

/* Styles for the modal window */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); }
.modal-content { background-color: #fefefe; margin: 10% auto; padding: 20px; border: 1px solid #888; width: 80%; max-width: 600px; border-radius: 8px; }
.close-btn { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
.close-btn:hover { color: black; }
#modal-images-container img { max-width: 100px; height: auto; margin: 5px; border-radius: 4px; border: 1px solid #ddd; cursor: pointer; transition: transform 0.2s; }
#modal-images-container img:hover { transform: scale(1.1); }

.lightbox {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000; /* Higher than the modal */
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

#context-menu, #tree-context-menu  {
    display: none;
    position: absolute; /* positioned relative to the BODY, not the map */
    z-index: 9999; /* An absurdly high z-index to guarantee it's on top */
    background-color: white;
    border: 1px solid #999;
    box-shadow: 3px 3px 5px rgba(0,0,0,0.3);
    list-style: none;
    margin: 0;
    padding: 5px 0;
    border-radius: 4px;
}

#context-menu, #tree-context-menu  li {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
}

#context-menu, #tree-context-menu  li:hover {
    background-color: #007bff;
    color: white;
}

.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}
.form-group input[type="text"],
.form-group select,
.form-group input[type="file"] {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

.drawing-tools-disabled {
    opacity: 0.4;
    pointer-events: none; /* This makes the element unclickable */
    user-select: none;
}

.layer-checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}
.layer-checkbox-container label {
    flex-grow: 1; /* Makes the label take up available space */
}
.layer-settings-btn {
    padding: 2px 6px;
    margin-left: 10px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    cursor: pointer;
}
.layer-settings-btn:hover {
    background: #e0e0e0;
}

.layer-actions {
    position: relative;
    display: inline-block;
    margin-left: 10px;
}
.layer-actions-dropdown {
    display: none;
    position: absolute;
    right: 0;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
}
.layer-actions-dropdown a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
}
.layer-actions-dropdown a:hover {
    background-color: #f1f1f1;
}
.layer-actions:hover .layer-actions-dropdown {
    display: block;
}

/* /assets/css/style.css */
#icon-picker-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    background-color: #f7f7f7;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
}
.icon-picker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 5px;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: background-color 0.2s, border-color 0.2s;
}
.icon-picker-item:hover {
    background-color: #e9e9e9;
}
.icon-picker-item.selected {
    border-color: #007bff;
    background-color: #e0efff;
}
.icon-picker-item img {
    width: 32px;
    height: 32px;
}
.icon-picker-item span {
    font-size: 11px;
    margin-top: 4px;
    max-width: 60px;
    text-align: center;
    overflow-wrap: break-word;
}

#icon-manager-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 20px;
}
.icon-manager-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
}
.icon-manager-item img {
    width: 32px;
    height: 32px;
}
.icon-manager-item span {
    font-size: 12px;
    margin-top: 5px;
    max-width: 70px;
    text-align: center;
    word-wrap: break-word;
}
.delete-icon-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background-color: #d9534f;
    color: white;
    border: 1px solid white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.delete-icon-btn:hover {
    opacity: 1;
}