/* Modal */
.modal,
.modalEliminar {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    gap: 10px;
}

/* Contenido del Modal */
.modal-content,
.modalEliminar-content {
    border-radius: 10px;
    background-color: #ffffff;
    padding: 25px;
    border: none;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    max-height: 85vh;
    overflow-y: auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal-content h2 {
    padding-top: 1em;
}

.imageContainer {
    position: relative;
    text-align: center;
    padding: 20px;
}

.zoomable-image {
    max-width: 100%;
    max-height: 80vh;
    cursor: zoom-in;
}

.zoomable-image.zoomed-in {
    cursor: zoom-out;
}

/* Scrollbar personalizado */
.modal-content::-webkit-scrollbar,
.modalEliminar-content::-webkit-scrollbar {
    width: 4px;
}

.modal-content::-webkit-scrollbar-thumb,
.modalEliminar-content::-webkit-scrollbar-thumb {
    background-color: #6881ff;
    border-radius: 10px;
}

/* Bot車n de cerrar */
.close {
    color: white;
    background-color: #ff4d4d;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    outline: none;
      z-index:1111;
    transition: background-color 0.3s, transform 0.2s;
}

.close:hover,
.close:focus {
    background-color: #cc0000;
    transform: scale(1.1);
    text-decoration: none;
}

.buttonsModals {
    display: flex;
    margin: 2% 1%;
    justify-content: space-between;
    align-items: center;
}

/* T赤tulos del Modal */
.modal-content h2,
.modalEliminar-content h2 {
    font-size: 1.5rem;
    margin: 0 0 20px;
    color: #333;
    text-align: center;
}

/* Formulario */
.modal-content label {
    display: block;
    margin: 15px 0 5px;
    font-weight: bold;
}

.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content input[type="radio"] {
    border: 2px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
}

.modal-content input[type="radio"] {
    width: auto;
}

.radio-group {
    display: flex;
    margin-bottom: 15px;
    justify-content: space-between;
}

/* Bot車n del Modal */
.modal-content button {
    background-color: #525fbb;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    padding: 10px 15px;
    transition: background-color 0.3s;
    margin: 0 1%;
    width: 100%;
}

.modal-content button:hover {
    background-color: #404a97;
}

/* Animaciones de modal */
.modal.show .modal-content,
.modalEliminar.show .modalEliminar-content {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.modal.hide .modal-content,
.modalEliminar.hide .modalEliminar-content {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

/* Estructura de la p芍gina */
.tipoOperaciones {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: column;
}

/* Encabezado */
.headerh1 {
    width: 100%;
    background-color: #ffffff;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
    padding: 1em 0;
}

.headerh1 h1 {
    font-size: 1.5rem;
}

/* Submit */
.submit {
    width: 90%;
    background-color: #ffffff;
    padding: 20px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* Botones eliminar */
#modalEliminar button,
#modalEliminarEgreso .btn-delete {
    background-color: #dd5e5e;
    color: white;
    padding: 10px;
}

/* Estilo para alerta de API */
.closeModalApi {
    color: #ffffff;
    background-color: #fd6969cb;
    float: right;
    font-size: 28px;
    padding: 0.2em 0.4em;
    font-weight: bold;
}

.closeModalApi:hover,
.closeModalApi:focus {
    color: black;
    cursor: pointer;
}

#loading {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: progress;
}

.loading-circle {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #4855b7;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    margin-right: 1em;
    animation: spin 0.5s linear infinite;
    margin-right: 2%;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
}

.loading-message {
    font-size: 16px;
    color: #333;
    font-weight: bold;
    margin-top: 10px;
}





/* Animaci車n para el c赤rculo de carga */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsividad */
@media (max-width: 768px) {
    .modal-content,
    .modalEliminar-content {
        width: 100%;
    }
    .submit {
        width: 100%;
    }
}

/* Animaciones */
@keyframes modalopen {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error {
    border: 2px solid red;
}



/* modales de vigilancia */

/* Modal de Vigilancia */
#modalVigilancia.modal {
    /* Asegurar que esté oculto inicialmente */
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    /* Centrado flexible cuando se muestra */
    align-items: center;
    justify-content: center;
}
/* Contenido del Modal de Vigilancia */
#modalVigilancia .modal-content {
    /* Fondo blanco para limpieza */
    background-color: #ffffff;
    /* Bordes redondeados elegantes */
    border-radius: 12px;
    /* Sombra suave para profundidad */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    /* Ancho adaptable */
    width: 90%;
    max-width: 600px;
    /* Altura máxima para pantallas cortas */
    max-height: 80vh;
    /* Desplazamiento vertical */
    overflow-y: auto;
    /* Relleno equilibrado */
    padding: 2rem;
    /* Centrado absoluto */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Transición suave */
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Scrollbar personalizado */
#modalVigilancia .modal-content::-webkit-scrollbar {
    width: 6px;
}

#modalVigilancia .modal-content::-webkit-scrollbar-thumb {
    background-color: #4853A0; /* Índigo */
    border-radius: 10px;
}

#modalVigilancia .modal-content::-webkit-scrollbar-track {
    background: #f9f9f9; /* Gris claro */
}

/* Botón de cerrar */
#modalVigilancia .close {
    /* Diseño profesional en índigo */
    background-color: #A32C2C;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1111;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#modalVigilancia .close:hover,
#modalVigilancia .close:focus {
    background-color: #871414; /* rojo oscuro */
    transform: scale(1.1);
}

