
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.switch .slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #8FA6F0; /* Your preferred color */
}

input:checked + .slider:before {
  transform: translateX(26px);
}


/* Default: side by side for landscape/desktop */
#left-panel {
    width: 35%;
    overflow-y: auto;
     height: 100vh;
}

#right-panel {
    width: 65%;
    overflow-y: auto;
     height: 100vh;
}

/* Only target specific elements that need width constraining, not dropdowns */
#left-panel img,
#left-panel input,
#left-panel .dash-graph,
#right-panel img,
#right-panel input,
#right-panel .dash-graph {
    max-width: 100%;
}

#left-panel,
#right-panel,
#left-panel img,
#left-panel input,
#left-panel .dash-graph,
#right-panel img,
#right-panel input,
#right-panel .dash-graph {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

@media (max-width: 768px) {
    #loading-output .dash-spinner {
            left: 50% !important;    /* center of full screen on mobile */
        }
    .main-layout {
        flex-direction: column !important;
    }
    #left-panel {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        padding: 10px !important;
        box-sizing: border-box !important;
    }
    #right-panel {
        width: 100% !important;
        height: auto !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        padding: 10px !important;
        box-sizing: border-box !important;
    }

    /* Fix elements cutting off on right side */
    .Select-menu-outer {
        width: 100% !important;
    }

    /* Summary table */
    #data-table,
    .dash-table-container,
    .dash-spreadsheet-container,
    .dash-spreadsheet,
    .dash-spreadsheet table {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
    }

    /* Cross section — square */
    #beam-cross-section-container {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        overflow-x: hidden !important;
    }

    #beam-cross-section,
    #beam-cross-section .js-plotly-plot,
    #beam-cross-section .plotly {
        width: 100% !important;
        min-width: 300px !important;
    }

    /* Beam list */
    #beam-list-container {
        width: 100% !important;
        overflow-x: hidden !important;
    }

    #beam-list {
        width: 100% !important;
    }

    /* Upload button */
    #upload-project {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Point and uniform load containers */
    #point-container,
    #uniform-container {
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* Individual load cards inside containers */
    #point-container > div,
    #uniform-container > div {
        width: 100% !important;
        box-sizing: border-box !important;
    }
}
}


/* Loading spinner fixed to viewport center-right */
#loading-output .dash-spinner {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;    /* center of the right panel (65% width starting at 35%. this must be updated if those widths change) */
    transform: translate(-50%, -50%) !important;
    z-index: 9999 !important;
}