#camera-layout-switcher {
    text-align: center;
    margin-bottom: 20px;
}

#camera-layout-switcher button.active-layout {
    outline: 1px solid #2b7ffc;
}

/* Ensure camera blocks never collapse even if video disappears */
.camera-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* keeps height responsive */
    background: #000; /* fallback for empty video */
    overflow: hidden;
}

/* Video always fills the box, even when unloaded */
.camera-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* All overlays must fill the wrapper and keep it stable */
.camera-loading,
.camera-offline,
.camera-reconnecting {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
}
.camera-item {
    width: 100%;
    display: block;
    margin-bottom: 25px;
}
#camera-layout-switcher {
    text-align: center;
    margin-bottom: 20px;
}

#camera-layout-switcher button.active-layout {
    outline: 1px solid #2b7ffc;
}

/* Responsive 16:9 boxes that never collapse */
.camera-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.camera-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlays fill the wrapper */
.camera-loading,
.camera-offline,
.camera-reconnecting {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
}

/* Optional: spacing wrapper around each camera item */
.camera-item {
    width: 100%;
    display: block;
    margin-bottom: 25px;
}
#camera-modal {
    align-items: center !important;
    justify-content: center !important;
}

#camera-modal-ui {
    max-width: 900px;
    width: 95%;
    margin: auto;
}

#camera-modal-video {
    width: 100% !important;
    height: auto !important;
}

