/* Essential CSS for a full-screen 3D scene */
body {
    margin: 0;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    background-color: #1a1a1a;
}
canvas {
    display: block;
}

/* --- SIDEBAR STYLING --- */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 250px; /* Default expanded width */
    background-color: rgba(0, 0, 0, 0.25);
    color: white;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    z-index: 10;
    overflow-y: auto;
    transition: width 0.3s ease, background-color 0.3s ease; /* Smooth transition */
}

/* Collapsed state */
#sidebar.collapsed {
    width: 60px; /* Collapsed width: just enough room for the button/icon */
    padding: 20px 0 0 0;
}

#sidebar h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.5rem;
    color: #fcf7e1;
    transition: opacity 0.1s;
}

/* Hide content when collapsed */
#sidebar.collapsed h2 {
    opacity: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}

#scene-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.scene-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.2s, font-weight 0.2s, padding 0.3s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.1rem;
    white-space: nowrap; /* Prevent wrapping the text */
}

/* Adjust scene item padding and alignment for collapsed state */
#sidebar.collapsed .scene-item {
    padding: 15px 0;
    text-align: center;
}

/* Hide scene item text when collapsed */
#sidebar.collapsed .scene-item span {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s;
}

/* Hover and Active styles for the menu items */
.scene-item:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.1);
}

.scene-item.active {
    background-color: #0000007e; /* Highlight for the current scene */
    font-weight: 700;
}

.scene-item.disabled {
    cursor: wait;
    opacity: 0.6;
    pointer-events: none; /* Disables clicks during transition */
}

/* --- TOGGLE BUTTON STYLING --- */
#toggle-sidebar {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #7e7e7e34;
    color: white;
    border: none;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s, background 0.2s;
    font-size: 1.2rem;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#sidebar.collapsed #toggle-sidebar {
    transform: rotate(180deg); /* Rotate the arrow when collapsed */
    right: 15px; /* Adjust position slightly when collapsed */
}

#toggle-sidebar:hover {
    background: #8686864f;
}
