body {
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column; /* Arrange children vertically */
    min-height: 100vh; /* Ensure body takes at least full viewport height */
    background-color: #f0f0f0;
    color: #333;
}

#main-content {
    display: flex; /* Arrange scene and UI side by side */
    flex-grow: 1; /* Allow main content to take up remaining space */
}

#scene-container {
    flex-grow: 1; /* Allow scene to take up remaining horizontal space */
    background-color: #111; /* Dark background for 3D scene */
}

#ui-panel {
    width: 300px;
    padding: 20px;
    flex-shrink: 0;
    background-color: #fff;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    overflow-y: auto;
    border-left: 1px solid #ccc;
}

h2, h3, h4 {
    color: #0056b3; /* A nice blue for headings */
    margin-top: 0;
}

.control-group, .info-group, .fun-stuff {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}
.control-group:last-child, .info-group:last-child, .fun-stuff:last-child {
    border-bottom: none;
}


label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="range"] {
    width: 100%;
}

button {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #0056b3;
}

#rightHandRuleViz {
    text-align: center;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 4px;
}
#rightHandRuleViz img {
    margin-bottom: 5px;
}

#bFieldValue, #currentValueDisplay, #currentDirText {
    font-weight: bold;
    color: #d9534f; /* A reddish color for values */
}

/* Add styles for the footer */
footer {
    width: 100%;
    padding: 10px 0;
    text-align: center;
    background-color: #333; /* Dark background for footer */
    color: #fff; /* White text */
    margin-top: auto; /* Push footer to the bottom */
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #main-content {
        flex-direction: column;
    }

    #scene-container {
        flex-grow: 0; /* Don't grow, take up defined height or content height */
        width: 100%;
        height: 60vh; /* Give scene a fixed height on mobile */
    }

    #ui-panel {
        width: 100%;
        flex-shrink: 1; /* Allow shrinking */
        border-left: none;
        box-shadow: 0 -2px 5px rgba(0,0,0,0.1); /* Add shadow to top */
        padding: 15px;
    }

    body {
        /* Adjust body flex properties if needed for mobile */
    }
}