/*================ ESTILOS CENTRALIZADOS PARA LA CÁMARA ================*/

/* Overlay pantalla completa */
.overlay-camara {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw;
    height: 100vh;
    z-index: 10000 !important; /* Aumentado para estar por encima del botón de borrar (9999) */
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    overflow: hidden;
    animation: aparecerCamara 0.3s ease forwards;
    pointer-events: auto !important;
}

/* Animacion al abrir camara */
@keyframes aparecerCamara {
    0% {
        opacity: 0;
        transform: scale(0.98) translateY(10px);
        background: rgba(0, 0, 0, 0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        background: rgba(0, 0, 0, 0.3);
    }
}

/* Animacion al cerrar camara */
@keyframes desaparecerCamara {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
        background: rgba(0, 0, 0, 0.3);
    }
    100% {
        opacity: 0;
        transform: scale(0.95) translateY(30px);
        background: rgba(0, 0, 0, 0);
    }
}

.animar-salida {
    animation: desaparecerCamara 0.4s ease forwards !important;
}

/* Bloquear scroll cuando la cámara está visible */
body.camara-activa {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

/* Contenedor principal de la cámara */
.camara-content {
    padding: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100vh;
    text-align: center;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    pointer-events: auto !important;
}

/* Contenedor del video */
.camara-video-container {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    width: 100%;
    height: 70vh;
    max-height: 70vh;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Video de la cámara */
.camara-video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    box-shadow: none;
    display: block;
    object-fit: cover;
    object-position: center center;
    background: #000;
    transform-origin: center center;
    transition: transform 0.3s ease;
    margin: 0;
    padding: 0;
}

/* Estilos específicos para el zoom */
.camara-video.zoom-activo {
    transform: scale(2);
    transform-origin: center center;
    transition: transform 0.3s ease-in-out;
}

.camara-video.zoom-inactivo {
    transform: scale(1);
    transform-origin: center center;
    transition: transform 0.3s ease-in-out;
}

/* Contenedor de preview */
.preview-contenedor {
    width: 100%;
    height: 100vh;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    border: none;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    box-shadow: none;
}

/* Imagen de preview */
.preview-img {
    width: 100%;
    height: 60vh;
    max-height: 60vh;
    border-radius: 0;
    box-shadow: none;
    object-fit: cover;
    object-position: center center;
    background: #000;
    display: block;
    margin: 20px auto 0 auto;
    flex: 0 0 auto;
    padding: 0;
}

/* Contenedor de botones */
.camara-botones {
    margin-top: 20px;
    margin-bottom: 40px;
    padding: 20px 30px;
    vertical-align: middle;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;
    background: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;
    z-index: 10001 !important;
    pointer-events: auto !important;
    position: relative;
}

/* Estilos base para todos los botones */
.camara-botones button {
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-weight: 600;
    border-radius: 25px;
    padding: 20px 30px;
    cursor: pointer !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-size: 18px;
    letter-spacing: 0.5px;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    z-index: 10001 !important;
    pointer-events: auto !important;
}

.camara-botones button:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
}

.camara-botones button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.camara-botones button:hover::before {
    left: 100%;
}

/* Botón de capturar */
.btn-capturar {
    width: 100%;
    max-width: 300px;
    font-size: 16px;
    padding: 20px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Botón de zoom */
.btn-zoom {
    width: 100%;
    max-width: 300px;
    font-size: 16px;
    padding: 20px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 152, 0, 0.2)) !important;
    border: 2px solid rgba(255, 193, 7, 0.4) !important;
    box-shadow: 0 8px 32px rgba(255, 193, 7, 0.2) !important;
}

.btn-zoom:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.3), rgba(255, 152, 0, 0.3)) !important;
    border-color: rgba(255, 193, 7, 0.6) !important;
    box-shadow: 0 12px 35px rgba(255, 193, 7, 0.3) !important;
}

/* Botones de confirmación */
.btn-usar {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-repetir {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Botón de cerrar */
.btn-cerrar {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-size: 26px;
    color: #fff;
    cursor: pointer !important;
    z-index: 10002 !important;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    pointer-events: auto !important;
}

.btn-cerrar:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Selector de cámaras para Samsung */
.selector-camaras {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    padding: 20px;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.selector-camaras h4 {
    margin-bottom: 15px;
    text-align: center;
    font-size: 18px;
    color: #fff;
}

.camaras-lista {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.camara-opcion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.camara-opcion:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.camara-seleccionada {
    background: rgba(76, 175, 80, 0.3) !important;
    border-color: #4caf50;
}

.camara-info {
    flex: 1;
}

.camara-info strong {
    display: block;
    color: #fff;
    font-size: 14px;
    margin-bottom: 2px;
}

.camara-info small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

.camara-estado {
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.camara-posicion {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    margin-top: 2px;
}

/* Botones adicionales del selector */
.btn-aplicar-camara {
    width: 100%;
    background: #4caf50;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-aplicar-camara:hover {
    background: #45a049;
    transform: scale(1.02);
}

.btn-cambiar-camara {
    background: #ff9800;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
    font-size: 14px;
}

.btn-cambiar-camara:hover {
    background: #f57c00;
    transform: scale(1.05);
}

.btn-mejor-camara {
    background: #4caf50;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    width: 100%;
    max-width: 300px;
    font-size: 14px;
}

.btn-mejor-camara:hover {
    background: #45a049;
    transform: scale(1.05);
}

.btn-sin-zoom {
    background: #ff5722;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    width: 100%;
    max-width: 300px;
    font-size: 14px;
}

.btn-sin-zoom:hover {
    background: #e64a19;
    transform: scale(1.05);
}

.btn-forzar-selector {
    background: #9c27b0;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    width: 100%;
    max-width: 300px;
    font-size: 14px;
}

.btn-forzar-selector:hover {
    background: #7b1fa2;
    transform: scale(1.05);
}

/* Pantalla responsiva */
@media screen and (max-width: 480px) {
    .camara-content {
        max-width: 100%;
        padding: 15px;
        height: 100vh;
        border-radius: 20px;
    }

    .camara-botones {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 30px;
        margin-top: 20px;
        padding: 20px;
    }
    
    .camara-botones button {
        padding: 18px 25px;
        font-size: 15px;
        min-width: 180px;
    }
    
    .camara-video,
    .preview-img {
        max-height: 65vh;
    }
    
    .btn-cerrar {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .preview-contenedor {
        border-radius: 0;
    }
} 