/* Encabezado del modal */
#modalVigilancia .modal-header {
    /* Centrado y separado */
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0; /* Línea gris clara */
    padding-bottom: 0.5rem;
}

#modalVigilancia .modal-title {
    /* Fuente grande y profesional */
    font-size: 1.75rem;
    font-weight: 600;
    color: #4853A0; /* Índigo */
    margin: 0;
}

/* Cuerpo del modal */
#modalVigilancia .modal-body {
    /* Organización en columna */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Sección de detalles */
#modalVigilancia .details-section {
    /* Fondo gris claro para destacar */
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 1rem;
}

#modalVigilancia .details-section h3 {
    /* Título claro */
    font-size: 1.25rem;
    font-weight: 600;
    color: #2a2a2a; /* Gris oscuro */
    margin-bottom: 1rem;
}

#modalVigilancia .details-grid {
    /* Cuadrícula para detalles */
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

#modalVigilancia .detail-item {
    /* Estilo de cada detalle */
    display: flex;
    align-items: center;
    padding: 0.5rem;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

#modalVigilancia .detail-item strong {
    /* Etiqueta destacada */
    color: #4853A0; /* Índigo */
    font-weight: 600;
    width: 120px;
    flex-shrink: 0;
}

#modalVigilancia .detail-item span {
    /* Valor del detalle */
    color: #2a2a2a;
    font-size: 1rem;
}

/* Sección de comentarios */
#modalVigilancia .comments-section {
    /* Fondo blanco para claridad */
    background-color: #ffffff;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e0e0e0;
}

#modalVigilancia .comments-section h3 {
    /* Título de comentarios */
    font-size: 1.25rem;
    font-weight: 600;
    color: #2a2a2a;
    margin-bottom: 1rem;
}

#modalVigilancia .comments-list {
    /* Lista de comentarios */
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background-color: #f9f9f9;
    border-radius: 6px;
}

#modalVigilancia .comments-list::-webkit-scrollbar {
    width: 4px;
}

#modalVigilancia .comments-list::-webkit-scrollbar-thumb {
    background-color: #4853A0;
    border-radius: 10px;
}

/* Animaciones */
#modalVigilancia.show .modal-content {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

#modalVigilancia.hide .modal-content {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

/* Responsividad */
@media (max-width: 768px) {
    #modalVigilancia .modal-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 75vh;
    }

    #modalVigilancia .modal-title {
        font-size: 1.5rem;
    }

    #modalVigilancia .close {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    #modalVigilancia .details-section h3,
    #modalVigilancia .comments-section h3 {
        font-size: 1.1rem;
    }

    #modalVigilancia .detail-item {
        padding: 0.4rem;
    }

    #modalVigilancia .detail-item strong {
        width: 100px;
        font-size: 0.95rem;
    }

    #modalVigilancia .detail-item span {
        font-size: 0.9rem;
    }

    #modalVigilancia .comments-list {
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    #modalVigilancia .modal-content {
        padding: 1rem;
        width: 98%;
    }

    #modalVigilancia .modal-title {
        font-size: 1.3rem;
    }

    #modalVigilancia .close {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    #modalVigilancia .details-section h3,
    #modalVigilancia .comments-section h3 {
        font-size: 1rem;
    }

    #modalVigilancia .detail-item strong {
        width: 80px;
        font-size: 0.9rem;
    }

    #modalVigilancia .detail-item span {
        font-size: 0.85rem;
    }

    #modalVigilancia .comments-list {
        max-height: 120px;
    }
    
    /* Modal de captura específico */
#modalCapture.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex; /* Usamos flex para centrar */
    align-items: center;
    justify-content: center;
}

/* Contenedor del modal */
#modalCapture .modal-dialog.modal-dialog-centered {
    position: relative;
    max-width: 90vw; /* Máximo ancho relativo a la ventana */
    max-height: 90vh; /* Máximo alto relativo a la ventana */
    margin: 0; /* Eliminamos márgenes por defecto */
}

/* Contenedor de la imagen */
#modalCapture .imageContainer {
    padding: 20px;
    background: transparent; /* Sin fondo blanco */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Imagen dentro del modal */
#modalCapture .zoomable-image {
    max-width: 100%;
    max-height: 80vh; /* Limita la altura para no salirse de la pantalla */
    object-fit: contain; /* Mantiene proporciones sin distorsión */
    border-radius: 8px; /* Bordes redondeados para un look profesional */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* Sombra suave */
    cursor: zoom-in;
    transition: transform 0.3s ease; /* Suaviza el zoom */
}

#modalCapture .zoomable-image.zoomed-in {
    transform: scale(1.5); /* Ajusta el nivel de zoom */
    cursor: zoom-out;
}

/* Botón de cerrar */
#modalCapture .close {
    color: white;
    background-color: #ff4d4d;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1111;
    transition: background-color 0.3s, transform 0.2s;
}

#modalCapture .close:hover,
#modalCapture .close:focus {
    background-color: #cc0000;
    transform: scale(1.1);
}

/* Responsividad */
@media (max-width: 768px) {
    #modalCapture .modal-dialog.modal-dialog-centered {
        max-width: 95vw;
        max-height: 85vh;
    }

    #modalCapture .zoomable-image {
        max-height: 70vh;
    }
}

@media (max-width: 480px) {
    #modalCapture .modal-dialog.modal-dialog-centered {
        max-width: 98vw;
        max-height: 80vh;
    }

    #modalCapture .zoomable-image {
        max-height: 60vh;
    }

    #modalCapture .close {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
}
}