/* --- Global & Reset Styles --- */
html {
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}
body {
    margin: 0;
    padding: 0;
    background-color: #c0c0c0;
    overflow-x: hidden;
}

/* --- Base Layout (Mobile First) --- */
.window {
    width: 100vw;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    border: none;
}
.window-body {
    display: flex;
    flex-direction: column;
    padding: 10px;
    flex-grow: 1;
    overflow-y: auto;
}
.left-pane {
    width: 100%;
	height: 55vh;
    min-height: 250px;
    flex-grow: 1;
}
.right-pane {
    width: 100%;
    padding-top: 10px;
}
#viewer {
    width: 100%;
    height: 70hv%;
    display: block;
    background: #808080; /* Added a darker grey for the viewer background */
}
#info-display {
    padding: 5px;
    height: 100px;
}

/* --- Action/Button Styling (Applies to all viewports) --- */
.action-group {
    margin-bottom: 20px;
}
.button-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* Space between buttons */
}
.button-container > button {
    display: flex;
    flex-direction: column; /* Stack icon and label */
    align-items: center;
    justify-content: center;
    width: 55px; /* Button width */
    height: 45px; /* Button height */
    margin: 0;
    padding: 8px 4px; /* Vertical and horizontal padding */
    text-align: center;
}
.icon {
    width: 16px;
    height: 16px;
    margin: 0 0 5px 0; /* Margin on bottom to space from label */
}
.btn-label {
    font-size: 11px; /* Smaller font for button labels */
    line-height: 1.2;
}

/* --- File Upload Styling --- */
.file-upload-container {
    display: flex;
    gap: 4px; /* A small gap between the text field and button */
}
#file-name-display {
    flex-grow: 1; /* Allow the text field to fill available space */
    width: 0; /* Required for flex-grow to work properly */
    padding: 2px 4px;
    height: 24px; /* Match button height for vertical alignment */
}
#model-upload-button {
    flex-shrink: 0; /* Prevent the button from shrinking */
}
#model-upload-hidden {
    display: none; /* Hide the real file input */
}

/* --- UI State Styling --- */
button.active-mode {
    border-style: inset;
    background-color: #c0c0c0;
	box-shadow: inset 1px 1px #0a0a0a,inset -1px -1px #fff,inset 2px 2px grey,inset -2px -2px #dfdfdf;
}


/* --- Desktop Styles (1024px and wider) --- */
@media (min-width: 1024px) {
    body {
        background-color: #008080; /* Restore teal background */
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100vh;
    }
    .window {
        width: 1024px;
        height: 768px;
    min-height: 768px;
        margin: 0;
        border: initial;
    }
    .window-body {
        flex-direction: row;
        padding: 10px;
        overflow: hidden;
    }
    .right-pane {
        width: 30%;
        padding: 0 0 0 10px;
        flex-shrink: 0; /* Prevent the right pane from shrinking */
    }
}