/* Modal de Conteo - Estilos */
.conteo-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
  left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

.conteo-modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
max-width: 600px;
    width: 100%;
    max-height: 90vh;
  overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.conteo-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.conteo-modal-body {
    padding: 24px;
}

.conteo-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.conteo-foto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.conteo-foto-item {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.conteo-foto-item img {
  width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.conteo-foto-actions {
    position: absolute;
 bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 8px;
    display: flex;
    gap: 4px;
    justify-content: center;
}

/* ===== ESTILOS DE CÁMARA ===== */

/* Contenedor de preview de cámara */
.camera-preview-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Video preview */
.camera-video-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Efecto espejo para mejor UX */
}

/* Controles de cámara */
.camera-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 10001;
}

/* Botón de captura (circular grande) */
.camera-capture-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: white;
    border: 4px solid #fff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-capture-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.5);
}

.camera-capture-btn::before {
    content: '';
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    border: 2px solid #333;
}

/* Botón de cerrar cámara */
.camera-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    z-index: 10002;
}

.camera-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Indicador de cámara activa */
.camera-indicator {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10002;
}

.camera-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Responsive */
@media (max-width: 768px) {
    .conteo-modal-content {
        max-width: 100%;
        margin: 10px;
    }
    
    .conteo-foto-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .camera-capture-btn {
        width: 80px;
        height: 80px;
    }

    .camera-capture-btn::before {
        width: 70px;
        height: 70px;
    }

    .camera-controls {
        padding: 30px;
    }
}

/* Orientación horizontal */
@media (orientation: landscape) {
    .camera-video-preview {
        object-fit: contain;
    }
}
