body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
}

#visualizer {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.node {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    transition: transform 0.3s;
}

.node:hover {
    transform: scale(1.1);
}

.node img {
    width: 100%;
    height: auto;
    border-radius: 50%;
}

.tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px;
    border-radius: 5px;
    display: none;
    z-index: 10;
}

.tooltip.active {
    display: block;
}

:root {
    --side-menu-width: 300px; /* You can change this value */
}

@media (max-width: 750px) {
    :root {
        --side-menu-width: 40vw;
    }
    .image-section {
        height: 40vw;
        min-height: 180px; /* Optional: set a minimum height */
    }
}

#side-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--side-menu-width);
    height: 100%;
    background: #696969;
    box-shadow: 0 0 10px rgba(0,0,0,0.08);
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Add this line to enable vertical scrolling */
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: #b0b0b0 #444444; /* For Firefox */
}

.sidebar-section {
    padding: 20px 20px;
    box-sizing: border-box;
}

.sidebar-divider {
    height: 1px;
    background: #555555;
    margin: 0 16px;
}

.image-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: var(--side-menu-width); /* same as sidebar width */
    justify-content: flex-start;
    padding-bottom: 0;
}

.node-name {
    font-weight: bold;
    text-align: center;
    margin-bottom: 12px;
    font-size: 1.2em;
}

.node-image-wrapper {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f5f5f500; /* Default background */
}

#node-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /*aspect-ratio: 1/1; /* keeps image square, adjust if needed */
    border-radius: 8px;
    background: transparent; /* Ensure the image itself doesn't override the wrapper's background */
}

#node-image:empty {
    background: #5d5d5d00; /* Fallback background when the image is missing */
    border-radius: 8px;
}

/* Optional: Style the scrollbar for Webkit browsers */
#side-menu::-webkit-scrollbar {
    width: 8px;
}
#side-menu::-webkit-scrollbar-thumb {
    background: #b0b0b0;
    border-radius: 4px;
}
#side-menu::-webkit-scrollbar-track {
    background: #444444;
}

.search-section {
    padding: 16px 20px 8px 20px;
    background: #696969;
    box-sizing: border-box;
}

#sidebar-search {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #bbb;
    font-size: 1em;
    background: #f5f5f5;
    color: #222;
    outline: none;
    box-sizing: border-box;
}

#bottom-controls {
    position: fixed;
    bottom: 0.5vw;
    left: 0.5vw;
    z-index: 3000;
    display: flex;
    align-items: flex-end;
    gap: 0.25vw; /* or use gap: 1em; for spacing between controls */
}

#cropped-toggle,
#toggle-names,
#sprite-scale-container {
    background: #222;
    color: #fff;
    border-radius: 0.8vw;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    font-size: clamp(0.5em, 5vw, 1em);
    padding: clamp(10px, 1.5vw, 20px) clamp(5px, 5vw, 20px);
    display: flex;
    align-items: center;
}

#sprite-scale-container label,
#sprite-scale-container input[type="range"] {
    font-size: clamp(0.5em, 5vw, 1em);
}

#sprite-scale-slider {
    width: clamp(60px, 10vw, 120px);
}

.node-label {
    position: absolute;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.5);
    /*padding: 2px 8px;*/
    border-radius: 6px;
    font-size: 0.1em;
    font-family: inherit;
    pointer-events: none;
    white-space: nowrap;
    transform: translate(-50%, -100%);
    z-index: 2001;
    font-weight: bold;
    opacity: 0.9;
    transition: opacity 0.5s;
}