body {
    font-family: Arial, sans-serif;
    text-align: center;
    display: flex;
    padding: 0;
    margin: 0;
    width: 100vw;
    height: 100vh;
}

@media (max-width: 968px) {
    body {
        flex-direction: column-reverse;
    }
    #leftHalf {
        flex-basis: 100% !important;
    }

    #rightHalf {
        flex-basis: 100% !important;
    }
}

#leftHalf {
    flex: 1;
    flex-basis: 60%;
}

#blocklyArea {
    width: 100%;
    height: 100%;
}

#rightHalf {
    flex: 1;
    flex-basis: 40%;

    display: flex;
    flex-direction: column;
    align-items: center;
}

#rightHalf>* {
    max-width: 400px;
}

#controls {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    margin: 0 0.5rem;
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
}

#programStatusWindow {
    display: flex;
    width: 80%;
    margin: 0.5rem auto;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

#programStatusWindow>div {
    flex-basis: 50%;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
}

input:checked+.slider {
    background-color: #3fbf97;
}

input:focus+.slider {
    box-shadow: 0 0 1px #3fbf97;
}

input:checked+.slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

#connectBtn {
    background: green;
}

#disconnectBtn {
    background: lightcoral;
}

button:not(#connectBtn):not(#disconnectBtn) {
    background: green;
}

#status {
    margin-top: 0.5rem;
    color: #555;
}

#webcam-container {
    width: 400px;
    height: 300px;
    margin: 1rem auto;
    border: 2px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
}

#predictionContainer {
    width: 400px;
    margin: 0.5rem auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bar {
    height: 10px;
    transition: width 0.2s;
    background: #4caf50;
    width: 0;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

#servoStatus {
    margin: 1.5rem auto;
    padding: 0.5rem 1rem;
    width: 160px;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
}

#servoStatus.idle {
    background: grey;
}

#servoStatus.active {
    background: green;
}

#modelControls {
    display: flex;
    flex-direction: column;
    width: 100%;

    margin-top: 2rem;
}

#modelControlsSelectDiv {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-evenly;
}

#modelSelect,
#modelURL {
    padding: 0.5rem;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 8px;
}

#modelSelect {
    margin-right: 0.5rem;
}

#modelURL {
    display: none;
}

#loadModelBtn {
    display: none;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

#lastLoaded {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.3rem;
}