 body,
    html {
        height: 100%;
        margin: 0;
        font-family: Arial, sans-serif;
        background-color: rgba(0, 0, 0, 1); /* Set background color to black */
       /* overflow: hidden;  Prevent scrolling */
    }
    /* Style pour les canvas - tous superposés */
    .videoInsert, .videoCanvas, .maskCanvas, .threejsCanvas {
        /* Canvas positioning styles can be added here if needed */
    }

    /* Masquer la vidéo par défaut si nécessaire */
    .videoInsert {
        z-index: 1;
           visibility: hidden;
    }

    .videoCanvas {
        z-index: 2;
            
        /* Video canvas properties */
    }

    .maskCanvas {
        z-index: 3;
        visibility: hidden;
    }

    .threejsCanvas {
        z-index: 4;
    }

    #loadingStatus {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.3);
    color: #fff;
    padding: 24px 40px;
    
    font-size: 0.8rem;
    font-family: Arial, sans-serif;
    z-index: 10000;
    text-align: center;
    
    display: none;
}

#detectionOverlay {
    /* Les styles sont maintenant gérés par JavaScript dans detectionOverlay.js */
    /* Styles de base seulement */
    position: absolute;
    z-index: 9000;
    display: none;
}

/* Bouton plein écran */
#fullscreenButton {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    font-size: 18px;
}

#fullscreenButton:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

#fullscreenButton:active {
    transform: scale(0.95);
}

/* Icônes pour le bouton */
#fullscreenButton .expand-icon {
    display: block;
}

#fullscreenButton .compress-icon {
    display: none;
}

/* État plein écran */
body.fullscreen #fullscreenButton .expand-icon {
    display: none;
}

body.fullscreen #fullscreenButton .compress-icon {
    display: block;
}

/* Sélecteur de caméra */
#cameraSelector {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
}

#cameraSelectorButton {
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    font-size: 18px;
}

#cameraSelectorButton:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

#cameraSelectorButton:active {
    transform: scale(0.95);
}

#cameraDropdown {
    position: absolute;
    bottom: 60px;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    min-width: 200px;
    max-width: 280px;
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

#cameraDropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.camera-option {
    padding: 12px 16px;
    color: white;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.camera-option:last-child {
    border-bottom: none;
}

.camera-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.camera-option.active {
    background: rgba(255, 255, 255, 0.2);
    color: #4CAF50;
}

.camera-option .camera-icon {
    font-size: 16px;
    opacity: 0.7;
}

.camera-option .camera-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sélecteur de vidéo */
#videoSelector {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9998;
}

#videoSelectorButton {
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    font-size: 18px;
}

#videoSelectorButton:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

#videoSelectorButton:active {
    transform: scale(0.95);
}

#videoDropdown {
    position: absolute;
    bottom: 60px;
    left: 0;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    min-width: 200px;
    max-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

#videoDropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.video-option {
    padding: 12px 16px;
    color: white;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-option:last-child {
    border-bottom: none;
}

.video-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.video-option.active {
    background: rgba(74, 144, 226, 0.3);
}

.video-option .video-icon {
    font-size: 16px;
    opacity: 0.7;
}

.video-option .video-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}