#video-recorder-container {
    max-width: 800px;
    margin: 20px auto;
    text-align: center;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    width: 100%;
    box-sizing: border-box;
}

#video-preview {
    margin: 0 auto 20px;
    /*border: 2px solid #333;*/
    border-radius: 8px;
    overflow: hidden;
    /*background: #000;*/
    position: relative;
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

#video-preview video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.camera-placeholder {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ccc;
    box-sizing: border-box;
}

.placeholder-content {
    text-align: center;
    color: #666;
}

.camera-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.7;
}

.placeholder-content p {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
}

#controls {
    margin: 20px 0;
}

.btn {
    padding: 10px 20px;
    margin: 0 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #007cba;
    color: white;
}

.btn-primary:hover {
    background-color: #005a87;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

#status-message {
    margin-top: 20px;
    min-height: 30px;
}

.status-success {
    color: #28a745;
    font-weight: bold;
}

.status-error {
    color: #dc3545;
    font-weight: bold;
}

.status-info {
    color: #17a2b8;
    font-weight: bold;
}

/* Styles pour orientation portrait - priorité élevée */
@media screen and (orientation: portrait) {
    #video-preview {
        aspect-ratio: 9/16 !important;
        max-width: 400px;
    }

    #video-preview video {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
    }
}

/* Styles pour orientation paysage - priorité élevée */
@media screen and (orientation: landscape) {
    #video-preview {
        aspect-ratio: 16/9 !important;
        max-width: 600px;
    }

    #video-preview video {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
    }
}

/* Media queries spécifiques pour mobile en portrait */
@media screen and (max-width: 768px) and (orientation: portrait) {
    #video-preview {
        aspect-ratio: 9/16 !important;
        max-width: 90vw;
        width: 100%;
        height: auto;
        min-height: 200px;
    }

    #video-preview video {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
    }
}

/* Media queries spécifiques pour mobile en paysage */
@media screen and (max-width: 768px) and (orientation: landscape) {
    #video-preview {
        aspect-ratio: 16/9 !important;
        max-width: 90vw;
        width: 100%;
        height: auto;
        min-height: 150px;
    }

    #video-preview video {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
    }
}

/* Media queries pour mobile */
@media screen and (max-width: 768px) {
    #video-recorder-container {
        margin: 10px;
        padding: 15px;
        max-width: none;
        width: calc(100% - 20px);
    }

    #video-preview {
        width: 100%;
        height: auto;
        min-height: 200px;
    }

    .camera-placeholder {
        min-height: 200px;
    }

    .camera-icon {
        font-size: 36px;
    }

    .placeholder-content p {
        font-size: 14px;
        padding: 0 10px;
    }

    #controls {
        margin: 15px 0;
    }

    .btn {
        padding: 12px 16px;
        margin: 5px 2px;
        font-size: 14px;
        min-width: 80px;
    }
}

/* Petits écrans en portrait */
@media screen and (max-width: 480px) and (orientation: portrait) {
    #video-recorder-container {
        margin: 5px;
        padding: 10px;
        width: calc(100% - 10px);
    }

    #video-preview {
        aspect-ratio: 9/16 !important;
        min-height: 180px;
        max-width: 95vw;
    }

    #video-preview video {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
    }

    .camera-placeholder {
        min-height: 180px;
    }

    .camera-icon {
        font-size: 32px;
        margin-bottom: 10px;
    }

    .placeholder-content p {
        font-size: 16px;
    }

    .btn {
        padding: 10px 12px;
        margin: 3px 1px;
        font-size: 13px;
        min-width: 70px;
        display: inline-block;
        width: calc(50% - 6px);
        box-sizing: border-box;
    }

    #controls {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
}

/* Petits écrans en paysage */
@media screen and (max-width: 480px) and (orientation: landscape) {
    #video-recorder-container {
        margin: 5px;
        padding: 10px;
        width: calc(100% - 10px);
    }

    #video-preview {
        aspect-ratio: 16/9 !important;
        min-height: 120px;
        max-width: 95vw;
    }

    #video-preview video {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
    }

    .camera-placeholder {
        min-height: 120px;
    }

    .camera-icon {
        font-size: 28px;
        margin-bottom: 8px;
    }

    .placeholder-content p {
        font-size: 11px;
    }

    .btn {
        padding: 8px 10px;
        margin: 2px 1px;
        font-size: 12px;
        min-width: 60px;
        display: inline-block;
        width: calc(50% - 4px);
        box-sizing: border-box;
    }

    #controls {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 3px;
    }
}