.main-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    flex-wrap: wrap;
    position: relative;
}

.surgical-table-container {
    background-color: rgba(0, 0, 0, 0);
    border-radius: 20px;
    padding: 0px;
    color: white;
    width: 600px;
    position: relative;
    z-index: 1;
}

/* Desktop layout (default) - side by side */
@media (min-width: 1025px) {
    .main-layout {
        flex-wrap: nowrap;
        align-items: center;
    }
    
    .surgical-table-container {
        position: fixed;
        top: calc(50dvh - 35%);
        right: calc(50dvw - 550px);
        z-index: -10;
    }
}

/* Tablet layout */
@media (max-width: 1024px) and (min-width: 769px) {
    body {
        display: block; /* Allow scrolling on tablet too */
        min-height: auto;
        padding: 15px;
    }
    
    .main-layout {
        flex-direction: column;
        align-items: center;
        gap: 30px;
        min-height: auto;
    }
    
    .surgical-table-container {
        width: 80%;
        max-width: 500px;
        order: 2; /* Comes after device */
        margin-top: 30px;
        margin-bottom: 40px;
    }
    
    .device {
        order: 1; /* Comes before surgical table */
        margin-right: 0 !important;
        width: 320px !important; /* Keep original device width */
        margin: 0 auto; /* Center the device */
    }
    
    .canvas-container {
        height: 500px; /* Medium height for tablet */
    }
}

/* Mobile layout */
@media (max-width: 768px) {
    body {
        display: block; /* Change from flex to block for scrolling */
        min-height: auto;
        padding: 10px;
    }
    
    .main-layout {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 10px;
        min-height: auto;
    }
    
    .surgical-table-container {
        position: fixed;
        top: 10px;
        right: 10px;
        width: 25vw;
        max-width: 25vw;
        min-width: 100px;
        height: 25vw;
        min-height: 100px;
        z-index: 1000;
        background-color: rgba(36, 36, 36, 0.5); /* red overlay for debugging */
        order: unset;
        margin: 0;
        border-radius: 40px;
        overflow: hidden;
        padding: 0;
    }

    #surgicalTableCanvas {
        width: 90% !important;
        height: 90% !important;
        position:relative;
        left:5%;
        top:5%;
    }
    
    .device {
        order: 1; /* Comes before surgical table */
        margin-right: 0 !important;
        width: 320px !important; /* Keep original device width */
        max-width: 320px !important;
        margin: 0 auto; /* Center the device */
    }
    
    .canvas-container {
        height: 100%;
        width: 100%;
    }
    
}

.canvas-container {
    width: 100%;
    height: 600px;
    background: transparent;
    border-radius: 10px;
    overflow: hidden;
    /* filter: blur(2.5px); */
    filter: blur(0px); 
}

.controls-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    font-size: 14px;
    color: #ccc;
    display: flex;
    justify-content: space-between;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: #444;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #00a2ff;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #33b5ff;
}

.version-display {
    display: none !important;
}
